@import url("./palettes.css");
/* ============================================================
   MehrAra Beauty Store — Design System
   Luxury Persian beauty e-commerce, RTL-first
   ============================================================ */

/* ---------- Design tokens ---------- */
:root,
[data-theme="light"] {
  /* Brand palette */
  --cream: #F9E9E7;
  --ivory: #FEF5F4;
  --brown: #35251F;
  --rose-gold: #C99D83;
  --nude: #EBCDC8;
  --text-strong: #302723;

  /* Surfaces */
  --color-bg: #FBEFEE;
  --color-surface: #FEF5F4;
  --color-surface-2: #FCEEEC;
  --color-surface-offset: #F9E7E5;
  --color-surface-offset-2: #F2D9D6;
  --color-divider: oklch(0.5 0.045 20 / 0.14);
  --color-border: oklch(0.5 0.045 20 / 0.19);

  /* Text */
  --color-text: #302723;
  --color-text-muted: #7A6A5F;
  --color-text-faint: #B3A296;
  --color-text-inverse: #FEF5F4;

  /* Accents */
  --color-primary: #A9684B;          /* deep rose-gold, AA on cream */
  --color-primary-hover: #8E5238;
  --color-primary-active: #744229;
  --color-primary-highlight: #F6DDD9;
  --color-accent: #B0765C;
  --color-success: #4A7043;
  --color-success-highlight: #E4EDE0;
  --color-error: #A14040;
  --color-error-highlight: #F3DEDE;
  --color-gold: #9C7A3C;

  /* Shadows — warm-toned */
  --shadow-sm: 0 1px 2px oklch(0.3 0.03 50 / 0.07);
  --shadow-md: 0 4px 14px oklch(0.3 0.03 50 / 0.09);
  --shadow-lg: 0 14px 36px oklch(0.3 0.03 50 / 0.13);

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.375rem;
  --radius-full: 9999px;

  --transition-interactive: 190ms cubic-bezier(0.16, 1, 0.3, 1);

  --font-body: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Cormorant Garamond", "Vazirmatn", Georgia, serif;

  --content-narrow: 640px;
  --content-default: 1080px;
  --content-wide: 1240px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --header-height: 72px;

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
}

[data-theme="dark"] {
  --color-bg: #1B1410;
  --color-surface: #231A15;
  --color-surface-2: #291E18;
  --color-surface-offset: #201712;
  --color-surface-offset-2: #2C211A;
  --color-divider: oklch(0.85 0.03 60 / 0.12);
  --color-border: oklch(0.85 0.03 60 / 0.16);

  --color-text: #EFE5DA;
  --color-text-muted: #B7A697;
  --color-text-faint: #8A7A6C;
  --color-text-inverse: #231A15;

  --color-primary: #D9AF92;
  --color-primary-hover: #E4C0A5;
  --color-primary-active: #C79B7C;
  --color-primary-highlight: #3A2B22;
  --color-accent: #D9AF92;
  --color-success: #9DBE8F;
  --color-success-highlight: #2E3628;
  --color-error: #E0A0A0;
  --color-error-highlight: #442926;
  --color-gold: #D9B86A;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 14px 36px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { /* same values as [data-theme="dark"] */ }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

[hidden] {
  display: none !important;
}

.newsletter-form input {
  min-width: 0;
}

body {
  min-height: 100dvh;
  line-height: 1.7;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img,
picture,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

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

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.25;
}

p,
li,
figcaption {
  text-wrap: pretty;
  max-width: 75ch;
}

::selection {
  background: color-mix(in oklab, var(--color-primary) 28%, transparent);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

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

a,
button,
[role="button"],
input,
textarea,
select {
  transition:
    color var(--transition-interactive),
    background-color var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

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

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  top: -100px;
  z-index: 100;
  background: var(--color-surface);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  top: var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Layout utilities ---------- */
.container {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container-wide {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.section {
  padding-block: clamp(var(--space-10), 6vw, var(--space-16));
}

.section-tight {
  padding-block: clamp(var(--space-8), 4vw, var(--space-10));
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.section-title {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-title .en {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--color-primary);
  margin-inline-start: var(--space-4);
  padding-inline-start: var(--space-3);
  border-inline-start: 1px solid color-mix(in oklab, var(--color-primary) 35%, transparent);
}

.section-link {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--color-primary) 40%, transparent);
  padding-bottom: 2px;
}

.section-link:hover {
  color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.muted {
  color: var(--color-text-muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  background: var(--color-primary-active);
  transform: translateY(1px);
}

.btn-outline {
  border-color: var(--color-border);
  color: var(--color-text);
  background: var(--color-surface);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-ghost {
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  color: var(--color-text);
}

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

.btn-sm {
  min-height: 38px;
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-xs);
}

/* Icon buttons */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  position: relative;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.icon-btn .count {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-btn .count:empty,
.icon-btn .count[data-zero="1"] {
  display: none;
}

/* ---------- Notice bar ---------- */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.brand-mark {
  color: var(--color-primary);
}
.brand-mark img { border-radius: 50%; }

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name .fa {
  font-size: var(--text-lg);
  font-weight: 800;
}

.brand-name .en {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.main-nav {
  display: none;
  gap: var(--space-3);
  white-space: nowrap;
}

.main-nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0;
  font-stretch: normal;
  flex-shrink: 0;
  color: var(--color-text);
  text-decoration: none;
}

.main-nav a:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-inline-start: auto;
}
.header-search {
  display: none;
  position: relative;
  width: clamp(210px, 18vw, 260px);
  flex-shrink: 0;
  min-width: 0;
}

.header-search input {
  width: 100%;
  min-height: 44px;
  padding-block: var(--space-2);
  padding-inline-start: var(--space-3);
  padding-inline-end: 2.75rem;
  font-size: 0.875rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-sm);
}

.header-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 18%, transparent);
}

.header-search .icon-btn {
  position: absolute;
  inset-inline-end: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
}

.lang-toggle {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  width: auto;
  padding-inline: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-muted);
}

.menu-btn {
  display: inline-flex;
}

@media (min-width: 1280px) {
  .main-nav,
  .header-search {
    display: block;
  }
  /* Real flex row: the pill links never shrink or overlap the search box;
     the search box absorbs any extra width pressure instead. */
  .main-nav {
    display: flex;
    align-items: center;
  }
  .header-search {
    flex-shrink: 1;
    min-width: 132px;
  }
  .menu-btn {
    display: none;
  }
}

/* On mid-width desktops the header is too crowded for the promo links; they return on large screens. */
@media (min-width: 1280px) and (max-width: 1599px) {
  .main-nav a[href^="shop.html#cat="] {
    display: none;
  }
}

/* Compact header on small screens */
@media (max-width: 520px) {
  .header-inner {
    gap: var(--space-2);
  }
  .brand-name .en {
    display: none;
  }
  .lang-toggle {
    padding-inline: var(--space-2);
    font-size: 11px;
  }
  .header-actions .icon-btn {
    width: 40px;
    height: 40px;
  }
  .header-actions .icon-btn .count {
    min-width: 16px;
    height: 16px;
    font-size: 10px;
  }
}

/* Mobile nav drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}

.mobile-nav[data-open="1"] {
  display: block;
}

.mobile-nav .backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.2 0.02 50 / 0.45);
}

.mobile-nav .panel {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: min(320px, 88vw);
  background: var(--color-surface);
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
  /* Smooth, native-feeling touch scrolling inside the drawer only */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  animation: drawer-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawer-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

[dir="ltr"] .mobile-nav .panel {
  animation-name: drawer-in-ltr;
}

@keyframes drawer-in-ltr {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.mobile-nav a {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
}

.mobile-nav a:hover {
  background: var(--color-surface-offset);
}

.mobile-nav .nav-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 700;
  padding: var(--space-3) var(--space-3) var(--space-1);
}

/* ---------- Hero ---------- */
.hero {
  --hero-height: calc(100svh - var(--hero-chrome-height, 112px));
  --hero-panel-width: clamp(320px, 27vw, 400px);
  position: relative;
  isolation: isolate;
  min-height: var(--hero-height);
  overflow: hidden;
  background: var(--color-bg);
}

.hero-media {
  position: absolute;
  inset: 0;
  inset-inline-start: var(--hero-panel-width);
  z-index: -1;
  min-width: 0;
  overflow: hidden;
  background: #a77d63;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-playback {
  position: absolute;
  inset-inline-end: clamp(16px, 3vw, 40px);
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 45%);
  background: rgb(46 29 21 / 85%);
  color: #fff;
  cursor: pointer;
}

.hero-playback:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -5px;
}

