:root {
  --blue-950: #051428;
  --blue-900: #0a2540;
  --blue-800: #0d3159;
  --blue-700: #124274;
  --blue-600: #1a5490;
  --blue-500: #2870b8;
  --blue-400: #4c93d9;
  --blue-300: #8bbde8;
  --blue-200: #c3ddf2;
  --blue-100: #e7f1fb;
  --blue-50: #f4f9fd;
  --accent: #ffb020;
  --ink: #0a2540;
  --muted: #5b7285;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(10, 37, 64, 0.12);
  --shadow-sm: 0 2px 10px rgba(10, 37, 64, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--blue-50);
  color: var(--ink);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  /* Longhand on purpose: some sections carry class="container" directly on
     the <section> tag, so a shorthand "padding" here would win on specificity
     over section's own top/bottom padding and collapse it to 0. */
  padding-left: 20px;
  padding-right: 20px;
}

/* Top bar (manager / contacts / cabinet) */
.topbar {
  background: linear-gradient(90deg, #0a2a63, #0d3480);
  color: white;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.topbar-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex: none;
}

.topbar-word {
  display: flex;
  flex-direction: column;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.topbar-word small {
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--blue-200);
}

.topbar-info {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.topbar-contact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: white;
  font-weight: 700;
  white-space: nowrap;
}

.cabinet-btn {
  flex: none;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.55);
  color: white;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cabinet-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

body > header {
  position: sticky;
  top: 0;
  z-index: 55;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--blue-100);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--blue-800);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--blue-600);
  border-bottom-color: var(--blue-500);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-900);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.cart-button:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
}

.cart-count {
  background: var(--accent);
  color: var(--blue-950);
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  padding: 0 5px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--blue-900);
  cursor: pointer;
}

/* Page hero */
.page-hero {
  background: var(--blue-50);
  padding: 64px 0 56px;
  text-align: center;
  border-bottom: 1px solid var(--blue-100);
}

.page-hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-100);
  border: 1px solid var(--blue-200);
  color: var(--blue-600);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.page-hero h1 {
  font-size: 2.5rem;
  line-height: 1.15;
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #16202e;
}

.page-hero p.lead {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 56ch;
  margin: 0 auto 28px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 14px 26px;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--blue-950);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 176, 32, 0.35);
}

.btn-dark {
  background: var(--blue-900);
  color: white;
}

.btn-dark:hover {
  background: var(--blue-700);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 36px;
}

.stat-card {
  background: white;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-card .num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue-900);
}

.stat-card .label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Sections */
section {
  padding: 64px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.8rem;
  margin: 0 0 6px;
  color: var(--blue-900);
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.tag {
  display: inline-block;
  color: var(--blue-500);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.cat-card {
  background: white;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--blue-300);
}

.cat-card .emoji {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 10px;
}

.cat-card .name {
  font-weight: 700;
  color: var(--blue-900);
}

/* Why us */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.why-card {
  background: white;
  border-radius: var(--radius);
  padding: 26px 22px;
  border: 1px solid var(--blue-100);
  box-shadow: var(--shadow-sm);
}

.why-card .icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--blue-100);
  color: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.why-card h3 {
  margin: 0 0 8px;
  color: var(--blue-900);
  font-size: 1.05rem;
}

.why-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  counter-reset: step;
}

.step-card {
  position: relative;
  background: var(--blue-900);
  color: white;
  border-radius: var(--radius);
  padding: 26px 22px;
}

.step-card .step-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 10px;
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.step-card p {
  margin: 0;
  color: var(--blue-200);
  font-size: 0.9rem;
}

/* CTA band */
.cta-band {
  background: linear-gradient(120deg, var(--blue-700), var(--blue-500));
  border-radius: 20px;
  padding: 44px 40px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.cta-band h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.cta-band p {
  margin: 0;
  color: var(--blue-100);
}

/* Filters */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.filter-chip {
  border: 1px solid var(--blue-200);
  background: white;
  color: var(--blue-800);
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--blue-400);
}

