@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --page-bg: #f4f7fb;
  --page-bg-admin: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --surface-accent: #edf8fd;
  --surface-strong: #122033;
  --text: #162235;
  --muted: #617286;
  --line: #dde6ee;
  --line-strong: #cad7e2;
  --accent: #00a8e6;
  --accent-strong: #007db4;
  --accent-soft: #e8f7fc;
  --danger: #c9564b;
  --success: #24885d;
  --warning: #9b7418;
  --shadow-soft: 0 10px 28px rgba(18, 32, 51, 0.06);
  --shadow-medium: 0 18px 38px rgba(18, 32, 51, 0.08);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font: 400 15px/1.65 "Manrope", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  background: var(--page-bg);
}

body.public-body {
  background: linear-gradient(180deg, #fcfdff 0%, var(--page-bg) 30%, #edf2f7 100%);
}

body.admin-body {
  background: linear-gradient(180deg, #fafbfd 0%, var(--page-bg-admin) 100%);
}

body.modal-open {
  overflow: hidden;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

a:hover {
  color: var(--accent);
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

main {
  min-height: calc(100vh - 220px);
}

.shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
}

.catalog-shell {
  width: min(1440px, calc(100vw - 36px));
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--surface-strong);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(18, 32, 51, 0.04);
}

.header-ribbon {
  background: linear-gradient(90deg, #0095d2 0%, #00aee8 100%);
  color: #ffffff;
}

.header-ribbon-inner {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-ribbon-copy,
.header-ribbon-accent {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-ribbon-accent {
  color: rgba(255, 255, 255, 0.9);
}

.header-row,
.header-actions,
.header-link-group,
.category-strip-inner,
.admin-nav-inner,
.button-row,
.panel-head,
.table-actions,
.cart-actions,
.inline-form,
.toolbar-form,
.code-list,
.footer-grid,
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-row {
  justify-content: space-between;
  gap: 28px;
  padding: 18px 0;
}

.brand-wrap {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  width: clamp(144px, 18vw, 204px);
  height: auto;
  display: block;
  flex: 0 0 auto;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(18, 32, 51, 0.14);
}

.brand-copy strong {
  display: block;
  font-size: 1.46rem;
}

.brand-copy small {
  display: block;
  margin-top: 3px;
  color: #728399;
  font-size: 0.9rem;
  font-weight: 600;
}

.brand-claim {
  max-width: 56ch;
  color: var(--muted);
  font-size: 0.94rem;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-utility-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.header-link-group {
  flex-wrap: wrap;
  min-width: 0;
}

.header-menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--surface-strong);
}

.header-menu-toggle svg {
  width: 20px;
  height: 20px;
}

.header-actions form,
.table-actions form {
  margin: 0;
}

.text-link,
.header-user,
.admin-link {
  color: #607287;
  font-size: 0.92rem;
  font-weight: 700;
}

.header-user {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  max-width: min(100%, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-mode-form {
  margin: 0;
}

.header-icon-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: #607287;
  box-shadow: none;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.header-icon-button:hover {
  color: var(--accent-strong);
  border-color: #b9dbe8;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(18, 32, 51, 0.08);
}

.header-icon-button:focus-visible {
  outline: 0;
  border-color: #8fd0e6;
  box-shadow: 0 0 0 4px rgba(0, 168, 230, 0.16);
}

.header-icon-button:active {
  transform: translateY(1px);
}

.header-icon-button svg {
  width: 18px;
  height: 18px;
}

.header-icon-button-active {
  color: var(--accent-strong);
  border-color: #b9dbe8;
  background: var(--accent-soft);
}

.text-link:hover,
.admin-link:hover {
  color: var(--accent-strong);
}

.category-strip,
.admin-nav {
  border-top: 1px solid #eef3f7;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.category-strip-inner,
.admin-nav-inner {
  justify-content: flex-start;
  min-height: 54px;
  padding: 8px 0;
  overflow-x: auto;
}

.category-strip-label {
  flex: 0 0 auto;
  color: #6d8096;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-right: 6px;
}

.chip,
.badge,
.button-pill,
.cart-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 9px 14px;
  color: #516477;
  font-size: 0.9rem;
  font-weight: 600;
}

.chip:hover,
.chip-active {
  background: var(--accent-soft);
  border-color: #bce2ef;
  color: var(--accent-strong);
}

.admin-link {
  padding: 8px 12px;
  border-radius: 999px;
}

.admin-link-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.site-footer {
  margin-top: 56px;
  padding: 44px 0 28px;
  background: linear-gradient(180deg, #142033 0%, #0f1725 100%);
  color: #ffffff;
}

.footer-grid {
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.footer-grid p {
  max-width: 56ch;
  color: rgba(255, 255, 255, 0.82);
}

.footer-links {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-code-box {
  width: min(100%, 340px);
  display: grid;
  gap: 10px;
}

.footer-code-box strong {
  margin-bottom: 0;
}

.footer-code-box p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
}

.footer-code-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.footer-code-form input {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.footer-code-form input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.footer-code-form input:focus {
  border-color: rgba(158, 230, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(0, 168, 230, 0.16);
}

.footer-code-form .button-secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.footer-code-form .button-secondary:hover {
  border-color: rgba(158, 230, 255, 0.46);
  color: #9ee6ff;
}

.footer-links a {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-links a:hover {
  color: #9ee6ff;
}

.flash-stack {
  padding-top: 18px;
}

.flash {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.flash-success {
  border-left-color: var(--success);
  background: #f4fbf7;
}

.flash-error {
  border-left-color: var(--danger);
  background: #fff7f6;
}

.flash-warning {
  border-left-color: var(--warning);
  background: #fff9ed;
}

.eyebrow,
.filter-heading {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catalog-shell,
.success-wrap,
.auth-wrap,
.admin-section {
  padding: 24px 0 48px;
}

.catalog-shell,
.detail-content,
.checkout-side,
.stack-form,
.list-stack,
.history-list,
.detail-list,
.delivery-fields {
  display: grid;
  gap: 16px;
}

.catalog-filter-area,
.panel,
.filters-panel,
.product-card,
.cart-item,
.success-card,
.auth-card,
.detail-media,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.catalog-filter-area,
.panel,
.filters-panel,
.success-card,
.auth-card,
.detail-media {
  padding: 18px;
}

.catalog-filter-area {
  display: grid;
  gap: 10px;
}

.catalog-category-description {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.catalog-filter-form {
  display: grid;
  gap: 12px;
}

.catalog-toolbar,
.catalog-sort-group,
.catalog-spec-filters {
  display: grid;
  gap: 12px;
}

.catalog-advanced-filters {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.catalog-advanced-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  color: #42576b;
  font-size: 0.92rem;
  font-weight: 700;
}

.catalog-advanced-summary::-webkit-details-marker {
  display: none;
}

.catalog-advanced-summary small {
  color: #72869a;
  font-size: 0.78rem;
  font-weight: 600;
}

.catalog-advanced-summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cdd9e2;
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent-strong);
  font-size: 1rem;
  line-height: 1;
}

.catalog-advanced-filters[open] .catalog-advanced-summary::after {
  content: "−";
}

.catalog-toolbar {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: start;
}

.catalog-sort-group,
.catalog-price-filter {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.catalog-sort-group {
  gap: 8px;
}

.catalog-sort-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.catalog-filter-label {
  color: #60748a;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #53677a;
  font-size: 0.82rem;
  font-weight: 700;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.filter-chip:hover {
  border-color: #b9dbe8;
  color: var(--accent-strong);
}

.filter-chip-active {
  border-color: #b9dbe8;
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(0, 151, 212, 0.08);
}

.catalog-price-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.catalog-price-values {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--surface-strong);
  font-size: 0.88rem;
}

.catalog-price-values span {
  width: 12px;
  height: 1px;
  background: #bcc9d4;
}

.price-slider-wrap {
  position: relative;
  height: 28px;
  margin-top: 2px;
}

.price-slider-track,
.price-slider-progress {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.price-slider-track {
  background: #dbe4eb;
}

.price-slider-progress {
  background: linear-gradient(90deg, #14b1ee 0%, #0097d4 100%);
}

.catalog-price-filter input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  appearance: none;
}

.catalog-price-filter input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 6px 14px rgba(0, 125, 180, 0.25);
  pointer-events: auto;
  appearance: none;
}

.catalog-price-filter input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 6px 14px rgba(0, 125, 180, 0.25);
  pointer-events: auto;
  appearance: none;
}

.catalog-price-filter input[type="range"]::-webkit-slider-runnable-track,
.catalog-price-filter input[type="range"]::-moz-range-track {
  background: transparent;
}

.section-head,
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.catalog-spec-filters {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: start;
}

.catalog-results {
  min-width: 0;
}

.catalog-results-full {
  padding-top: 6px;
}

.field-block {
  display: grid;
  gap: 6px;
}

.field-block-search {
  align-self: start;
}

.field-block-compact {
  align-self: start;
}

.field-block-spec-range {
  align-self: start;
}

.range-inline-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.field-grid {
  display: grid;
  gap: 16px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label,
legend {
  color: #60748a;
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #81d8f2;
  box-shadow: 0 0 0 4px rgba(0, 168, 230, 0.12);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(180deg, #14b1ee 0%, #0097d4 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 151, 212, 0.2);
}

.button-primary:hover {
  color: #ffffff;
  background: linear-gradient(180deg, #1ab9f7 0%, #008dc8 100%);
}

.button-secondary {
  background: #ffffff;
  border-color: var(--line);
  color: var(--surface-strong);
}

.button-secondary:hover {
  color: var(--accent-strong);
  border-color: #b8deec;
}

.button-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.button-ghost:hover {
  color: var(--danger);
  border-color: #e6c1bd;
}

.button-block {
  width: 100%;
}

.button-pill {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  font-size: 0.72rem;
}

.divider {
  height: 1px;
  background: var(--line);
}

.inline-banner,
.empty-state {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.inline-banner {
  background: var(--surface-soft);
}

.empty-state {
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  display: block;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #cde1ea;
  box-shadow: var(--shadow-medium);
}

.product-image-link {
  display: block;
  padding: 10px 10px 0;
  background: linear-gradient(180deg, var(--surface-accent) 0%, #ffffff 100%);
}

.product-image,
.detail-image,
.cart-item-image {
  width: 100%;
  object-fit: cover;
  background: #e8eef4;
}

.product-image {
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border: 1px solid #e2ebf1;
  border-radius: 16px 16px 10px 10px;
}

.detail-image {
  aspect-ratio: 4 / 3;
  border: 1px solid #e2ebf1;
  border-radius: 16px;
}

.detail-gallery {
  display: grid;
  gap: 12px;
}

.detail-gallery-main {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.detail-gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
}

.detail-gallery-thumb {
  padding: 0;
  border: 1px solid #d8e3eb;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.detail-gallery-thumb:hover,
.detail-gallery-thumb.is-active {
  border-color: #91cfe5;
  box-shadow: 0 10px 22px rgba(0, 107, 156, 0.12);
  transform: translateY(-1px);
}

.detail-gallery-thumb-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #e8eef4;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 18, 0.8);
  backdrop-filter: blur(5px);
}

.gallery-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 1180px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.gallery-lightbox-image {
  width: 100%;
  max-height: min(86vh, 920px);
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(18, 28, 42, 0.72);
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1;
}

.gallery-lightbox-close {
  position: absolute;
  top: -10px;
  right: -10px;
}

.gallery-lightbox-nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.cart-item-image {
  aspect-ratio: 1 / 1;
  border: 1px solid #e2ebf1;
  border-radius: 14px;
}

.product-card-body {
  display: grid;
  gap: 10px;
  padding: 12px 12px 14px;
  min-width: 0;
}

.product-meta-row,
.product-card-footer,
.cart-item-main,
.summary-row,
.history-head,
.spec-row,
.detail-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-meta-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-label {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #cce7f2;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 700;
}

.badge {
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-neutral {
  background: #eff4f8;
  border-color: #dae4ec;
  color: #617487;
}

.badge-info {
  background: #e8f8ff;
  border-color: #cdebf6;
  color: #0b7ea9;
}

.badge-success {
  background: #edf9f1;
  border-color: #d0e7d9;
  color: #278553;
}

.badge-warning {
  background: #fff7e7;
  border-color: #efdfac;
  color: #9a7114;
}

.badge-muted {
  background: #f7f0f0;
  border-color: #ead8d8;
  color: #8b6464;
}

.product-title {
  font-size: 1.02rem;
  line-height: 1.28;
  min-height: 2.6em;
}

.product-description,
.muted-copy,
.section-copy,
.detail-address p {
  color: var(--muted);
}

.product-description {
  min-height: 3.2em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spec-grid,
.spec-list,
.stats-grid,
.admin-detail-grid,
.detail-layout,
.cart-layout {
  display: grid;
  gap: 18px;
}

.spec-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.spec-item,
.spec-row,
.detail-spec-card,
.detail-fact-card {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.spec-item span,
.detail-spec-card span,
.detail-fact-card span {
  display: block;
  color: #778b9d;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.spec-item strong,
.detail-spec-card strong,
.detail-fact-card strong {
  display: block;
  margin-top: 3px;
  color: #425160;
  font-size: 0.92rem;
}

.price-main {
  color: var(--surface-strong);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.price-strike {
  color: #8896a4;
  font-size: 0.86rem;
  text-decoration: line-through;
}

.detail-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: start;
  padding: 28px 0 48px;
}

.detail-content {
  gap: 20px;
}

.detail-description {
  color: var(--muted);
  line-height: 1.72;
}

.detail-price-wrap {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.detail-fact-row,
.detail-spec-grid {
  display: grid;
  gap: 12px;
}

.detail-fact-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-spec-section {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.detail-spec-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-form {
  flex-wrap: wrap;
}

.inline-form label {
  display: grid;
  gap: 8px;
  min-width: 120px;
}

.detail-buy-form {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: end;
  gap: 12px;
}

.detail-buy-form .button {
  width: 100%;
}

.cart-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
  align-items: start;
  padding: 28px 0 48px;
}

.cart-main,
.checkout-side {
  display: grid;
  gap: 18px;
}

.cart-head {
  align-items: center;
}

.cart-count-badge {
  border: 1px solid #cde6f0;
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 8px 12px;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

.cart-item {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.cart-item-body,
.cart-item-copy,
.cart-item-pricing,
.cart-quantity-form {
  display: grid;
  gap: 10px;
}

.cart-item-pricing {
  justify-items: end;
  text-align: right;
}

.cart-item-actions {
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.cart-quantity-form {
  grid-template-columns: auto 110px auto;
  align-items: end;
}

.cart-quantity-form label {
  min-width: auto;
}

.cart-remove-form {
  margin: 0;
}

.panel-code .section-copy {
  line-height: 1.7;
}

.summary-row {
  padding: 10px 0;
  border-bottom: 1px solid #e7edf2;
}

.summary-row:last-child {
  border-bottom: 0;
}

.total-row {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line-strong);
  font-size: 1.04rem;
}

.radio-row,
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.radio-row input,
.checkbox-row input {
  width: auto;
  margin: 0;
}

.error-text {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.is-hidden {
  display: none !important;
}

.delivery-fields.is-hidden {
  display: none;
}

.discount-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
}

.discount-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 28, 0.54);
  backdrop-filter: blur(6px);
}

.discount-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(205, 222, 234, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 68px rgba(18, 32, 51, 0.24);
}

.discount-modal-dialog h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.discount-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
}

.discount-modal-close svg {
  width: 16px;
  height: 16px;
}

.success-card,
.auth-card {
  max-width: 700px;
  margin: 0 auto;
}

.admin-section {
  display: grid;
  gap: 20px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 20px;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
}

.stat-card span {
  color: #72849a;
  font-size: 0.84rem;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  color: #71859a;
  font-size: 0.78rem;
  font-weight: 800;
}

.toolbar-form {
  flex-wrap: wrap;
}

.admin-form-table input,
.admin-form-table select,
.admin-form-table textarea {
  min-width: 110px;
}

.image-preview img {
  width: min(320px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.media-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.media-picker-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed #b8cedb;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fcfe 0%, #ffffff 100%);
}

.media-picker-card strong {
  color: #2a3d50;
  font-size: 0.95rem;
}

.media-picker-card small {
  color: #708398;
  line-height: 1.45;
}

.media-picker-card input[type="file"] {
  margin-top: 4px;
}

.admin-gallery-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.admin-gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid #dde8ef;
  border-radius: 12px;
}

.detail-list {
  margin-bottom: 12px;
}

.detail-address {
  display: grid;
  gap: 8px;
}

.detail-address h3 {
  color: #46596c;
}

.history-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item p {
  margin-top: 6px;
}

@media (max-width: 1080px) {
  .catalog-toolbar,
  .catalog-spec-filters {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout,
  .cart-layout,
  .admin-detail-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 22px, 1160px);
  }

  .site-header {
    position: relative;
  }

  .header-row {
    gap: 10px;
    padding: 12px 0;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: stretch;
    gap: 10px;
  }

  .header-utility-group {
    grid-column: 1 / -1;
    display: none;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  .header-utility-group.is-open {
    display: grid;
  }

  .header-link-group {
    width: 100%;
    justify-content: space-between;
  }

  .header-menu-toggle {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
  }

  .header-cart-button {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
  }

  .brand {
    width: 100%;
  }

  .brand-claim {
    display: none;
  }

  .brand-copy {
    display: none;
  }

  .category-strip-inner {
    min-height: auto;
    padding: 6px 0 12px;
    gap: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .category-strip-inner::-webkit-scrollbar {
    display: none;
  }

  .chip {
    padding: 8px 12px;
    font-size: 0.88rem;
    scroll-snap-align: start;
  }

  .field-grid.two,
  .spec-grid {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar,
  .catalog-spec-filters,
  .detail-fact-row,
  .detail-spec-grid {
    grid-template-columns: 1fr;
  }

  .catalog-shell,
  .detail-layout,
  .cart-layout,
  .success-wrap,
  .auth-wrap,
  .admin-section {
    padding-top: 18px;
  }

  .catalog-price-head {
    gap: 10px;
  }

  .catalog-sort-options {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .catalog-sort-options::-webkit-scrollbar {
    display: none;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .product-card {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: stretch;
  }

  .product-image-link {
    padding: 12px;
  }

  .product-image {
    height: 100%;
    min-height: 100%;
    aspect-ratio: auto;
    border-radius: 14px;
  }

  .product-card-body {
    padding: 14px 14px 14px 0;
    gap: 12px;
  }

  .product-meta-row {
    flex-wrap: wrap;
  }

  .product-meta-badges {
    justify-content: flex-start;
  }

  .product-description {
    min-height: auto;
  }

  .product-card-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .product-card-footer form,
  .product-card-footer .button {
    width: 100%;
  }

  .detail-layout,
  .cart-layout {
    gap: 14px;
  }

  .detail-price-wrap {
    padding: 16px;
  }

  .detail-buy-form {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
  }

  .detail-gallery-thumbnails {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  }

  .gallery-lightbox-dialog {
    width: min(100%, 760px);
    grid-template-columns: 1fr;
  }

  .gallery-lightbox-close {
    top: -6px;
    right: -2px;
  }

  .gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .gallery-lightbox-prev {
    left: 10px;
  }

  .gallery-lightbox-next {
    right: 10px;
  }

  .cart-item {
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 14px;
  }

  .cart-quantity-form {
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 8px;
  }

  .cart-quantity-form label,
  .cart-quantity-form .button {
    grid-column: 1 / -1;
  }

  .cart-item-pricing {
    justify-items: start;
    text-align: left;
  }

  .cart-item-main,
  .cart-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-remove-form .button,
  .cart-quantity-form .button {
    width: 100%;
  }

  .cart-head {
    align-items: flex-start;
  }

  .cart-count-badge {
    align-self: flex-start;
  }

  .footer-grid {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .footer-code-box {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .header-ribbon-inner,
  .header-row,
  .category-strip-inner,
  .admin-nav-inner {
    gap: 10px;
  }

  .header-ribbon-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: min(146px, 48vw);
  }

  .category-strip-label {
    display: none;
  }

  .catalog-shell,
  .success-wrap,
  .auth-wrap,
  .admin-section {
    padding: 20px 0 36px;
  }

  .catalog-filter-area,
  .panel,
  .filters-panel,
  .success-card,
  .auth-card,
  .detail-media,
  .stat-card,
  .cart-item {
    padding: 18px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    margin: 0 -6px;
  }

  .toolbar-form,
  .inline-form,
  .cart-actions {
    align-items: stretch;
  }

  .header-utility-group .header-link-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .header-utility-group .header-user {
    max-width: 100%;
  }

  .header-utility-group form,
  .header-utility-group .button,
  .header-utility-group .text-link {
    width: 100%;
  }

  .header-utility-group .text-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
  }

  .product-card {
    grid-template-columns: 1fr;
  }

  .product-card-body {
    padding: 14px;
  }

  .product-image-link {
    padding: 12px 12px 0;
  }

  .product-image {
    aspect-ratio: 4 / 3;
  }

  .gallery-lightbox {
    padding: 12px;
  }

  .gallery-lightbox-image {
    max-height: 78vh;
  }

  .catalog-price-filter,
  .catalog-sort-group,
  .detail-spec-section {
    padding: 16px;
  }

  .catalog-sort-options {
    display: grid;
  }

  .catalog-sort-options,
  .range-inline-inputs {
    grid-template-columns: 1fr;
  }

  .detail-buy-form {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 84px minmax(0, 1fr);
    padding: 12px;
  }

  .cart-count-badge {
    width: 100%;
    justify-content: center;
  }

  .footer-code-form {
    grid-template-columns: 1fr;
  }

  .discount-modal {
    align-items: end;
    padding: 12px;
  }

  .discount-modal-dialog {
    width: 100%;
    padding: 22px 18px 18px;
    border-radius: 24px 24px 18px 18px;
  }
}