.hero-grid {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--hero-height);
  width: var(--hero-panel-width);
  max-width: none;
  margin-inline: 0;
  padding: clamp(24px, 2.4vw, 32px);
  background: var(--color-surface);
}

.hero-copy {
  min-width: 0;
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  box-shadow: none;
}

.hero-copy .hero-title {
  font-size: clamp(1.8rem, 1.3rem + 1vw, 2.3rem);
  margin-bottom: var(--space-4);
}

.hero-copy .hero-sub {
  font-size: var(--text-base);
  line-height: 1.8;
  margin-bottom: var(--space-5);
}

.hero-copy .hero-stats {
  margin-top: var(--space-5);
  gap: var(--space-6);
  justify-content: space-between;
}

.hero-copy .hero-eyebrow {
  margin-bottom: var(--space-4);
  padding-inline: var(--space-3);
}

.hero-copy .hero-stats .stat b {
  font-size: var(--text-lg);
}

.hero-copy .hero-ctas {
  gap: var(--space-2);
}

.hero-copy .hero-ctas .btn {
  padding-inline: var(--space-4);
}

.hero-ctas .btn-primary {
  background: var(--color-primary-hover);
}

.hero-ctas .btn-primary:hover,
.hero-ctas .btn-primary:active {
  background: var(--color-primary-active);
}

@media (min-width: 900px) and (max-height: 760px) {
  .hero-grid {
    padding-block: 24px;
  }
  .hero-copy {
    padding: 0;
  }
  .hero-copy .hero-eyebrow,
  .hero-copy .hero-title {
    margin-bottom: var(--space-3);
  }
  .hero-copy .hero-sub {
    margin-bottom: var(--space-4);
  }
  .hero-copy .hero-stats {
    margin-top: var(--space-4);
  }
}

@media (max-width: 899px) {
  /* Phones/tablets: immersive square video on top, copy panel slides over it like a sheet. */
  .hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .hero-media {
    position: relative;
    inset: auto;
    z-index: 0;
    width: 100%;
    height: clamp(300px, min(100vw, 72svh), 640px);
    flex: none;
    background: #b98f76;
  }
  .hero-media::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 38%;
    pointer-events: none;
    background: linear-gradient(to top, rgb(40 24 17 / 38%), transparent);
  }
  .hero-grid {
    min-height: 0;
    width: 100%;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 28px 22px 26px;
    margin-top: -26px;
    z-index: 1;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -10px 30px rgb(40 24 17 / 14%);
  }
  .hero-copy {
    width: min(540px, 100%);
    padding: 0;
  }
  .hero-copy .hero-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
  }
  .hero-copy .hero-sub {
    margin-bottom: var(--space-4);
  }
  .hero-copy .hero-stats {
    margin-top: var(--space-4);
  }
  .hero-copy .hero-ctas .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: var(--space-2);
    text-align: center;
  }
  .hero-playback {
    top: 16px;
    bottom: auto;
    z-index: 2;
  }
}