.filter-chip.active {
  background: var(--blue-900);
  border-color: var(--blue-900);
  color: white;
}

/* Product grid */
.product-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-row {
  background: white;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 18px 20px;
  transition: box-shadow 0.15s ease;
}

.product-row:hover {
  box-shadow: var(--shadow);
}

.product-row-media {
  flex: none;
  width: 200px;
  height: 200px;
  background: linear-gradient(145deg, var(--blue-100), var(--blue-50));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  overflow: hidden;
}

.product-row-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-row-actions {
  flex: none;
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}

.product-row-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-row-price,
.product-row-cart {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.add-btn-label {
  display: none;
}

.product-row-actions .qty-input {
  width: 100%;
}

.product-row-actions .add-btn {
  flex: none;
  width: 100%;
  margin-top: 14px;
}

.product-row-actions .availability-badge {
  font-size: 0.9rem;
  padding: 4px 12px;
}

.add-btn-icon {
  font-size: 1.1rem;
  padding: 10px 0;
}

.product-row-subtotal {
  font-size: 0.78rem;
  color: var(--muted);
}

.product-brand {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue-500);
}

.product-name {
  font-weight: 700;
  color: var(--blue-900);
  font-size: 1rem;
  margin: 0;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  flex: 1;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.product-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--blue-900);
}

.product-price small {
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--muted);
}

.product-rrp {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #9b1c1c;
}

.product-detail-price .product-rrp {
  font-size: 1.05rem;
}

/* Single product page */
.product-back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-weight: 600;
  color: var(--blue-600);
}

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  padding-bottom: 60px;
}

.product-detail-media {
  background: linear-gradient(145deg, var(--blue-100), var(--blue-50));
  border-radius: var(--radius);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px 16px 0;
}

.product-detail-media img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;
}

.product-detail-emoji {
  font-size: 6rem;
}

.product-detail-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 12px 0;
}

.product-detail-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: white;
  flex-shrink: 0;
}

.product-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-thumb.active {
  border-color: var(--blue-500);
}

.product-detail-name {
  font-size: 1.7rem;
  color: var(--blue-900);
  margin: 0 0 10px;
}

.product-detail-meta {
  color: var(--muted);
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.product-detail-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--blue-900);
}

.product-detail-price small {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.product-detail-add {
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 780px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
}

.product-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.qty-input {
  width: 64px;
  padding: 9px 8px;
  border: 1px solid var(--blue-200);
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.add-btn {
  flex: 1;
  background: var(--blue-600);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.add-btn:hover {
  background: var(--blue-700);
}

.add-btn.added {
  background: #1f9d55;
}

.availability-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.availability-in-stock {
  background: #e3f6e9;
  color: #1f9d55;
}

.availability-on-order {
  background: #fff3e0;
  color: #b8720a;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

/* Contacts */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.contact-card {
  background: white;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
}

.contact-card .icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.contact-card h3 {
  margin: 0 0 6px;
  color: var(--blue-900);
}

/* "Email: fastswim.kz@gmail.com" — label and value on one line */
.contact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.contact-line h3 {
  margin: 0;
  font-size: 1.05rem;
}

.contact-card p,
.contact-card a {
  margin: 0;
  color: var(--muted);
}

.contact-card .value {
  font-weight: 700;
  color: var(--blue-700);
  font-size: 1.05rem;
}

.placeholder-note {
  font-size: 0.78rem;
  color: var(--blue-400);
  margin-top: 8px;
}

/* Cart drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 20, 40, 0.45);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  background: var(--blue-50);
  z-index: 91;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.2);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--blue-900);
  color: white;
}

.cart-drawer-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.cart-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  background: white;
  border: 1px solid var(--blue-100);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--blue-900);
}

.cart-item-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.cart-item-remove {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 1.1rem;
}

.cart-drawer-foot {
  padding: 18px 20px 22px;
  border-top: 1px solid var(--blue-100);
  background: white;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.cart-brand-min {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 10px;
  font-size: 0.85rem;
}

.cart-brand-min-title {
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: 6px;
}

.cart-brand-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
  font-weight: 600;
}

.cart-brand-line.ok {
  color: #1e7a46;
}

.cart-brand-line.short {
  color: #b45309;
}

.cart-drawer-foot [data-inquiry-open]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Inquiry form */
.form-grid {
  display: grid;
  gap: 14px;
}

.form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue-800);
  margin-bottom: 6px;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--blue-200);
  border-radius: 9px;
  font-size: 0.92rem;
  font-family: inherit;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--blue-400);
  outline-offset: 1px;
}

