:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --text: #10131a;
  --muted: #6b7280;
  --line: rgba(16, 19, 26, 0.09);
  --primary: #005bff;
  --primary-strong: #0046c9;
  --primary-soft: rgba(0, 91, 255, 0.08);
  --accent: #ff6a00;
  --shadow: 0 6px 20px rgba(16, 19, 26, 0.06);
  --shadow-hover: 0 12px 28px rgba(16, 19, 26, 0.12);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

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

button {
  cursor: pointer;
}

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

/* ==================== HEADER ==================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ловушка для спам-ботов: остаётся в DOM, но не видна и не доступна людям.
   Не display:none — часть ботов такие поля пропускает. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(16, 19, 26, 0.07);
  box-shadow: 0 10px 34px rgba(16, 19, 26, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.site-header__inner {
  width: min(1280px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: #111827;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand__mark {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: cover;
  border-radius: 15px;
  background: #f7efe1;
  box-shadow: 0 9px 20px rgba(63, 42, 20, 0.18), inset 0 0 0 1px rgba(63, 42, 20, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover .brand__mark {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(63, 42, 20, 0.24), inset 0 0 0 1px rgba(63, 42, 20, 0.08);
}

.brand__text {
  font-size: 16px;
  line-height: 1.15;
  white-space: nowrap;
}

.header-search {
  position: relative;
  width: 100%;
}

.header-search input {
  width: 100%;
  height: 48px;
  padding: 0 50px 0 19px;
  border: 1px solid #e4e8ef;
  border-radius: 16px;
  background: #f5f7fa;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(16, 19, 26, 0.02);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.header-search input::placeholder {
  color: #7b8494;
}

.header-search input:hover {
  border-color: #d5dbe5;
  background: #f8f9fb;
}

.header-search input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft), 0 8px 24px rgba(0, 91, 255, 0.08);
}

.header-search__icon {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-58%);
  border: 2px solid #687386;
  border-radius: 50%;
  pointer-events: none;
}

.header-search__icon::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 2px;
  right: -5px;
  bottom: -4px;
  border-radius: 2px;
  background: #687386;
  transform: rotate(45deg);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.profile-toggle-btn {
  display: inline-flex;
  height: 48px;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid #dfe5ee;
  border-radius: 16px;
  background: #fff;
  color: #2d3748;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.profile-toggle-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 91, 255, 0.32);
  background: #f8fbff;
  color: var(--primary-strong);
}

.profile-toggle-btn:focus-visible {
  outline: 3px solid rgba(0, 91, 255, 0.18);
  outline-offset: 3px;
}

.profile-toggle-btn__icon {
  position: relative;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-toggle-btn__icon::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.profile-toggle-btn__icon::after {
  content: '';
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 12px;
  height: 6px;
  border-radius: 8px 8px 5px 5px;
  background: currentColor;
}

.profile-toggle-btn.is-saved {
  border-color: rgba(22, 121, 79, 0.24);
  background: rgba(22, 121, 79, 0.07);
  color: #16794f;
}
.cart-toggle-btn {
  position: relative;
  display: inline-flex;
  height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 17px 0 15px;
  border: 1px solid rgba(0, 70, 201, 0.14);
  border-radius: 16px;
  background: linear-gradient(135deg, #1474ff 0%, #005bff 58%, #0046c9 100%);
  box-shadow: 0 9px 20px rgba(0, 91, 255, 0.2);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cart-toggle-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 12px 24px rgba(0, 91, 255, 0.27);
}

.cart-toggle-btn:active {
  transform: translateY(0);
}

.cart-toggle-btn:focus-visible {
  outline: 3px solid rgba(0, 91, 255, 0.22);
  outline-offset: 3px;
}

.cart-toggle-btn__icon {
  position: relative;
  width: 20px;
  height: 18px;
  border: 2px solid #fff;
  border-top: 0;
  border-radius: 0 0 5px 5px;
}

.cart-toggle-btn__icon::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 2px;
  width: 12px;
  height: 8px;
  border: 2px solid #fff;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.cart-toggle-btn__badge {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  line-height: 1;
}


/* ==================== LAYOUT SHELL ==================== */

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.layout {
  display: block;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* ==================== AD BANNER (РЕКЛАМА) ==================== */

.ad-banner {
  position: relative;
  overflow: hidden;
  height: 220px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.ad-banner__track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
}

.ad-banner__slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 38%);
  grid-template-rows: minmax(0, 1fr);
  gap: 24px;
  padding: 0 0 0 48px;
  overflow: hidden;
  background-color: #203e34;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  width: 100%;
  border: 0;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ad-banner__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