@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) {
  .hero-media {
    height: clamp(220px, 80svh, 420px);
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-primary-hover);
  background: color-mix(in oklab, var(--color-primary) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--color-primary) 25%, transparent);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-5);
}

.hero-title {
  font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.6rem);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-5);
}

.hero-title em {
  font-style: normal;
  color: var(--color-primary);
}

.hero-sub {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 46ch;
  margin-bottom: var(--space-8);
}

.hero-ctas {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: clamp(var(--space-6), 4vw, var(--space-12));
  margin-top: var(--space-10);
}

.hero-stats .stat b {
  display: block;
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
}

.hero-stats .stat span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---------- Category cards ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr));
  gap: var(--space-4);
}

.category-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-divider);
}

.category-card .img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card:hover img {
  transform: scale(1.06);
}

.category-card .body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.category-card .name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}

.category-card .count {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.category-card .arrow {
  color: var(--color-primary);
  flex-shrink: 0;
}

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

/* ---------- Product card ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: var(--space-5);
}

.product-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}

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

.product-card .media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-surface-offset);
}

.product-card .media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7%;
  box-sizing: border-box;
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .media img {
  transform: scale(1.05);
}

.product-card .stretched {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.product-card .badges {
  position: absolute;
  top: var(--space-3);
  inset-inline-start: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.5;
}

.badge-off {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.badge-new {
  background: var(--color-success-highlight);
  color: var(--color-success);
  border: 1px solid color-mix(in oklab, var(--color-success) 35%, transparent);
}

.badge-out {
  background: var(--color-error-highlight);
  color: var(--color-error);
}

.product-card .wish-btn {
  position: absolute;
  top: var(--space-3);
  inset-inline-end: var(--space-3);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: color-mix(in oklab, var(--color-surface) 85%, transparent);
  backdrop-filter: blur(6px);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card .wish-btn:hover {
  color: var(--color-error);
}

.product-card .wish-btn .active {
  color: var(--color-error);
  fill: var(--color-error);
}

.product-card .body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.product-card .brand {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.03em;
}

.product-card .name {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.55;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--color-text);
  text-decoration: none;
}

.product-card .name:hover {
  color: var(--color-primary);
}

.product-card .stock {
  font-size: 11px;
  font-weight: 600;
}

.product-card .stock.in {
  color: var(--color-success);
}

.product-card .stock.low {
  color: var(--color-gold);
}

.product-card .stock.out {
  color: var(--color-text-faint);
}

.product-card .pricing {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: auto;
}

.price {
  font-size: var(--text-base);
  font-weight: 800;
  white-space: nowrap;
}

.price .cur {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
}

.price-old {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: line-through;
  white-space: nowrap;
}

.product-card .actions {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-4);
  z-index: 2;
}

.product-card .actions .btn {
  flex: 1;
}

.product-card .actions .icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

/* ---------- Editorial split section ---------- */
.editorial {
  display: grid;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 900px) {
  .editorial {
    grid-template-columns: 1fr 1fr;
  }
  .editorial.flip .media {
    order: 2;
  }
}

.editorial .media {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.editorial .media img {
  width: 100%;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
}

.editorial .kicker {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.editorial h2 {
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
}

.editorial p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

/* ---------- Promo banner ---------- */
.promo {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow-lg);
}

.promo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, oklch(0.2 0.03 50 / 0.72), oklch(0.2 0.03 50 / 0.15) 55%, transparent);
}

.promo .content {
  position: relative;
  z-index: 1;
  padding: var(--space-8);
  color: #FFF6EE;
  max-width: 560px;
}

.promo .content .kicker {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--nude);
  margin-bottom: var(--space-2);
}

.promo .content h2 {
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.promo .content p {
  font-size: var(--text-sm);
  color: oklch(0.96 0.02 70);
  margin-bottom: var(--space-5);
  max-width: 44ch;
}

/* ---------- Benefits ---------- */
.benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: var(--space-4);
}

.benefit {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.benefit svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.benefit b {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.benefit span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ---------- Shop page ---------- */
.shop-layout {
  display: grid;
  gap: var(--space-8);
  padding-block: var(--space-8);
}

.shop-layout > * {
  min-width: 0;
}

.product-detail > div {
  min-width: 0;
}

@media (min-width: 960px) {
  .shop-layout {
    grid-template-columns: 260px 1fr;
  }
}

.filters {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.filters h3 {
  font-size: var(--text-sm);
  font-weight: 700;
}

.filters .group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.filters .group .label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  padding: var(--space-1) 0;
  cursor: pointer;
  color: var(--color-text);
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.check .n {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  margin-inline-start: auto;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.price-inputs input {
  width: 100%;
  min-height: 40px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  font-size: var(--text-xs);
}

.price-inputs input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.filters .range-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.shop-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.shop-toolbar .search-inline {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.shop-toolbar .search-inline input {
  width: 100%;
  min-height: 44px;
  padding-inline: var(--space-10) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-sm);
}

.shop-toolbar .search-inline input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.shop-toolbar .search-inline .icon-btn {
  position: absolute;
  inset-inline-start: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
}

.shop-toolbar select {
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-sm);
  cursor: pointer;
}

.result-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  width: 100%;
}

.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary-hover);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--color-primary) 30%, transparent);
}