.form-error {
  color: #c0392b;
  font-size: 0.82rem;
  margin-top: 4px;
  display: none;
}

/* Admin page */
.admin-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-50);
  padding: 20px;
}

.admin-gate-box {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px;
  max-width: 380px;
  width: 100%;
}

.admin-gate [data-admin-gate-error] {
  display: none;
  text-align: center;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--blue-100);
}

.admin-tab {
  background: none;
  border: none;
  padding: 10px 4px;
  margin-bottom: -1px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.admin-tab.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-600);
}

.admin-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-row {
  background: white;
  border: 1px solid var(--blue-100);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.admin-row-media {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 8px;
  background: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  overflow: hidden;
}

.admin-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-row-info {
  flex: 1;
  min-width: 0;
}

.admin-row-name {
  font-weight: 700;
  color: var(--blue-900);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-row-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.role-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.role-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.role-tiers {
  background: var(--blue-50);
  border: 1px dashed var(--blue-300);
  border-radius: 12px;
  padding: 14px;
}

.role-tiers-title {
  font-weight: 700;
  color: var(--blue-800);
}

.role-tiers-hint {
  margin: 4px 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.tier-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tier-row input {
  flex: 1;
  min-width: 120px;
}

.brand-picker {
  position: relative;
}

.brand-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  background: white;
  border: 1px solid var(--blue-200);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 55, 100, 0.12);
  max-height: 180px;
  overflow-y: auto;
}

.brand-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--blue-900);
}

.brand-option:hover,
.brand-option:focus {
  background: var(--blue-50);
}

.brand-suggestion {
  margin-top: 8px;
  background: var(--blue-50);
  border: 1px dashed var(--blue-300);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  color: var(--blue-700);
}

.brand-suggestion kbd {
  background: white;
  border: 1px solid var(--blue-200);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 0.78rem;
}

/* Size chips — admin input */
.size-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.size-chips:empty {
  margin-bottom: 0;
}

.size-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px 0 10px;
  background: var(--blue-100);
  color: var(--blue-800);
  border-radius: 7px;
  font-weight: 700;
  font-size: 0.85rem;
}

.size-chip-remove {
  background: none;
  border: none;
  color: var(--blue-500);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 2px;
}

.size-chip-remove:hover {
  color: #c0392b;
}

.image-thumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--blue-50);
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  border: none;
  border-radius: 5px;
  width: 20px;
  height: 20px;
  line-height: 1;
  cursor: pointer;
  font-size: 0.75rem;
}

.image-thumb-remove:hover {
  background: #c0392b;
}

.size-add-row {
  display: flex;
  gap: 8px;
}

.size-add-row input {
  border: 1px solid var(--blue-200);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 0.9rem;
  font-family: inherit;
}

.size-add-row input[data-size-name-input] {
  flex: 1;
}

.size-add-row input[data-size-qty-input] {
  width: 90px;
}

/* Size order table — Размер / Доступно / Кол-во rows, catalog row and product page.
   Wide screens: a real table (labels in column 1, each size's .size-col is
   "display: contents" so its three cells land in rows 1-3 of column --col).
   Phones: see the max-width: 900px block below — each size becomes a card. */
