/* Perry storefront — layout by Figma / Privacy mockups */

:root {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --ink: #0e2042;
  --muted: #555555;
  --line: #d5d5d5;
  --header: #4a7bd9;
  --header-2: #1f50aa;
  --footer-top: #4a7bd9;
  --accent: #b8ea48;
  --accent-hover: #cdfa6a;
  --price: #b12704;
  --link: #4a7bd9;
  --legal-active: #e8eef6;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  --max: 1560px;
  --font: "Mulish", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; }

/* ----- Header ----- */
.site-header {
  background: var(--header);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  text-decoration: none !important;
}

.header-menu img,
.header-icon img,
.search-form button img {
  display: block;
  filter: brightness(0) invert(1);
}

.logo {
  color: #fff !important;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  white-space: nowrap;
  text-transform: uppercase;
}

.logo-sm { font-size: 1.1rem; }

.search-form {
  display: flex;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  max-width: 950px;
  width: 100%;
  margin: 0 auto;
}

.search-form input {
  flex: 1;
  border: 0;
  padding: 10px 16px;
  min-width: 0;
  color: var(--ink);
}

.search-form input::placeholder { color: #888; }

.search-form button {
  border: 0;
  background: var(--accent);
  width: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-form button img { filter: none; }
.search-form button:hover { background: var(--accent-hover); }

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

.header-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  text-decoration: none !important;
}

.header-link {
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.92rem;
}

.header-link:hover { color: var(--accent) !important; }

.cart-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ----- Layout blocks ----- */
.page-wrap,
.section,
.hero,
.cta-banner {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.section { padding: 28px 20px 8px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.section-head h2,
.section h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.section-head a {
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
}

.section-head a:hover { text-decoration: underline; }

/* ----- Hero ----- */
.hero {
  margin-top: 16px;
  padding: 48px 28px;
  background:
    linear-gradient(120deg, rgba(19, 25, 33, 0.88), rgba(35, 47, 62, 0.72)),
    url("https://picsum.photos/seed/perry-hero/1600/500") center/cover;
  color: #fff;
  border-radius: var(--radius);
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  opacity: 0.85;
  margin: 0 0 8px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  max-width: 14ch;
  line-height: 1.1;
}

.hero__text {
  max-width: 42ch;
  opacity: 0.92;
  margin: 0 0 20px;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  padding: 9px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  font-weight: 600;
}

.btn-primary {
  background: var(--accent);
  color: #111 !important;
  border-color: #fcd200;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink) !important;
}

.btn-link {
  background: transparent;
  color: var(--link) !important;
  border: 0;
  padding-left: 0;
}

/* ----- Categories ----- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.category-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  color: inherit !important;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
}

.category-card__img {
  flex: 1;
  background: #e8e8e8;
  border-radius: 4px;
  min-height: 90px;
  overflow: hidden;
}

.category-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 90px;
}

.category-card__title {
  font-weight: 700;
  font-size: 0.95rem;
}

.category-card__link {
  color: var(--link);
  font-size: 0.85rem;
}

/* ----- Product cards ----- */
.product-row,
.product-grid {
  display: grid;
  gap: 14px;
}

.product-row {
  grid-template-columns: repeat(4, 1fr);
  overflow-x: auto;
}

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

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: inherit !important;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  text-decoration: none !important;
}

.product-card.is-oos { opacity: 0.72; }

.product-card__media {
  position: relative;
  aspect-ratio: 1;
  background: #ececec;
}

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

.img-placeholder {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, transparent 46%, #bbb 46%, #bbb 54%, transparent 54%),
    linear-gradient(45deg, transparent 46%, #bbb 46%, #bbb 54%, transparent 54%),
    #ddd;
}

.img-placeholder.large { min-height: 360px; }

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
}

.badge-discount {
  background: var(--accent);
  color: var(--ink);
}

.badge-best {
  display: none; /* на главной по макету бейдж best seller не нужен */
}

.badge-oos {
  left: 10px;
  right: auto;
  background: #565959;
  color: #fff;
}

.product-card__body { padding: 12px; }

.product-card__title {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  color: var(--ink);
}

.product-card__rating {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.rating-icon { display: block; flex-shrink: 0; }

.product-card__price {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.product-card__price strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.product-card__price s {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ----- CTA (legacy class kept) ----- */
.cta-banner {
  margin: 28px auto;
  padding: 28px;
  background: #e7e9ec;
  border-radius: var(--radius);
}

.cta-banner h2 { margin: 0 0 6px; }
.cta-banner p { margin: 0 0 14px; color: var(--muted); }
.cta-actions { display: flex; gap: 10px; }

/* ----- Catalog ----- */
.page-wrap { padding: 16px 20px 40px; }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}

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

.catalog-head h1 { margin: 0; font-size: 1.8rem; }

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-toolbar input,
.catalog-toolbar select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
}

.pagination a {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.pagination a.active {
  background: var(--header-2);
  color: #fff;
  border-color: var(--header-2);
}

.empty-state {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  color: var(--muted);
}

/* ----- Product detail page ----- */
.pdp-page { padding-bottom: 12px; }

.breadcrumbs--pdp {
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 0.88rem;
}

.breadcrumbs--pdp a { color: var(--ink); text-decoration: none; }
.breadcrumbs--pdp a:hover { text-decoration: underline; }
.breadcrumbs__home { display: inline-flex; }
.breadcrumbs__sep { opacity: 0.55; }

.pdp {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(280px, 1.25fr) minmax(220px, 0.75fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 28px;
}

.pdp-gallery__main {
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: 0 2px 12px rgba(14, 32, 66, 0.08);
}

.pdp-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-gallery__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
}

.pdp-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.pdp-gallery__nav--prev { left: 10px; }
.pdp-gallery__nav--next { right: 10px; }

.pdp-gallery__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pdp-gallery__thumbs::-webkit-scrollbar { display: none; }

.thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.thumb.active,
.thumb:hover { border-color: var(--header); }

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

.pdp-info h1 {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.3;
  color: var(--ink);
}

.pdp-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.92rem;
}

.pdp-meta__rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pdp-meta__code { color: var(--muted); }

.stars-row { letter-spacing: 1px; }
.stars-row .on { color: #1f50aa; }
.stars-row .off { color: #b7c4de; }

.about-list__title {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.about-item {
  background: #fff;
  border: 1px solid #cfd9ef;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.about-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.about-item summary::-webkit-details-marker { display: none; }
.about-item summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.85rem;
}
.about-item[open] summary::after { content: "▴"; }

.about-item p {
  margin: 10px 0 0;
  color: #44516b;
  font-size: 0.92rem;
  line-height: 1.45;
}

.pdp-buy {
  background: #fff;
  border: 1px solid #cfd9ef;
  border-radius: 12px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 76px;
  box-shadow: 0 4px 18px rgba(14, 32, 66, 0.1);
}

.pdp-buy__price {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid #e4ebf7;
}

.pdp-price {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.pdp-price sup {
  font-size: 0.55em;
  top: -0.55em;
}

.pdp-buy__price s { color: var(--muted); font-size: 0.95rem; }

.buy-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--muted);
}

.status-ok { color: #2f9e44; font-weight: 600; }
.status-oos { color: #b12704; font-weight: 600; }

.buy-link {
  display: flex;
  justify-content: space-between;
  color: var(--ink);
  text-decoration: none !important;
  font-size: 0.92rem;
  padding: 2px 0;
}

.buy-link:hover { color: var(--header-2); }

.qty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 8px;
  font-size: 0.92rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qty-control button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
}

.qty-control input {
  width: 36px;
  border: 0;
  text-align: center;
  font-weight: 600;
  background: transparent;
}

.pdp-buy__btn { width: 100%; justify-content: center; border-radius: 999px; }

.btn-buy-now {
  background: var(--accent);
  color: var(--ink) !important;
  border: 0;
  font-weight: 700;
}

.btn-buy-now:hover { background: var(--accent-hover); }

.btn-add-cart {
  background: #fff;
  color: var(--header-2) !important;
  border: 1.5px solid var(--header);
  font-weight: 600;
}

.pdp-wishlist {
  text-align: center;
  color: var(--header-2);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 4px;
  text-decoration: none !important;
}

.pdp-section {
  margin: 28px 0 8px;
  padding-top: 8px;
  border-top: 1px solid #d5dff0;
}

.pdp-section > h2 {
  margin: 0 0 16px;
  font-size: 1.45rem;
}

.pdp-details__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 28px;
}

.pdp-details__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdp-details__item strong { color: var(--ink); }
.pdp-details__item span { color: #44516b; font-size: 0.95rem; }

.pdp-reviews__layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.6fr);
  gap: 28px;
  align-items: start;
}

.reviews-score-card {
  background: #fff;
  border: 1px solid #cfd9ef;
  border-radius: 12px;
  padding: 16px;
}

.reviews-score-card__top {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.reviews-score-card__top strong { font-size: 1.8rem; }
.reviews-score-card__count { color: var(--muted); font-size: 0.9rem; }

.rating-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.rating-bars li {
  display: grid;
  grid-template-columns: 14px 1fr 36px;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
}

.rating-bars__track {
  height: 8px;
  border-radius: 999px;
  background: #e8eef8;
  overflow: hidden;
}

.rating-bars__fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.reviews-confirmed {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: #44516b;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.frequent-tags { margin-top: 18px; }
.frequent-tags h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.frequent-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
}

.tag--soft {
  background: #e8eef8;
  border-color: transparent;
  color: var(--ink);
}

.reviews-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reviews-filters { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--header);
  color: var(--header-2);
  text-decoration: none !important;
  font-size: 0.88rem;
  background: #fff;
}

.chip.is-active {
  background: var(--header);
  color: #fff;
}

.reviews-sort select {
  border: 1px solid #cfd9ef;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
}

.btn-create-review {
  width: 100%;
  justify-content: center;
  border: 1.5px solid var(--header);
  background: #fff;
  color: var(--header-2) !important;
  border-radius: 999px;
  margin-bottom: 16px;
  font-weight: 600;
}

.review-list { display: grid; gap: 0; }

.review-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #d5dff0;
  border-radius: 0;
  padding: 18px 0;
  box-shadow: none;
}

.review-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.review-card__author {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.review-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d7e2f5;
  color: var(--header-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: uppercase;
}

.review-card h3 {
  margin: 8px 0 6px;
  font-size: 1rem;
}

.review-card p {
  margin: 0;
  color: #333;
  line-height: 1.45;
}

.review-card__photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.review-card__photos img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.review-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.review-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.review-card__btns { display: flex; gap: 8px; }

.btn-helpful {
  background: var(--accent);
  border: 0;
  color: var(--ink) !important;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
}

.btn-translate {
  background: #fff;
  border: 1.5px solid var(--header);
  color: var(--header-2) !important;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
}

.review-card__helpful-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.reviews-more {
  display: flex;
  justify-content: center;
  margin: 18px 0 8px;
}

.btn-see-more {
  background: #fff;
  border: 1.5px solid var(--header);
  color: var(--header-2) !important;
  border-radius: 999px;
  padding: 8px 28px;
  font-weight: 600;
}

.pdp-page .product-track .product-card {
  flex: 0 0 calc((100% - 70px) / 6);
  min-width: 150px;
}

/* ----- Cart / Auth / Orders ----- */
.cart-link { position: relative; }

.cart-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  margin-left: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-user {
  opacity: 0.85;
  pointer-events: none;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

.cart-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #e7e7e7;
}

.cart-row__img img,
.cart-row__img .img-placeholder {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: #f7f7f7;
}

.cart-row__info a {
  font-weight: 600;
  color: #0f1111;
}

.qty-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}

.cart-summary {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 16px;
  background: #fafafa;
  position: sticky;
  top: 16px;
}

.cart-empty,
.auth-box {
  max-width: 420px;
}

.auth-box form { margin: 16px 0; }

.guest-hint { font-size: 0.9rem; color: #555; margin-top: 12px; }

.order-item-cell {
  display: flex;
  gap: 12px;
  align-items: center;
}

.order-item-cell img {
  object-fit: contain;
  background: #f7f7f7;
}

.cart-total { font-size: 1.15rem; margin: 16px 0; }

.review-form {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid #e7e7e7;
  border-radius: 4px;
  background: #fafafa;
}

.qty-label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.alert {
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.alert-ok { background: #e7f6e7; color: #0a5; }
.alert-error { background: #fdecea; color: #a33; }

.inline-status select { max-width: 140px; }

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

.edit-preview { margin: 8px 0; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 72px 1fr; }
  .cart-row__sum { grid-column: 2; }
}

.catalog-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
  padding: 0 0 24px;
}

.catalog.page-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.catalog__title {
  margin: 8px 0 20px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
}

.catalog-filters {
  background: transparent;
  border: 0;
  padding: 0;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.catalog-filters h2 { display: none; }

.filter-acc {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(14, 32, 66, 0.06);
  margin-bottom: 12px;
  padding: 4px 0;
}

.filter-acc > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
}

.filter-acc > summary::-webkit-details-marker { display: none; }
.filter-acc > summary::after { content: "▾"; color: var(--link); font-size: 0.9rem; }
.filter-acc[open] > summary::after { content: "▴"; }

.filter-acc__body { padding: 0 18px 16px; }

.filter-search {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.filter-check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.92rem;
  cursor: pointer;
}

.filter-check input { width: 16px; height: 16px; accent-color: var(--link); }

.filter-color .swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #ddd;
  flex-shrink: 0;
}

.filter-color .swatch[data-color="white"] { background: #fff; }
.filter-color .swatch[data-color="black"] { background: #111; }
.filter-color .swatch[data-color="red"] { background: #e53935; }
.filter-color .swatch[data-color="blue"] { background: #1e88e5; }
.filter-color .swatch[data-color="green"] { background: #43a047; }
.filter-color .swatch[data-color="pink"] { background: #ec407a; }
.filter-color .swatch[data-color="grey"],
.filter-color .swatch[data-color="gray"] { background: #9e9e9e; }
.filter-color .swatch[data-color="beige"] { background: #d7c4a3; }
.filter-color .swatch[data-color="navy"] { background: #1a237e; }
.filter-color .swatch[data-color="cream"] { background: #fff3e0; }

.size-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.size-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  background: #fff;
}

.size-chip input { position: absolute; opacity: 0; }
.size-chip:has(input:checked) {
  border-color: var(--link);
  background: #e8eef6;
  font-weight: 600;
}
.size-chip.is-muted { opacity: 0.4; cursor: not-allowed; }

.price-filter .price-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.price-filter input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.btn-sm { padding: 8px 14px; font-size: 0.85rem; border-radius: 8px; }

.stars-row .on { color: #f5a623; }
.stars-row .off { color: #d0d0d0; }

.filters-clear {
  width: 100%;
  margin-top: 8px;
  text-align: center;
}

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

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.filters-applied {
  border: 0;
  background: #e8eef6;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
}

.catalog-toolbar__right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.catalog-toolbar__right select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  min-width: 220px;
}

.view-toggle {
  display: inline-flex;
  gap: 4px;
  background: #eef2f8;
  padding: 4px;
  border-radius: 8px;
}

.view-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
}

.view-btn.is-active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

.catalog-count { margin: 0 0 14px; }

.catalog-products.is-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.catalog-products.is-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.catalog-products.is-list .product-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: stretch;
}

.catalog-products.is-list .product-card__media {
  aspect-ratio: auto;
  min-height: 140px;
}

.product-card__media .product-card__oos-actions {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  z-index: 2;
}

.product-card__oos-actions .notify-btn {
  width: 100%;
  background: #fff;
  border-color: var(--line);
  font-size: 0.78rem;
  padding: 8px 10px;
}

.product-card.is-oos .product-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
}

.badge-oos {
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(17, 17, 17, 0.8);
  color: #fff;
  z-index: 2;
  white-space: nowrap;
}

.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}

.pagination a {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.pagination a.active {
  border-color: var(--link);
  color: var(--link);
  font-weight: 700;
}

.page-ellipsis { padding: 8px 4px; color: var(--muted); }

@media (max-width: 1200px) {
  .catalog-products.is-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-filters { position: static; max-height: none; }
  .catalog-products.is-grid { grid-template-columns: repeat(2, 1fr); }
}

.order-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 16px 0;
}

.profile-card {
  max-width: 480px;
  margin-bottom: 24px;
}

.viewed-section .section-head .muted {
  font-size: 0.9rem;
}

/* ----- Footer ----- */
.site-footer {
  margin-top: 12px;
  background: var(--footer-top);
  color: #fff;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 24px 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.footer-col h4 {
  color: #fff;
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

.footer-col a {
  display: block;
  color: #eef3ff;
  margin-bottom: 4px;
  font-size: 0.82rem;
  line-height: 1.35;
  text-decoration: none;
}

.footer-col a:hover { text-decoration: underline; color: #fff; }

.social-row { display: flex; gap: 6px; }

.social-row span {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 6px;
}

.footer-bottom {
  background: var(--header-2);
  border-top: 0;
  max-width: none;
  margin: 0;
  padding: 8px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #fff;
}

.footer-bottom .logo-sm {
  font-size: 0.95rem;
}

/* ----- Legal pages: fixed header/footer, scrolling text ----- */
html:has(body.legal-shell),
body.legal-shell {
  height: 100%;
  overflow: hidden;
}

body.legal-shell {
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

body.legal-shell .site-header {
  flex-shrink: 0;
  position: relative;
  z-index: 30;
}

body.legal-shell main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
}

body.legal-shell .site-footer {
  flex-shrink: 0;
  margin-top: 0;
  position: relative;
  z-index: 30;
}

.legal-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 56px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
  background: var(--surface);
}

.legal-nav {
  position: sticky;
  top: 0;
  align-self: start;
  padding-top: 4px;
  padding-bottom: 24px;
  background: var(--surface);
  z-index: 1;
}

.legal-nav__title {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.legal-nav__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-nav__link {
  display: block;
  padding: 16px 24px;
  border-radius: 4px;
  color: var(--ink) !important;
  text-decoration: none !important;
  font-size: 1.05rem;
  line-height: 1.4;
}

.legal-nav__link:hover { background: #f5f7fb; }
.legal-nav__link.is-active {
  background: var(--legal-active);
  font-weight: 500;
}

.legal-content__title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.legal-content__updated {
  margin: 8px 0 0;
  font-size: 1.15rem;
  font-weight: 500;
  color: #6b7280;
}

.legal-content__rule {
  border: 0;
  border-top: 1px solid #c9d6ef;
  margin: 16px 0 24px;
}

.legal-content__body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #222;
}

.legal-content__body p { margin: 0 0 8px; }

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.legal-em {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
}

a.legal-em:hover { text-decoration: underline; }

.legal-list {
  margin: 0;
  padding-left: 1.4rem;
}

.legal-list > li { margin-bottom: 8px; }
.legal-list ul {
  margin: 8px 0 0;
  padding-left: 1.4rem;
}

/* ----- Responsive ----- */
@media (max-width: 1100px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .product-row { grid-template-columns: repeat(3, 1fr); }
  .pdp { grid-template-columns: 1fr 1fr; }
  .pdp-buy { grid-column: 1 / -1; position: static; }
  .pdp-details__grid { grid-template-columns: 1fr 1fr; }
  .pdp-reviews__layout { grid-template-columns: 1fr; }
  .legal-page { grid-template-columns: 220px 1fr; gap: 24px; }
}

@media (max-width: 720px) {
  .header-inner { grid-template-columns: 1fr; }
  .category-grid,
  .product-row,
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .pdp { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .legal-page { grid-template-columns: 1fr; padding: 20px 16px 40px; }
  .legal-content__title { font-size: 1.75rem; }
  .carousel { grid-template-columns: 32px 1fr 32px; }
  .category-track .category-card,
  .product-track .product-card {
    flex-basis: calc((100% - 14px) / 2);
  }
  .home-cta__copy {
    left: 4%;
    right: 4%;
    max-width: none;
    padding-right: 0;
  }
  .home-cta__copy h2 { font-size: 1.35rem; }
  .home-cta__copy p { margin-bottom: 12px; font-size: 0.9rem; }
}

/* ----- Home page (Desktop - Main mockup) ----- */
body:not(.legal-shell) {
  background: #f3f4f8;
}

.home {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 24px 8px;
}

.home-hero {
  position: relative;
  margin-bottom: 28px;
}

.home-hero__track {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(14, 32, 66, 0.12);
  background: #1a3a6e;
}

.home-hero__slide {
  display: none;
  margin: 0;
}

.home-hero__slide.is-active {
  display: block;
}

.home-hero__slide img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
}

.home-section { margin: 8px 0 28px; }

.home-divider {
  border: 0;
  border-top: 1px solid #c9d6ef;
  margin: 8px 0 24px;
}

.carousel {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 8px;
  align-items: center;
}

.carousel__viewport { min-width: 0; overflow: hidden; }

.carousel__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 4px 2px 10px;
}

.carousel__track::-webkit-scrollbar { display: none; }

.category-track .category-card,
.product-track .product-card {
  flex: 0 0 calc((100% - 70px) / 6);
  min-width: 160px;
  scroll-snap-align: start;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: rgba(74, 123, 217, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.carousel-btn:hover { background: rgba(74, 123, 217, 0.22); }

.home-hero .carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255, 255, 255, 0.75);
}

.home-hero .carousel-btn--prev { left: 12px; }
.home-hero .carousel-btn--next { right: 12px; }

.home .category-card {
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(14, 32, 66, 0.08);
  min-height: 210px;
}

.home .category-card__img {
  background: #e8eef6;
  border-radius: 8px;
  min-height: 110px;
}

.home .category-card__title {
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.home .category-card__link {
  margin-top: auto;
  align-self: flex-end;
}

.home .product-card {
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(14, 32, 66, 0.08);
}

.btn {
  border-radius: 999px;
  padding: 10px 22px;
}

.btn-primary {
  background: var(--accent);
  color: var(--ink) !important;
  border-color: transparent;
}

.btn-cta-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #fff !important;
  border-radius: 999px;
  padding: 10px 22px;
  text-decoration: none !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.home-cta { margin: 12px 0 0; }

.home-cta__inner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 8px 24px rgba(14, 32, 66, 0.16);
}

.home-cta__bg {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.home-cta__copy {
  position: absolute;
  left: 5%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  max-width: min(420px, 46%);
  padding-right: 12px;
}

.home-cta__copy h2 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.8vw, 2.15rem);
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 1px 8px rgba(20, 50, 110, 0.35);
}

.home-cta__copy p {
  margin: 0 0 16px;
  opacity: 0.96;
  text-shadow: 0 1px 6px rgba(20, 50, 110, 0.3);
}

.home-cta__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 40;
}

.to-top:hover { background: var(--accent-hover); }

@media (max-width: 1100px) {
  .category-track .category-card,
  .product-track .product-card {
    flex-basis: calc((100% - 42px) / 4);
  }
}