[data-theme="dark"] .chip {
  color: var(--color-primary);
}

.empty-state[hidden] {
  display: none;
}

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.empty-state svg {
  color: var(--color-text-faint);
}

.empty-state h3 {
  font-size: var(--text-lg);
}

.empty-state p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Mobile filter toggle */
.filters-toggle {
  display: inline-flex;
}

@media (min-width: 960px) {
  .filters-toggle {
    display: none;
  }
}

@media (max-width: 959px) {
  .filters {
    position: static;
    display: none;
  }
  .filters[data-open="1"] {
    display: flex;
  }
}

/* ---------- Product detail ---------- */
.product-page {
  padding-block: var(--space-8);
}

.breadcrumb {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-10);
}
.product-detail > * { min-width: 0; }

@media (min-width: 960px) {
  .product-detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-12);
  }
}

.gallery .main-img {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-surface-offset);
  box-shadow: var(--shadow-md);
}

.gallery .main-img img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 6%;
  box-sizing: border-box;
}

.gallery .thumbs {
  display: flex;
  overflow-x: auto;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.gallery .thumbs button {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
}

.gallery .thumbs button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery .thumbs button[aria-current="true"] {
  border-color: var(--color-primary);
}

.pd-info .brand {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.pd-info h1 {
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-3);
}

.pd-rating {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.pd-rating .stars {
  color: var(--color-gold);
  letter-spacing: 2px;
}

.pd-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.pd-price .price {
  font-size: var(--text-lg);
}

.pd-price .price-old {
  font-size: var(--text-sm);
}

.pd-stock {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-5);
}

.pd-stock.in { color: var(--color-success); }
.pd-stock.low { color: var(--color-gold); }
.pd-stock.out { color: var(--color-error); }

.variant-group {
  margin-bottom: var(--space-5);
}

.variant-group .label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  display: block;
}

.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.variant-option {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-sm);
  min-height: 40px;
}

.variant-option[aria-pressed="true"] {
  border-color: var(--color-primary);
  background: var(--color-primary-highlight);
  color: var(--color-primary-hover);
  font-weight: 700;
}

[data-theme="dark"] .variant-option[aria-pressed="true"] {
  color: var(--color-primary);
}