.size-order-table {
  margin: 8px 0;
  display: grid;
  grid-template-columns: 68px;
  grid-auto-columns: 46px;
  grid-template-rows: auto auto auto;
  gap: 4px 10px;
  align-items: center;
  justify-content: start;
  max-width: 100%;
  overflow-x: auto;
}

.size-order-hint {
  display: none;
}

/* "Таблица размеров" link + popup */
.size-chart-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--blue-700);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
}

.size-chart-link:hover {
  color: var(--blue-500);
}

.size-chart-line {
  margin-bottom: 8px;
}

.size-chart-box {
  max-width: 600px;
}

.size-chart-box.with-guide {
  max-width: 1000px;
}

/* A wide table with no photo beside it still needs room for all its columns */
.size-chart-box.is-roomy {
  max-width: 760px;
}

/* On short screens only the inside of the popup scrolls, so the ✕ stays put in the corner */
.size-chart-box {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.size-chart-body {
  overflow-y: auto;
  padding: 28px;
}

.size-chart-box .modal-close-btn {
  z-index: 2;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: white;
}

/* Stacked by default (phones, tablets): title, table, then the measuring guide under it.
   Wide screens put the guide beside the table, see the min-width block below. */
.size-chart-layout {
  display: flex;
  flex-direction: column;
}

.size-chart-heading {
  margin: 0 0 calc(0.83em + 14px);
  font-size: 1.5rem;
  color: var(--blue-900);
}

.size-chart-main {
  min-width: 0;
}

.size-chart-scroll {
  overflow-x: auto;
}

.size-chart-guide {
  max-width: 340px;
}

.size-chart-guide-heading {
  margin: 22px 0 10px;
  font-size: 1.1rem;
}

.size-chart-guide img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.size-chart-tips {
  margin-top: 20px;
}

.size-chart-tips h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: var(--blue-900);
}

.size-chart-asterisk {
  color: #d32f2f;
}

.size-chart-guide > .size-chart-notes:first-child {
  margin-top: 0;
}

.size-chart-notes {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--blue-900);
}

.size-chart-notes b {
  font-weight: 800;
}

/* Room for two columns: table and measuring guide side by side. Each column starts
   with a heading of the same size on the same line, with a clear gap between them,
   so the table and the photo begin at the same height. */
@media (min-width: 901px) {
  .size-chart-box.with-guide .size-chart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    column-gap: 44px;
    align-items: start;
  }

  .size-chart-box.with-guide .size-chart-heading {
    grid-column: 1;
    grid-row: 1;
  }

  .size-chart-box.with-guide .size-chart-main {
    grid-column: 1;
    grid-row: 2;
  }

  .size-chart-box.with-guide .size-chart-guide-heading {
    grid-column: 2;
    grid-row: 1;
    margin: 0 0 calc(0.83em + 14px);
    font-size: 1.5rem;
  }

  .size-chart-box.with-guide .size-chart-guide {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
  }

  /* Same text size as the table next to it */
  .size-chart-box.with-guide .size-chart-notes {
    font-size: 0.92rem;
  }
}

.size-chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.size-chart-table th,
.size-chart-table td {
  padding: 9px 10px;
  border: 1px solid var(--blue-100);
  text-align: left;
}

.size-chart-table thead th {
  background: var(--blue-50);
  color: var(--blue-900);
  font-size: 0.74rem;
  text-transform: uppercase;
  vertical-align: middle;
}

.size-chart-table tbody th {
  font-weight: 800;
  color: var(--blue-900);
}

/* Ranges like "101-105" stay on one line instead of breaking after the dash */
.size-chart-table.is-wide td {
  white-space: nowrap;
}