/* Фото товара живёт в своей рамке: object-fit: cover даёт одинаково
   аккуратный кадр и для вертикальных, и для горизонтальных снимков. */
.ad-banner__media {
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: 18px 18px 18px 0;
}

.ad-banner__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.ad-banner__slide:hover .ad-banner__open { transform: translateX(4px); }
.ad-banner__slide:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

.ad-banner__slide::after {
  content: '';
  position: absolute;
  inset: auto -10% -60% auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.ad-banner__eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 14px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ad-banner__slide h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 34px);
  max-width: 560px;
}

.ad-banner__slide p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 480px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
}

.ad-banner__product-meta {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-size: 17px;
  color: #fff;
}

.ad-banner__open { position: relative; z-index: 1; display: inline-flex; align-self: flex-start; margin-top: 14px; color: #fff; font-size: 12px; font-weight: 800; transition: transform .2s ease; }

.ad-banner__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.ad-banner__dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  transition: 0.2s ease;
  padding: 0;
}

.ad-banner__dot.is-active {
  width: 22px;
  background: #fff;
}

/* ==================== CATEGORY BAR ==================== */

.category-bar {
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.chips {
  display: flex;
  gap: 10px;
  padding-bottom: 2px;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: 0.15s ease;
}

.chip.is-active,
.chip:hover {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
}

/* ==================== CATALOG ==================== */

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

.section-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  transition: 0.2s ease;
}

.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.product-card__image {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: #f5f6f8;
  overflow: hidden;
}

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

.product-card__body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.product-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 700;
}

.product-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card p {
  display: none;
}

.product-card__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-price {
  font-size: 19px;
  font-weight: 800;
}

.product-card__cart-control {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.add-to-cart-btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  transition: 0.15s ease;
}

.add-to-cart-btn:hover {
  background: var(--primary);
  color: #fff;
}

.catalog-qty-controls {
  min-width: 116px;
  justify-content: space-between;
}

.catalog-qty-controls .qty-btn {
  width: 34px;
  height: 34px;
}

/* ==================== CUSTOMER PROFILE ==================== */

.profile-panel {
  position: relative;
  width: min(700px, 100%);
  max-height: 90vh;
  padding: 28px;
  overflow: auto;
}

.profile-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-right: 42px;
}

.profile-panel__head h2 {
  margin: 8px 0 0;
  font-size: 26px;
  letter-spacing: -0.025em;
}

.profile-panel__eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#closeProfileBtn {
  position: absolute;
  top: 18px;
  right: 18px;
}

.profile-panel__intro {
  margin: 18px 0 12px;
  color: #4b5563;
  line-height: 1.55;
}

.profile-privacy-note {
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 121, 79, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(22, 121, 79, 0.06);
  color: #236146;
  font-size: 13px;
  line-height: 1.45;
}

.profile-form,
.profile-form label {
  display: grid;
  gap: 10px;
}

.profile-form {
  gap: 16px;
}

.profile-form label > span,
.checkout-form label > span {
  font-size: 14px;
  font-weight: 700;
}

.profile-form__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.profile-form__actions .primary-btn {
  flex: 1;
}

.secondary-btn {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  background: #fff;
  color: #6b7280;
  font-weight: 700;
  transition: 0.15s ease;
}

.secondary-btn:hover {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.05);
  color: #b91c1c;
}
.profile-details {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f8faff;
}

.profile-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-section-heading h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.015em;
}

.profile-section-heading p {
  margin: 5px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

.profile-details .profile-privacy-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: #fff;
}