.variant-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-selector {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.qty-selector button {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.qty-selector button:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.qty-selector .val {
  min-width: 48px;
  text-align: center;
  font-weight: 700;
}

.pd-actions {
  display: flex;
  gap: var(--space-3);
  margin: var(--space-6) 0;
  flex-wrap: wrap;
}

.pd-actions .btn {
  flex: 1;
  min-width: 160px;
  white-space: normal;
}

.pd-actions .icon-btn {
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}

.pd-tabs {
  margin-top: var(--space-10);
}

.pd-tabs .tab-btns {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-5);
  overflow-x: auto;
}

.pd-tabs .tab-btns button {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.pd-tabs .tab-btns button[aria-selected="true"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.pd-tab-panel {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.9;
}

.pd-tab-panel ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pd-tab-panel ul li {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
}

.pd-tab-panel ul li::before {
  content: "—";
  color: var(--color-primary);
}

.spec-table {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-6);
  font-size: var(--text-sm);
}

.spec-table dt {
  color: var(--color-text-faint);
  font-weight: 600;
}

.spec-table dd {
  color: var(--color-text);
}

/* ---------- Cart page ---------- */
.cart-layout {
  display: grid;
  gap: var(--space-8);
  padding-block: var(--space-8);
  align-items: start;
}

@media (min-width: 960px) {
  .cart-layout {
    grid-template-columns: 1fr 360px;
  }
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cart-line {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  align-items: center;
}

.cart-line .img {
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 88px;
  height: 88px;
}

.cart-line .img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6%;
  box-sizing: border-box;
}

.cart-line .info .name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.cart-line .info .name:hover {
  color: var(--color-primary);
}

.cart-line .info .meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.cart-line .info .unit {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.cart-line .side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

@media (max-width: 640px) {
  .cart-line {
    grid-template-columns: 72px 1fr;
  }
  .cart-line .img {
    width: 72px;
    height: 72px;
    grid-row: 1;
  }
  .cart-line .side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

.cart-line .line-total {
  font-weight: 800;
  font-size: var(--text-sm);
}

.cart-line .remove {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.cart-line .remove:hover {
  color: var(--color-error);
}

.cart-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cart-summary h2 {
  font-size: var(--text-lg);
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.cart-summary .row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.cart-summary .row .v {
  color: var(--color-text);
  font-weight: 600;
}

.cart-summary .row.discount .v {
  color: var(--color-primary);
}

.cart-summary .total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-4);
  margin-top: var(--space-2);
  font-size: var(--text-base);
  font-weight: 800;
}

.cart-summary .note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.8;
}

.cart-summary .btn {
  margin-top: var(--space-3);
}

.backend-note {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  background: var(--color-surface-offset);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.8;
}

.backend-note svg {
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 2px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brown);
  color: #D9C8BC;
  margin-top: var(--space-16);
}

[data-theme="dark"] .site-footer {
  background: #16100C;
}

.footer-grid {
  display: grid;
  gap: var(--space-10);
  padding-block: var(--space-12);
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.site-footer .brand-name .fa {
  color: #FFF6EE;
}

.site-footer .brand-name .en {
  color: #B7A296;
}

.site-footer .about {
  font-size: var(--text-sm);
  line-height: 1.9;
  margin-top: var(--space-4);
  max-width: 36ch;
}

.site-footer h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #FFF6EE;
  margin-bottom: var(--space-4);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  color: #C4B2A4;
  text-decoration: none;
  font-size: var(--text-sm);
}

.footer-links a:hover {
  color: var(--nude);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.footer-contact div {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* Contact rows: text on one side, direct-action button (call / map / open) on the other */
.contact-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.contact-text {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.contact-text span {
  overflow-wrap: anywhere;
}
.contact-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid #4A382E;
  color: #EFE2D6;
  font-size: var(--text-xs);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.contact-action:hover {
  border-color: var(--rose-gold);
  background: color-mix(in oklab, var(--rose-gold) 14%, transparent);
  color: #fff;
}
.contact-action svg {
  width: 14px;
  height: 14px;
}

.footer-contact svg {
  color: var(--rose-gold);
  flex-shrink: 0;
}

.newsletter-form {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.newsletter-form input {
  flex: 1;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid #4A382E;
  background: transparent;
  color: #EFE2D6;
  font-size: var(--text-sm);
}

.newsletter-form input::placeholder {
  color: #8A7566;
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--rose-gold);
}

.newsletter-form .btn {
  background: var(--rose-gold);
  color: var(--brown);
}

.footer-bottom {
  border-top: 1px solid #3E2F26;
  padding-block: var(--space-4) var(--space-5);
  font-size: var(--text-xs);
  color: #8A7566;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}
.footer-bottom-row {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  width: 100%;
}

/* Shiny rose-gold "Mentis" credit in the footer bottom bar */
.mentis-credit {
  font-weight: 700;
  letter-spacing: 0.02em;
  background-image: linear-gradient(115deg, #A85D68 0%, #D98E86 18%, #F6C9B8 32%, #FFFFFF 42%, #F6C9B8 52%, #D98E86 66%, #A85D68 82%, #E0A880 92%, #A85D68 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
  animation: mentis-shine 4s linear infinite;
  transition: transform 0.2s ease;
  display: inline-block;
}
.mentis-credit:hover {
  transform: translateY(-1px);
}
@keyframes mentis-shine {
  0% { background-position: 250% 0; }
  100% { background-position: 0% 0; }
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  bottom: var(--space-6);
  inset-inline-start: 50%;
  transform: translateX(50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(420px, calc(100vw - 32px));
}

[dir="ltr"] .toast-wrap {
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  animation: toast-in 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast svg {
  color: var(--color-success);
  flex-shrink: 0;
}

.toast.err svg {
  color: var(--color-error);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Misc ---------- */
.page-title {
  font-size: var(--text-xl);
  font-weight: 800;
  padding-block: var(--space-8) 0;
}

.divider-dot {
  color: var(--color-text-faint);
}

/* Page loader styles live inline in each page <head> so they apply before first paint. */

/* ---------- Single-line product rows (bestsellers, new, offers, related) ---------- */
.product-row-wrap {
  position: relative;
}

.product-row {
  display: flex;
  gap: var(--space-5);
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--space-2) var(--space-1) var(--space-6);
  margin-inline: calc(var(--space-1) * -1);
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--space-1);
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--color-primary) 45%, transparent) transparent;
}

.product-row::-webkit-scrollbar {
  height: 6px;
}

.product-row::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--color-primary) 40%, transparent);
  border-radius: var(--radius-full);
}

.product-row:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.product-row > .product-card {
  flex: 0 0 clamp(200px, 23.5%, 264px);
  scroll-snap-align: start;
}

@media (max-width: 640px) {
  .product-row {
    gap: var(--space-3);
    margin-inline: calc(var(--space-4) * -1);
    padding-inline: var(--space-4);
    scroll-padding-inline: var(--space-4);
  }
  .product-row > .product-card {
    flex-basis: min(66vw, 240px);
  }
}

.row-arrow {
  position: absolute;
  top: calc(50% - var(--space-6));
  z-index: 3;
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: opacity var(--transition-interactive), background var(--transition-interactive), transform var(--transition-interactive);
}

.row-arrow:hover:not(:disabled) {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  transform: scale(1.06);
}

.row-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

/* Arrows sit on the physical side they scroll toward; "prev" is the start edge. */
.row-arrow.prev {
  inset-inline-start: calc(var(--space-3) * -1);
}

.row-arrow.next {
  inset-inline-end: calc(var(--space-3) * -1);
}

@media (hover: hover) and (min-width: 900px) {
  .row-arrow {
    display: grid;
  }
  .product-row-wrap.no-scroll .row-arrow {
    display: none;
  }
}

/* ---------- Category covers: light + dark variants ---------- */
.category-card .img {
  position: relative;
  background: var(--color-surface-offset);
}

.category-card .img .cover-dark {
  display: none;
}

[data-theme="dark"] .category-card .img .cover-dark {
  display: block;
}

[data-theme="dark"] .category-card .img .cover-light {
  display: none;
}

/* If a dark cover is missing, fall back to the light one. */
[data-theme="dark"] .category-card .img.no-dark .cover-light {
  display: block;
}

[data-theme="dark"] .category-card .img.no-dark .cover-dark {
  display: none;
}

/* ---------- Footer panel buttons ---------- */
.footer-panels {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-block: var(--space-4) var(--space-2);
}

.panel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 46px;
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  border: 1px solid #5A4538;
  background: rgb(255 246 238 / 6%);
  color: #F3E4D8;
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition-interactive), border-color var(--transition-interactive), color var(--transition-interactive), transform var(--transition-interactive);
}

.panel-btn svg {
  color: var(--rose-gold);
  flex-shrink: 0;
}

.panel-btn:hover {
  background: var(--rose-gold);
  border-color: var(--rose-gold);
  color: var(--brown);
  transform: translateY(-1px);
}

.panel-btn:hover svg {
  color: var(--brown);
}

.panel-btn:focus-visible {
  outline: 2px solid var(--rose-gold);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .footer-panels {
    flex-direction: column;
  }
  .panel-btn {
    width: 100%;
  }
}

/* Keep the desktop header on one line between 1280px and ~1400px. */
@media (min-width: 1280px) and (max-width: 1420px) {
  .main-nav a {
    padding-inline: var(--space-2);
  }
  .header-inner {
    gap: var(--space-3);
  }
}

/* Promo banner: side scrim keeps the text legible over the light photograph. */
.promo .overlay {
  background: linear-gradient(to left, oklch(0.27 0.04 35 / 0.86), oklch(0.27 0.04 35 / 0.5) 42%, transparent 75%);
}

[dir="ltr"] .promo .overlay {
  background: linear-gradient(to right, oklch(0.27 0.04 35 / 0.86), oklch(0.27 0.04 35 / 0.5) 42%, transparent 75%);
}

[data-theme="dark"] .promo img {
  filter: brightness(0.74) saturate(0.95);
}

@media (max-width: 640px) {
  .promo {
    min-height: 360px;
  }
  .promo .overlay,
  [dir="ltr"] .promo .overlay {
    background: linear-gradient(to top, oklch(0.27 0.04 35 / 0.88), oklch(0.27 0.04 35 / 0.4) 55%, transparent);
  }
}

.promo img {
  object-position: 15% 38%;
}

@media (min-width: 641px) {
  .promo {
    min-height: clamp(320px, 31vw, 420px);
  }
}

@media (max-width: 640px) {
  .promo img {
    object-position: 22% 40%;
  }
}

/* Lean footer: brand + contact details (editable in the management panel) */
.footer-grid-lean {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
}
.footer-contact a {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  color: #C4B2A4;
  text-decoration: none;
}
.footer-contact a:hover { color: var(--nude); }
.footer-contact svg { width: 18px; height: 18px; }
.footer-contact span { overflow-wrap: anywhere; }
.footer-policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-5);
}
.footer-policy-links a {
  color: #C4B2A4;
  text-decoration: none;
  font-size: var(--text-xs);
}
.footer-policy-links a:hover { color: var(--nude); }
@media (max-width: 720px) {
  .footer-grid-lean { grid-template-columns: 1fr; gap: var(--space-8); padding-block: var(--space-10); }
}
.footer-contact-col { justify-self: end; min-width: min(280px, 100%); }
.footer-handle { color: var(--rose-gold); font-size: var(--text-xs); }
@media (max-width: 720px) { .footer-contact-col { justify-self: stretch; } }