/* Phones: a wider popup and a denser table so all five columns fit without sideways scrolling */
@media (max-width: 560px) {
  .modal-overlay.size-chart-overlay {
    padding: 8px;
  }

  /* .modal-box (defined later) re-applies 28px padding to the popup, which on
     a phone ate the width the table needs — the inner body already pads. */
  .modal-box.size-chart-box {
    padding: 0;
  }

  .size-chart-overlay .size-chart-body {
    padding: 22px 14px 16px;
  }

  .size-chart-box h2 {
    font-size: 1.15rem;
    padding-right: 28px;
  }

  .size-chart-table {
    font-size: 0.88rem;
  }

  .size-chart-table th,
  .size-chart-table td {
    padding: 8px 5px;
  }

  .size-chart-table thead th {
    font-size: 0.6rem;
  }

  /* Seven or more columns (e.g. the knee-suit chart) or long ranges like "154-157": denser, numbers on one line */
  .size-chart-table.is-wide {
    font-size: 0.76rem;
  }

  .size-chart-table.is-wide th,
  .size-chart-table.is-wide td {
    padding: 8px 3px;
    white-space: nowrap;
  }

  .size-chart-table.is-wide thead th {
    font-size: 0.54rem;
    white-space: normal;
  }
}

.size-table-labels,
.size-col {
  display: contents;
}

.size-table-labels > :nth-child(1),
.size-col > :nth-child(1) {
  grid-row: 1;
}

.size-table-labels > :nth-child(2),
.size-col > :nth-child(2) {
  grid-row: 2;
}

.size-table-labels > :nth-child(3),
.size-col > :nth-child(3) {
  grid-row: 3;
}

.size-table-labels > * {
  grid-column: 1;
}

.size-col > * {
  grid-column: var(--col);
}

.size-table-label {
  width: 68px;
  flex: none;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.size-table-cell {
  width: 46px;
  flex: none;
  text-align: center;
  font-size: 0.85rem;
  color: var(--blue-900);
  font-weight: 700;
}

.size-table-avail {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.76rem;
}

.size-order-qty {
  width: 40px;
  padding: 5px 2px;
  border: 1px solid var(--blue-200);
  border-radius: 6px;
  text-align: center;
  font-size: 0.85rem;
  font-family: inherit;
}

.size-order-qty:disabled {
  background: var(--blue-100);
  color: var(--muted);
  cursor: not-allowed;
}

.size-order-table.compact {
  grid-template-columns: 56px;
  grid-auto-columns: 40px;
}

.size-order-table.compact .size-table-label {
  width: 56px;
  font-size: 0.72rem;
}

.size-order-table.compact .size-table-cell {
  width: 40px;
  font-size: 0.8rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 20, 40, 0.55);
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
}

.modal-box h2 {
  margin-top: 0;
  color: var(--blue-900);
}

.modal-success {
  text-align: center;
  padding: 20px 0;
}

.modal-success .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.gate-modal {
  text-align: center;
}

.gate-modal .icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
}

.gate-modal p {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
  margin: 0 0 22px;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.gate-modal-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: center;
  margin: 12px 0 16px;
}

.gate-modal-error {
  color: #c0392b;
}

.login-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.login-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--blue-100);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: login-spin 0.8s linear infinite;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--blue-100);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px;
  min-width: 160px;
  z-index: 70;
}

.account-menu-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--blue-900);
  padding: 6px 10px;
}

.account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.account-menu-item:hover {
  background: var(--blue-50);
  color: var(--blue-800);
}

/* Partner cabinet: discounts + inquiries */
.cabinet-card {
  background: white;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

.cabinet-card-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--blue-900);
  margin-bottom: 8px;
}

.cabinet-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 14px;
}

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

.discount-table th,
.discount-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--blue-100);
  font-size: 0.95rem;
}

.discount-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.discount-table th:last-child,
.discount-table td:last-child {
  text-align: right;
  font-weight: 800;
  color: var(--blue-800);
}

.order-card {
  background: white;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.order-number {
  font-weight: 800;
  color: var(--blue-900);
  margin-right: 10px;
}

.order-date {
  color: var(--muted);
  font-size: 0.85rem;
}

.order-status {
  background: var(--blue-100);
  color: var(--blue-800);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 999px;
}

.order-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0 0 14px;
}