.profile-orders {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.profile-section-heading--orders {
  align-items: center;
  margin-bottom: 14px;
}

.orders-refresh-btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 12px;
  background: #fff;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 750;
}

.orders-refresh-btn:hover { border-color: rgba(0, 91, 255, 0.35); background: var(--primary-soft); }
.orders-refresh-btn:disabled { opacity: 0.55; cursor: wait; }

.orders-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border-radius: 14px;
  background: #eef1f6;
}

.orders-tab {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #667085;
  font-weight: 750;
}

.orders-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 22px;
  margin-left: 5px;
  border-radius: 999px;
  background: rgba(103, 112, 133, 0.12);
  font-size: 11px;
}

.orders-tab[data-orders-tab="active"].is-active { color: #075acb; background: #eef5ff; box-shadow: 0 2px 8px rgba(7, 90, 203, 0.08); }
.orders-tab[data-orders-tab="active"].is-active span { color: #fff; background: #1971dc; }
.orders-tab[data-orders-tab="completed"].is-active { color: #16794f; background: #eef9f3; box-shadow: 0 2px 8px rgba(22, 121, 79, 0.08); }
.orders-tab[data-orders-tab="completed"].is-active span { color: #fff; background: #22875d; }
.orders-status { min-height: 18px; margin: 10px 0; color: #667085; font-size: 12px; }
.orders-status.is-error { color: #b42318; }
.orders-status.is-success { color: #16794f; }
.profile-orders-list { display: grid; gap: 12px; }

.orders-empty {
  display: grid;
  gap: 5px;
  padding: 28px 18px;
  border: 1px dashed #d7dde8;
  border-radius: 16px;
  color: #667085;
  text-align: center;
}

.orders-empty strong { color: var(--text); font-size: 14px; }
.orders-empty span { font-size: 12px; line-height: 1.45; }

.customer-order-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}
.customer-order-card.is-active { border-color: #c9dcf8; box-shadow: inset 4px 0 0 #3b82d4; }
.customer-order-card.is-completed { border-color: #c9e5d5; box-shadow: inset 4px 0 0 #3b9b6d; }
.customer-order-card.is-cancelled { border-color: #f0d0cc; box-shadow: inset 4px 0 0 #d46a61; }

.customer-order-card__head,
.customer-order-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.customer-order-card__head { border-bottom: 1px solid #edf0f4; }
.customer-order-card.is-active .customer-order-card__head { background: #f7faff; }
.customer-order-card.is-completed .customer-order-card__head { background: #f6fbf8; }
.customer-order-card.is-cancelled .customer-order-card__head { background: #fff8f7; }
.customer-order-card__head strong { display: block; font-size: 14px; }
.customer-order-card__head time { display: block; margin-top: 4px; color: #7b8494; font-size: 11px; }
.order-status-badge { padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.order-status-badge.is-active { color: #075acb; background: #e9f2ff; }
.order-status-badge.is-completed { color: #16794f; background: #eaf8f0; }
.order-status-badge.is-cancelled { color: #b42318; background: #fff0ee; }
.customer-order-card__items { display: grid; gap: 9px; padding: 14px 16px; }
.customer-order-card__items > div { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.customer-order-card__items span { min-width: 0; }
.customer-order-card__items small { color: #7b8494; }
.customer-order-card__items strong { flex: 0 0 auto; }
.customer-order-card__meta { display: grid; gap: 3px; margin: 0 16px; padding: 11px 0; border-top: 1px solid #edf0f4; font-size: 12px; }
.customer-order-card__meta span { color: #7b8494; }
.customer-order-card__footer { border-top: 1px solid #edf0f4; background: #fafbfc; }
.customer-order-card__footer > div { display: grid; gap: 2px; }
.customer-order-card__footer span { color: #7b8494; font-size: 11px; }
.customer-order-card__footer strong { font-size: 17px; }
.cancel-order-btn { min-height: 38px; border: 1px solid rgba(180, 35, 24, 0.22); border-radius: 11px; padding: 8px 12px; color: #b42318; background: #fff; font-size: 12px; font-weight: 750; }
.cancel-order-btn:hover { background: #fff0ee; }
.cancel-order-btn:disabled { opacity: 0.55; cursor: wait; }
/* ==================== CART MODAL ==================== */

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 19, 26, 0.56);
  backdrop-filter: blur(4px);
}

.cart-overlay.is-open {
  display: flex;
}

.cart-panel {
  position: relative;
  width: min(1080px, 100%);
  max-height: 92vh;
  padding: 22px;
  overflow: hidden;
}

.cart-panel__head,
.cart-panel__title,
.cart-item,
.cart-item__controls,
.checkout-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-panel__head {
  min-height: 52px;
  margin-bottom: 16px;
  padding-right: 52px;
}

.cart-panel__title {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.cart-panel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
}

.cart-count-pill {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 14px;
}

.cart-panel__total {
  color: var(--primary-strong);
  font-size: 22px;
}

#closeCartBtn.icon-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(16, 19, 26, 0.06);
  font-size: 24px;
  transition: 0.15s ease;
}

.icon-btn:hover {
  background: rgba(16, 19, 26, 0.12);
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 18px;
  min-height: 0;
}

.cart-products,
.checkout-block {
  border: 1px solid var(--line);
  border-radius: 22px;
}

.cart-products {
  min-height: 360px;
  padding: 14px;
  background: #f7f9fc;
}

.cart-list {
  display: grid;
  gap: 10px;
  max-height: calc(92vh - 126px);
  overflow: auto;
  overscroll-behavior: contain;
}

.cart-list.empty-state {
  min-height: 330px;
  place-items: center;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

.cart-item {
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.cart-item__left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.cart-item__thumb {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #eef0f3;
}

.cart-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item__details {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.cart-item__details strong:first-child {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
}

.cart-item__details span {
  color: var(--muted);
  font-size: 12px;
}

.cart-item__line-total {
  color: var(--primary-strong);
  font-size: 15px;
}

.cart-item__controls {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: var(--primary-soft);
}

.qty-controls strong {
  min-width: 22px;
  text-align: center;
}

.qty-btn,
.remove-btn {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  transition: 0.15s ease;
}

.qty-btn {
  width: 36px;
  height: 36px;
  background: #fff;
  color: var(--text);
  font-size: 18px;
}

.remove-btn {
  width: 38px;
  height: 38px;
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  font-size: 20px;
}

.qty-btn:hover,
.remove-btn:hover {
  transform: translateY(-1px);
}

/* ==================== CHECKOUT FORM ==================== */

.checkout-block {
  max-height: calc(92vh - 126px);
  padding: 18px;
  overflow: auto;
  background: #fff;
}

.checkout-form,
.checkout-block__top,
.form-grid label,
.checkout-form > label,
.checkout-more label {
  display: grid;
  gap: 8px;
}

.checkout-block__top h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.checkout-form {
  gap: 12px;
}

.profile-prefill-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: #3f4b5f;
  font-size: 13px;
  font-weight: 700;
}

.profile-prefill-note button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(28, 111, 78, 0.18);
  border-radius: 9px;
  background: #fff;
  color: var(--primary-strong);
  font-weight: 800;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fafbfc;
  color: var(--text);
  outline: none;
  transition: 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.choice-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-fieldset legend {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.choice-grid {
  display: grid;
  gap: 8px;
}

.choice-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-btn {
  position: relative;
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafbfc;
  color: #4b5563;
  cursor: pointer;
  transition: 0.15s ease;
}

.choice-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-btn span {
  font-size: 18px;
  line-height: 1;
}

.choice-btn strong {
  font-size: 13px;
}

.choice-btn:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.choice-btn:has(input:focus-visible) {
  outline: 3px solid rgba(28, 111, 78, 0.2);
  outline-offset: 2px;
}

.checkout-more {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.checkout-more summary {
  padding: 11px 13px;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.checkout-more summary::-webkit-details-marker {
  display: none;
}

.checkout-more[open] summary {
  padding-bottom: 6px;
}

.checkout-more label {
  padding: 0 10px 10px;
}

.checkout-total {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--line);
}

.checkout-total span {
  color: var(--muted);
  font-weight: 600;
}

.checkout-total strong {
  color: var(--primary-strong);
  font-size: 24px;
}

.primary-btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  transition: 0.15s ease;
}

.primary-btn:hover {
  background: var(--primary-strong);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.checkout-submit {
  min-height: 52px;
  font-size: 16px;
}

.order-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.order-status.is-success {
  color: #16794f;
}

.order-status.is-error {
  color: #dc2626;
}

@media (max-width: 820px) {
  .cart-panel {
    overflow: auto;
  }

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

  .cart-list,
  .checkout-block {
    max-height: none;
  }

  .cart-list.empty-state {
    min-height: 160px;
  }

  .cart-products {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .cart-overlay {
    align-items: stretch;
    padding: 0;
  }

  .cart-panel {
    max-height: 100vh;
    border-radius: 0;
    padding: 16px;
  }

  .cart-panel__head {
    padding-right: 46px;
  }

  .cart-panel__total {
    font-size: 18px;
  }

  .cart-products,
  .checkout-block {
    border-radius: 16px;
  }

  .cart-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .cart-item__controls {
    width: 100%;
    justify-content: space-between;
    padding-left: 80px;
  }

  .choice-grid--three {
    grid-template-columns: 1fr;
  }
}
/* ==================== RESPONSIVE ==================== */

@media (max-width: 820px) {
  .site-header__inner {
    width: min(100% - 24px, 1280px);
    min-height: auto;
    grid-template-columns: auto 1fr;
    gap: 10px 16px;
    padding: 10px 0 12px;
  }

  .cart-toggle-btn__label,
  .profile-toggle-btn__label {
    display: none;
  }

  .header-search {
    grid-column: 1 / -1;
    order: 3;
  }

  .ad-banner {
    height: 180px;
  }

  .ad-banner__slide {
    grid-template-columns: minmax(0, 1fr) minmax(0, 34%);
    gap: 14px;
    padding: 0 0 0 24px;
  }

  .ad-banner__media {
    padding: 14px 14px 14px 0;
  }

  .ad-banner__media img {
    border-radius: 13px;
  }

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

@media (max-width: 560px) {
  .brand {
    gap: 9px;
  }

  .brand__mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 13px;
    font-size: 13px;
  }

  .brand__text {
    font-size: 14px;
  }

  .header-search input {
    height: 46px;
    border-radius: 14px;
  }

  .profile-toggle-btn {
    width: 46px;
    height: 46px;
    justify-content: center;
    padding: 0;
    border-radius: 14px;
  }

  .profile-details { padding: 16px; border-radius: 16px; }
  .profile-section-heading--orders { align-items: flex-start; }
  .customer-order-card__head, .customer-order-card__footer { padding: 13px; }
  .customer-order-card__items { padding: 13px; }
  .customer-order-card__meta { margin-inline: 13px; }
  .profile-panel {
    padding: 22px 18px;
  }

  .profile-panel__head h2 {
    font-size: 22px;
  }

  .profile-form__actions,
  .profile-prefill-note {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-prefill-note button {
    text-align: left;
  }
  .cart-toggle-btn {
    width: 46px;
    height: 46px;
    justify-content: center;
    padding: 0;
    border-radius: 14px;
  }

  .cart-toggle-btn__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    background: var(--accent);
    border: 2px solid #fff;
  }
  .products-grid {
    grid-template-columns: 1fr 1fr;
  }

  .product-card h3 {
    font-size: 13px;
  }

  .product-price {
    font-size: 16px;
  }

  .product-card__price-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .add-to-cart-btn {
    width: 100%;
    text-align: center;
  }

  .product-card__cart-control,
  .catalog-qty-controls {
    width: 100%;
  }

  .checkout-total strong {
    font-size: 22px;
  }
}

@media (max-width: 400px) {
  .cart-overlay {
    padding: 10px;
  }

  .cart-panel {
    padding: 16px;
    max-height: 94vh;
  }

  .cart-panel__head {
    padding-right: 44px;
  }

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

  .products-grid {
    gap: 10px;
  }
}