/* Scrollable, smooth-moving brand/category filter lists */
.filters .check-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 264px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: var(--space-1) var(--space-2) var(--space-2) 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-divider) transparent;
  transition: max-height var(--transition, 0.2s ease);
}
.filters .check-list::-webkit-scrollbar { width: 8px; }
.filters .check-list::-webkit-scrollbar-track { background: transparent; }
.filters .check-list::-webkit-scrollbar-thumb {
  background: var(--color-divider);
  border-radius: 999px;
}
.filters .check-list::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }
.brand-name-en { font-family: "Cormorant Garamond", Vazirmatn, Georgia, serif; letter-spacing: 0.02em; }

/* ============================================================
   Showcase mode additions — consultation, advantages,
   category rail, mobile filter bottom sheet
   ============================================================ */

/* Consultation floating button (all storefront pages) */
.consult-fab {
  position: fixed;
  inset-inline-end: var(--space-4);
  bottom: var(--space-4);
  z-index: 60;
}
.consult-fab-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: none;
  border-radius: 999px;
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.consult-fab-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22); }
@media (max-width: 720px) {
  .consult-fab-btn .consult-fab-label { display: none; }
  .consult-fab-btn { padding: var(--space-3); }
}

/* Consultation dialog */
.consult-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}
.consult-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 14, 10, 0.55);
  backdrop-filter: blur(3px);
}
.consult-dialog-panel {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: consult-in 0.22s ease;
}
@keyframes consult-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.consult-dialog-panel h3 { margin-bottom: var(--space-3); }
.consult-dialog-panel p { color: var(--color-text-muted); margin-bottom: var(--space-5); }
.consult-dialog-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
  color: var(--color-primary);
}
.consult-dialog-close {
  position: absolute;
  inset-inline-end: var(--space-3);
  top: var(--space-3);
}
.consult-phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  direction: ltr;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: border-color 0.2s ease;
}
.consult-phone:hover { border-color: var(--color-primary); }
.consult-phone-empty { font-size: var(--text-sm); }

/* Consultation button next to the price on the product page */
.pd-price { flex-wrap: wrap; }
.pd-price .btn-consult {
  margin-inline-start: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-5);
}
.pd-price .btn-consult svg { width: 20px; height: 20px; }
@media (max-width: 720px) {
  .pd-price .btn-consult { margin-inline-start: 0; width: 100%; justify-content: center; }
}

/* Product advantages list */
.pd-advantages {
  margin-top: var(--space-6);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: color-mix(in srgb, var(--color-primary) 5%, var(--color-surface));
}
.pd-advantages h3 { font-size: var(--text-md); margin-bottom: var(--space-3); }
.pd-advantages ul {
  list-style: none;
  display: grid;
  gap: var(--space-2);
}
.pd-advantages li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.pd-advantages li svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--color-success);
}