.order-steps li {
  flex: 1;
  min-width: 92px;
  text-align: center;
  font-size: 0.72rem;
  padding: 6px 4px;
  border-radius: 6px;
  background: var(--blue-50);
  color: var(--muted);
}

.order-steps li.done {
  background: var(--blue-200);
  color: var(--blue-800);
}

.order-steps li.current {
  background: var(--blue-600);
  color: white;
  font-weight: 700;
}

.order-items {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.order-items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--blue-100);
}

.inquiry-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0 0 14px;
  font-size: 0.9rem;
}

.inquiry-meta dt {
  color: var(--muted);
}

.inquiry-meta dd {
  margin: 0;
  color: var(--blue-900);
  overflow-wrap: anywhere;
}

.inquiry-item-sub {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
}

.inquiry-item-sum {
  text-align: right;
  white-space: nowrap;
}

.inquiry-comment {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--blue-100);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
}

.order-total {
  text-align: right;
  font-weight: 800;
  color: var(--blue-900);
}

.order-total small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Footer */
.site-footer {
  background: var(--blue-950);
  color: var(--blue-200);
  padding: 48px 0 26px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.footer-grid h4 {
  color: white;
  margin: 0 0 14px;
  font-size: 0.95rem;
}

.footer-grid a {
  display: block;
  color: var(--blue-300);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  font-size: 0.82rem;
  color: var(--blue-400);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--blue-900);
  color: white;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 99;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* .topbar-inner / .header-inner set "padding: 14px 0", which overrides the
   container's 20px side padding — below the container's max width that left
   the logo, the name button and the cart button touching the screen edges. */
@media (max-width: 1180px) {
  .topbar-inner,
  .header-inner {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .topbar-info {
    display: none;
  }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
    gap: 14px;
    border-bottom: 1px solid var(--blue-100);
    box-shadow: var(--shadow);
    display: none;
    z-index: 60;
  }
  .main-nav.open {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
  .page-hero h1 {
    font-size: 2rem;
  }
  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }
  .topbar-inner {
    flex-wrap: wrap;
  }
}

/* Catalog on phones and tablets: a tidy card. Photo on the left with the
   brand/name and price beside it, the sizes as wrapping cards underneath
   (so nothing runs off the screen), and one full-width "В заявку" button. */
@media (max-width: 900px) {
  .product-row {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-areas:
      "media head"
      "price price"
      "sizes sizes"
      "meta meta"
      "cart cart";
    gap: 10px 14px;
    align-items: start;
    padding: 14px;
  }

  .product-row-media {
    grid-area: media;
    width: 104px;
    height: 104px;
  }

  .product-row-body,
  .product-row-actions {
    display: contents;
  }

  .product-row-head {
    grid-area: head;
  }

  .product-row-price {
    grid-area: price;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--blue-100);
    text-align: left;
  }

  .product-row-price .product-price {
    line-height: 1.3;
  }

  .product-row .size-order-table,
  .product-row .product-desc {
    grid-area: sizes;
  }

  .product-row .product-meta {
    grid-area: meta;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px 14px;
  }

  .product-row-cart {
    grid-area: cart;
    width: auto;
    align-items: stretch;
  }

  .product-row-actions .add-btn {
    margin-top: 0;
    padding: 12px;
  }

  .add-btn-label {
    display: inline;
  }

  .product-row-subtotal {
    text-align: center;
  }

  .size-order-table,
  .size-order-table.compact {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    grid-auto-columns: auto;
    gap: 8px;
    overflow: visible;
  }

  .size-order-hint {
    display: block;
    grid-column: 1 / -1;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
  }

  .size-table-labels {
    display: none;
  }

  .size-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: 10px;
  }

  .size-order-table .size-table-cell,
  .size-order-table.compact .size-table-cell {
    width: auto;
  }

  .size-order-qty {
    width: 100%;
    max-width: 60px;
    padding: 8px 2px;
    font-size: 1rem;
  }
}