/* Category rail — horizontal one-tap category chips on the shop page */
.cat-rail {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-block: var(--space-2);
  margin-bottom: var(--space-4);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-rail::-webkit-scrollbar { display: none; }
.cat-rail-chip {
  flex-shrink: 0;
  scroll-snap-align: start;
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  color: var(--color-text-muted);
  border-radius: 999px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.cat-rail-chip:hover { border-color: var(--color-primary); color: var(--color-text); }
.cat-rail-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Mobile filters: bottom sheet with internal scrolling */
.filters-sheet-head { display: none; }
@media (max-width: 959px) {
  .filters[data-open="1"] {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    top: auto;
    max-height: 82vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
    z-index: 90;
    margin: 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
    animation: sheet-up 0.25s ease;
  }
  @keyframes sheet-up {
    from { transform: translateY(40px); opacity: 0.6; }
    to { transform: none; opacity: 1; }
  }
  .filters-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: calc(-1 * var(--space-5));
    margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) 0;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-divider);
    z-index: 2;
  }
  .filters-sheet-title { font-weight: 600; }
  .filters .check-list { max-height: 200px; }
}

/* ---------- Checkout page ---------- */
.checkout-layout {
  display: grid;
  gap: var(--space-8);
  align-items: start;
  padding-block: var(--space-8);
}

@media (min-width: 960px) {
  .checkout-layout {
    grid-template-columns: 1fr 380px;
  }
}

.checkout-form {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.checkout-form h2 {
  font-size: var(--text-lg);
  font-weight: 800;
}

.checkout-hint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: calc(-1 * var(--space-3));
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
}

.checkout-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.checkout-field > span {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
}

.checkout-field input,
.checkout-field select,
.checkout-field textarea {
  min-height: 46px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  font-size: var(--text-sm);
  width: 100%;
}

.checkout-field textarea {
  min-height: 96px;
  resize: vertical;
}

.checkout-field input:focus,
.checkout-field select:focus,
.checkout-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 16%, transparent);
}

.checkout-field input:user-invalid,
.checkout-field select:user-invalid,
.checkout-field textarea:user-invalid {
  border-color: var(--color-error);
}

.checkout-error {
  background: var(--color-error-highlight);
  color: var(--color-error);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
}

.btn-block {
  width: 100%;
}

/* ---------- Checkout order list ---------- */
.checkout-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px dashed var(--color-divider);
}

.checkout-item:last-of-type {
  border-bottom: none;
}

.checkout-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  padding: 4px;
  box-sizing: border-box;
}

.checkout-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.checkout-item-info .name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.checkout-item-info .name:hover {
  color: var(--color-primary);
}

.checkout-item-info .meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.checkout-item .line-total {
  font-weight: 800;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.cart-summary .row.sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: calc(-1 * var(--space-2));
}

.cart-summary .row.sub span:last-child:empty {
  display: none;
}

.cart-cleanup {
  margin-top: var(--space-4);
  display: flex;
  justify-content: flex-start;
}

/* ---------- Payment page ---------- */
.payment-card {
  max-width: 520px;
  margin-inline: auto;
  margin-block: var(--space-12);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-10) var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

.payment-gateway-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
}

.payment-amount {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 100%;
  border-block: 1px solid var(--color-divider);
  padding-block: var(--space-4);
}

.payment-amount dt {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
}

.payment-amount dd {
  font-size: var(--text-xl);
  font-weight: 800;
}

.payment-help {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.9;
}

.payment-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  margin-top: var(--space-2);
}

.payment-status {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
}

.payment-status.ok {
  background: var(--color-success-highlight);
  color: var(--color-success);
}

.payment-status.fail {
  background: var(--color-error-highlight);
  color: var(--color-error);
}

.payment-spinner {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 3px solid var(--color-primary-highlight);
  border-top-color: var(--color-primary);
  animation: payment-spin 0.9s linear infinite;
  margin-inline: auto;
}

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

/* Product-card actions: two buttons side by side */
.product-card .actions {
  flex-wrap: wrap;
}

.product-card .actions .btn {
  min-width: 0;
}

@media (max-width: 480px) {
  .product-card .actions {
    flex-direction: column;
  }
}

/* ============================================================
   Payment page — card-to-card transfer + receipt upload (v13)
   ============================================================ */
.receipt-section {
  margin-block: var(--space-6);
  text-align: start;
  display: grid;
  gap: var(--space-4);
}

.receipt-section h4 {
  margin: 0;
  font-size: 0.98rem;
}

.receipt-card-box {
  display: grid;
  gap: 6px;
  padding: var(--space-4) var(--space-5);
  border: 1.5px dashed var(--management-border, #d9c2b6);
  border-radius: 14px;
  background: var(--color-surface);
  justify-items: start;
}

.receipt-card-label {
  font-size: 0.8rem;
  opacity: 0.75;
}

.receipt-card-number {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.receipt-drop {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: var(--space-6) var(--space-4);
  border: 2px dashed var(--management-border, #d9c2b6);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  text-align: center;
}

.receipt-drop:hover,
.receipt-drop:focus-visible,
.receipt-drop.drag {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 6%, transparent);
  outline: none;
}

.receipt-drop.has-file {
  border-style: solid;
  border-color: var(--color-primary);
}

.receipt-drop-icon {
  color: var(--color-primary);
}

.receipt-drop small {
  opacity: 0.7;
  font-size: 0.78rem;
}

.receipt-preview,
.receipt-thumb {
  max-width: min(100%, 340px);
  border-radius: 12px;
  border: 1px solid var(--management-border, #d9c2b6);
  margin-inline: auto;
  display: block;
}

.receipt-field {
  display: grid;
  gap: 6px;
  text-align: start;
  font-size: 0.88rem;
}

.receipt-field input,
.receipt-field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--management-border, #d9c2b6);
  background: var(--color-surface);
  color: inherit;
  font: inherit;
}

/* ---------- Management orders: receipt viewer + status rail ---------- */
.receipt-view {
  margin-block: var(--space-4);
}

.receipt-view img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--management-border, #d9c2b6);
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.receipt-view img:hover {
  transform: scale(1.015);
}

.receipt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgb(0 0 0 / 0.82);
  cursor: zoom-out;
}

.receipt-lightbox img {
  max-width: min(94vw, 900px);
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.5);
}

.order-history {
  margin-block: var(--space-4);
  padding: var(--space-4);
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-primary) 5%, var(--color-surface));
  font-size: 0.85rem;
  display: grid;
  gap: 4px;
}

.order-history .order-history-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}

.order-history .order-history-row span:last-child {
  opacity: 0.8;
}

/* ---------- Checkout review & confirmation step (added v15) ---------- */
.checkout-review {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.review-title {
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.review-hint {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}

.review-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 860px) {
  .review-grid { grid-template-columns: 1fr; }
}

.review-panel {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--color-surface-2);
}

.review-panel h3 {
  font-size: var(--text-base);
  font-weight: 800;
  margin-bottom: var(--space-3);
}

.review-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.review-panel-head h3 { margin-bottom: 0; }

.review-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: 0;
}

.review-info > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.review-info > div.wide { grid-column: 1 / -1; }

.review-info dt {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.review-info dd {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.review-totals {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.review-actions .btn-primary {
  min-width: min(340px, 100%);
}

/* ---------- Payment page: polite intro + amount breakdown (added v15) ---------- */
.payment-intro {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-inline-start: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.9;
  margin: var(--space-4) 0;
}

.payment-breakdown {
  margin: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.payment-breakdown .prow {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--color-text-muted);
}

.payment-breakdown .prow .v {
  color: var(--color-text);
  font-weight: 600;
  white-space: nowrap;
}

.payment-breakdown .prow.discount .v { color: var(--color-primary); }

.payment-breakdown .prow.grand {
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-2);
  color: var(--color-text);
  font-weight: 800;
  font-size: var(--text-base);
}

.payment-breakdown .pitem {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--color-divider);
}

.payment-breakdown .pitem .pname { font-weight: 700; color: var(--color-text); }
.payment-breakdown .pitem .pmeta { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------- Thank-you popup after final receipt send (added v17) ---------- */
.thanks-overlay { position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center; padding:var(--space-4); background:rgba(30,20,15,.55); backdrop-filter:blur(4px); animation:thanks-fade .25s ease; }
.thanks-card { position:relative; width:min(420px,100%); max-height:min(88vh,660px); overflow:auto; display:grid; gap:var(--space-3); justify-items:center; text-align:center; padding:var(--space-8) var(--space-5); background:var(--color-surface); border-radius:var(--radius-lg); box-shadow:0 24px 64px rgba(0,0,0,.28); animation:thanks-pop .32s cubic-bezier(.2,.9,.3,1.15); }
.thanks-check svg { display:block; }
.thanks-check circle { stroke:var(--color-primary); stroke-width:2.5; stroke-dasharray:160; stroke-dashoffset:160; animation:thanks-draw .5s .1s ease forwards; }
.thanks-check path { stroke:var(--color-primary); stroke-width:4; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:42; stroke-dashoffset:42; animation:thanks-draw .35s .55s ease forwards; }
.thanks-card h2 { margin:0; font-size:var(--text-xl,1.35rem); }
.thanks-msg { margin:0; font-size:1.05rem; font-weight:800; color:var(--color-primary); }
.thanks-help { margin:0; font-size:var(--text-sm); line-height:1.9; color:var(--color-text-muted); }
.thanks-meta { display:flex; justify-content:space-between; align-items:center; gap:var(--space-3); width:100%; margin:0; padding:var(--space-2) var(--space-3); background:var(--color-bg); border-radius:var(--radius-sm); font-size:var(--text-sm); }
.thanks-meta dt { color:var(--color-text-muted); }
.thanks-meta dd { margin:0; font-weight:700; }
.thanks-close { position:absolute; top:12px; inset-inline-end:12px; width:32px; height:32px; border:0; border-radius:50%; background:var(--color-bg); color:var(--color-text-muted); font-size:.85rem; cursor:pointer; display:grid; place-items:center; }
.thanks-close:hover { color:var(--color-text); }
body.thanks-lock { overflow:hidden; }
@keyframes thanks-fade { from { opacity:0; } }
@keyframes thanks-pop { from { opacity:0; transform:translateY(14px) scale(.96); } }
@keyframes thanks-draw { to { stroke-dashoffset:0; } }

/* ---------- Receipt-required warning on checkout (added v18) ---------- */
.checkout-receipt-warning { margin:var(--space-3) 0; padding:var(--space-3) var(--space-4); border:1px solid var(--color-error); border-radius:var(--radius-sm); background:var(--color-error-highlight); color:var(--color-error); font-size:var(--text-sm); font-weight:600; line-height:1.9; text-align:start; }
.review-actions .checkout-receipt-warning { width:100%; flex-basis:100%; }
