:root {
  --ink: #101820;
  --muted: #66736d;
  --paper: #fbfaf6;
  --surface: #fffdf8;
  --line: #ded8ca;
  --gold: #b8893a;
  --gold-dark: #7a5621;
  --saffron: #d7a443;
  --temple-red: #6e1f2e;
  --jade: #14766d;
  --jade-dark: #0e514b;
  --wine: #7d2538;
  --charcoal: #171615;
  --shadow: 0 18px 48px rgba(16, 24, 32, 0.16);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(184, 137, 58, 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, #fbfaf6 0%, #f5f0e5 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

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

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

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

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 12px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid rgba(184, 137, 58, 0.32);
  background:
    linear-gradient(90deg, rgba(255, 253, 248, 0.94), rgba(248, 241, 225, 0.92));
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(29, 22, 13, 0.08);
}

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

.brand-logo {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid rgba(184, 137, 58, 0.65);
  border-radius: 50%;
  background: #fffdf8;
}

.brand-text {
  display: grid;
  line-height: 1.05;
}

.brand-text strong {
  display: flex;
  flex-wrap: wrap;
  gap: 0 5px;
  max-width: none;
  font-size: 0.98rem;
  letter-spacing: 0;
  line-height: 1.08;
}

.brand-word {
  white-space: nowrap;
}

.brand-text small {
  color: var(--gold-dark);
  font-weight: 700;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 4vw, 34px);
  color: var(--muted);
  font-weight: 700;
}

.main-nav a:hover {
  color: var(--ink);
}

.header-actions,
.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.lang-switch button,
.cart-button,
.drawer-close {
  border: 0;
  background: transparent;
}

.lang-switch button {
  min-width: 48px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
}

.lang-switch button.is-active {
  color: #fffdf8;
  background: var(--jade-dark);
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  color: #fffdf8;
  background: var(--ink);
  border-radius: var(--radius);
  font-weight: 800;
}

.cart-count {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  border-radius: 999px;
  font-size: 0.82rem;
}

.site-notice {
  position: relative;
  z-index: 45;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 5vw, 70px);
  color: #fffdf8;
  background: linear-gradient(135deg, var(--jade-dark), var(--jade));
  box-shadow: 0 12px 28px rgba(14, 81, 75, 0.18);
}

.site-notice-failed,
.site-notice-invalid {
  background: linear-gradient(135deg, var(--wine), #4e1824);
}

.site-notice div {
  display: grid;
  gap: 2px;
}

.site-notice span,
.site-notice a {
  color: rgba(255, 253, 248, 0.84);
  font-weight: 800;
}

.site-notice a {
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(430px, 42.8125vw, 760px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 128px clamp(18px, 5vw, 70px) 34px;
  color: #fffdf8;
  background:
    linear-gradient(180deg, rgba(6, 4, 2, 0.14) 0%, rgba(6, 4, 2, 0.2) 60%, rgba(6, 4, 2, 0.72) 100%),
    url("/assets/hero-fopai-cover.jpg") center / cover no-repeat;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(var(--max), 100%);
  justify-content: flex-end;
}

.hero-cultural-line {
  display: none;
}

.hero::after {
  display: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.4rem, 9vw, 7.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero h1 span {
  display: block;
}

.hero .eyebrow,
.hero h1,
.hero-lead,
.hero-tags {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero-lead {
  width: min(580px, 100%);
  margin: 22px 0 0;
  color: rgba(255, 253, 248, 0.88);
  font-size: clamp(1.05rem, 2.4vw, 1.38rem);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-tags span {
  padding: 8px 11px;
  border: 1px solid rgba(215, 164, 67, 0.38);
  border-radius: 999px;
  color: rgba(255, 253, 248, 0.88);
  background: rgba(16, 15, 13, 0.42);
  font-size: 0.86rem;
  font-weight: 900;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0;
  padding: 10px;
  border: 1px solid rgba(215, 164, 67, 0.26);
  border-radius: 8px;
  background: rgba(7, 5, 3, 0.54);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 900;
  text-align: center;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

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

.button-primary {
  color: #fffdf8;
  background: linear-gradient(135deg, var(--jade), #1b8173);
  border-color: rgba(255, 253, 248, 0.08);
  box-shadow: 0 12px 24px rgba(14, 81, 75, 0.24);
}

.button-primary:hover {
  background: var(--jade-dark);
}

.button-soft {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.button-share {
  color: #fffdf8;
  background: linear-gradient(135deg, #8c2d1c, #5d1712);
  border-color: rgba(215, 164, 67, 0.34);
}

.hero .button-soft {
  color: #fffdf8;
  background: rgba(255, 253, 248, 0.12);
  border-color: rgba(255, 253, 248, 0.35);
}

.section {
  position: relative;
  scroll-margin-top: 180px;
  padding: clamp(54px, 8vw, 92px) clamp(18px, 5vw, 70px);
}

.shop-section {
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(184, 137, 58, 0.07) 48% 52%, transparent 52% 100%) 0 0 / 34px 34px,
    linear-gradient(180deg, #fbfaf6 0%, #f2eadc 100%);
}

.shop-section::before {
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background:
    linear-gradient(90deg, transparent, rgba(184, 137, 58, 0.55), transparent),
    repeating-linear-gradient(90deg, rgba(184, 137, 58, 0.8) 0 22px, transparent 22px 34px);
  content: "";
  opacity: 0.55;
}

.section-heading,
.admin-panel,
.admin-login {
  width: min(var(--max), 100%);
  margin-inline: auto;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 26px;
}

.section-heading::before {
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  content: "";
}

.section-heading h1,
.section-heading h2 {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.8vw, 4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.lucky-section {
  overflow: hidden;
  color: #fffdf8;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 207, 104, 0.22), transparent 34%),
    linear-gradient(135deg, #4c0302 0%, #7f0805 48%, #250100 100%);
}

.lucky-inner {
  position: relative;
  display: grid;
  gap: clamp(22px, 4vw, 34px);
  width: min(var(--max), 100%);
  margin-inline: auto;
  justify-items: center;
}

.lucky-copy {
  display: grid;
  gap: 12px;
  max-width: 780px;
  text-align: center;
  justify-items: center;
}

.lucky-copy .eyebrow {
  color: #ffd66c;
}

.lucky-copy h2 {
  margin: 0;
  color: #ffe7a8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.lucky-copy p:not(.eyebrow),
.lucky-game p {
  margin: 0;
  color: rgba(255, 250, 226, 0.84);
  font-size: 1.02rem;
}

.lucky-game {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: 100%;
}

.lucky-board {
  position: relative;
  overflow: hidden;
  width: min(1160px, 100%);
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 214, 112, 0.5);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(50, 0, 0, 0.06), rgba(48, 0, 0, 0.12)),
    url("/assets/lucky-phra-phrom-board.png") center / cover no-repeat;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.42),
    inset 0 0 70px rgba(255, 214, 112, 0.16);
}

.lucky-board::before {
  position: absolute;
  inset: 31% 23% 32%;
  border-radius: 8px;
  background: radial-gradient(circle, rgba(126, 10, 5, 0.6), rgba(58, 0, 0, 0.08) 72%);
  content: "";
  pointer-events: none;
}

.lucky-board-copy {
  display: none;
}

.lucky-board-copy p {
  margin: 0;
  color: #ffe797;
  font-size: clamp(1.2rem, 3vw, 2.5rem);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-shadow: 0 0 20px rgba(255, 198, 63, 0.72), 0 3px 18px rgba(0, 0, 0, 0.6);
}

.lucky-board-copy h3 {
  margin: 0;
  color: #fff1b8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 22px rgba(255, 196, 45, 0.82), 0 4px 22px rgba(0, 0, 0, 0.62);
}

.lucky-number {
  position: absolute;
  z-index: 2;
  right: 17.6%;
  bottom: 9%;
  left: 17.6%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.35%;
}

.lucky-number span {
  position: relative;
  overflow: hidden;
  display: grid;
  min-width: 0;
  aspect-ratio: 1.18 / 1;
  place-items: center;
  border: 2px solid rgba(255, 218, 109, 0.95);
  border-radius: 8px;
  color: #fff9e8;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 74, 51, 0.35), transparent 44%),
    linear-gradient(180deg, #e11814 0%, #8e0704 68%, #4f0100 100%);
  box-shadow:
    0 0 22px rgba(255, 215, 87, 0.52),
    0 14px 34px rgba(0, 0, 0, 0.28),
    inset 0 0 22px rgba(255, 214, 112, 0.16);
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 5px 16px rgba(0, 0, 0, 0.42);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.lucky-number span::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 38%, rgba(0, 0, 0, 0.16));
  content: "";
  pointer-events: none;
}

.lucky-number span.is-empty {
  color: #fff7d8;
}

.lucky-number span.is-spinning {
  border-color: #fff2a5;
  color: #fffbea;
  animation: luckySlotSpin 0.16s linear infinite;
}

.lucky-number span.just-stopped {
  animation: luckySlotStop 0.36s ease-out;
}

.lucky-section .button-primary {
  min-width: min(320px, 100%);
  color: #6c0703;
  background: linear-gradient(135deg, #ffe18a, #f3b72c);
  border-color: rgba(255, 252, 224, 0.45);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

#drawLuckyNumber {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(58px, 8vw, 70px);
  width: min(640px, 100%);
  border: 2px solid rgba(255, 244, 178, 0.94);
  border-radius: 12px;
  color: #6c0703;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 230, 0.84), transparent 38%),
    linear-gradient(135deg, #fff0a9 0%, #f5c13e 48%, #d99817 100%);
  box-shadow:
    0 0 0 6px rgba(255, 214, 112, 0.13),
    0 0 36px rgba(255, 214, 112, 0.58),
    0 20px 42px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: clamp(1.08rem, 3vw, 1.48rem);
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 252, 224, 0.55);
  animation: luckyCtaPulse 1.9s ease-in-out infinite;
}

#drawLuckyNumber::before {
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -46%;
  width: 36%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.88), transparent);
  content: "";
  transform: skewX(-18deg);
  animation: luckyCtaShine 2.35s ease-in-out infinite;
  pointer-events: none;
}

#drawLuckyNumber::after {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 235, 0.58);
  border-radius: 9px;
  content: "";
  animation: luckyCtaInnerGlow 1.9s ease-in-out infinite;
  pointer-events: none;
}

#drawLuckyNumber:hover {
  animation-duration: 1.15s;
}

#drawLuckyNumber:active {
  transform: translateY(1px) scale(0.985);
}

.lucky-section .button-primary:disabled {
  cursor: wait;
  opacity: 0.86;
}

#drawLuckyNumber:disabled {
  animation: none;
  box-shadow:
    0 0 0 4px rgba(255, 214, 112, 0.1),
    0 12px 24px rgba(0, 0, 0, 0.24);
}

#drawLuckyNumber:disabled::before,
#drawLuckyNumber:disabled::after {
  display: none;
}

@keyframes luckySlotSpin {
  0% {
    transform: translateY(-3px) scale(1.01);
    filter: blur(0.4px);
  }
  50% {
    transform: translateY(3px) scale(1.03);
    filter: blur(1px);
  }
  100% {
    transform: translateY(-2px) scale(1.01);
    filter: blur(0.4px);
  }
}

@keyframes luckySlotStop {
  0% {
    transform: scale(0.92);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes luckyCtaPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 0 0 6px rgba(255, 214, 112, 0.13),
      0 0 34px rgba(255, 214, 112, 0.54),
      0 20px 42px rgba(0, 0, 0, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }
  46% {
    transform: translateY(-5px) scale(1.025);
    box-shadow:
      0 0 0 8px rgba(255, 214, 112, 0.18),
      0 0 54px rgba(255, 214, 112, 0.84),
      0 26px 50px rgba(0, 0, 0, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.78);
  }
  70% {
    transform: translateY(0) scale(1);
  }
}

@keyframes luckyCtaShine {
  0% {
    left: -46%;
    opacity: 0;
  }
  22% {
    opacity: 0;
  }
  46% {
    opacity: 0.9;
  }
  72%,
  100% {
    left: 112%;
    opacity: 0;
  }
}

@keyframes luckyCtaInnerGlow {
  0%,
  100% {
    box-shadow: inset 0 0 0 rgba(255, 255, 235, 0);
  }
  48% {
    box-shadow: inset 0 0 18px rgba(255, 255, 235, 0.42);
  }
}

@media (prefers-reduced-motion: reduce) {
  #drawLuckyNumber,
  #drawLuckyNumber::after {
    animation: none;
  }

  #drawLuckyNumber::before {
    display: none;
  }
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(var(--max), 100%);
  margin: 0 auto 26px;
}

.category-filters button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(184, 137, 58, 0.28);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 253, 248, 0.82);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(29, 22, 13, 0.05);
}

.category-filters button.is-active {
  color: #fffdf8;
  background: linear-gradient(135deg, #12100d, #332415);
  border-color: rgba(215, 164, 67, 0.5);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(var(--max), 100%);
  margin-inline: auto;
}

.product-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid rgba(184, 137, 58, 0.24);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(29, 22, 13, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.product-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--temple-red), var(--gold), #e8c878);
  content: "";
  z-index: 1;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(184, 137, 58, 0.48);
  box-shadow: 0 22px 46px rgba(29, 22, 13, 0.14);
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #ede7da;
}

.product-media::after {
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(16, 12, 8, 0.32));
  content: "";
}

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

.product-badge {
  z-index: 1;
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 7px 9px;
  border-radius: 6px;
  color: #fffdf8;
  background: rgba(16, 24, 32, 0.78);
  font-size: 0.8rem;
  font-weight: 900;
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.product-title-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.product-title-row h3 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.25;
}

.price {
  white-space: nowrap;
  color: var(--wine);
  font-weight: 950;
}

.product-description {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.product-meta span {
  padding: 4px 8px;
  border: 1px solid rgba(184, 137, 58, 0.24);
  border-radius: 999px;
  background: #f8f4eb;
}

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

.product-actions {
  display: grid;
  gap: 8px;
}

.legal-section {
  background: #f4f7f3;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(var(--max), 100%);
  margin-inline: auto;
}

.legal-card {
  min-height: 210px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.legal-card h3 {
  margin: 0 0 12px;
  font-size: 1.14rem;
}

.legal-card p {
  margin: 0;
  color: var(--muted);
}

.policy-section {
  min-height: calc(100dvh - 176px);
}

.policy-card {
  width: min(860px, 100%);
  margin-inline: auto;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.policy-body {
  display: grid;
  gap: 22px;
}

.policy-block {
  display: grid;
  gap: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.policy-block:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.policy-block h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.3vw, 1.5rem);
}

.policy-block p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.admin-section {
  background: #f4f7f3;
  min-height: calc(100dvh - 67px);
}

.admin-login {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 20px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
}

textarea {
  resize: vertical;
}

.admin-panel {
  display: grid;
  grid-template-columns: minmax(290px, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: start;
}

.admin-panel > *,
.order-manager > * {
  min-width: 0;
}

.product-form,
.admin-table-wrap {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
}

.form-title-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.form-title-row h3,
.admin-table-wrap h3 {
  margin: 0;
  font-size: 1.16rem;
}

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

.span-2 {
  grid-column: span 2;
}

.form-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 16px 0;
}

.form-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.form-checks input {
  width: 18px;
  min-height: 18px;
}

.image-upload-field {
  display: grid;
  gap: 10px;
}

.image-picker {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed rgba(186, 137, 43, 0.55);
  border-radius: var(--radius);
  background: #fffdf8;
}

.image-picker input {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.image-upload-preview {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.image-upload-preview img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8f4eb;
}

.image-upload-preview span,
.form-hint {
  color: var(--muted);
  font-weight: 800;
}

.form-hint {
  margin: 0;
  font-size: 0.92rem;
}

.status-line {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--jade-dark);
  font-weight: 800;
}

.compact-status {
  margin-top: 0;
}

.admin-lists {
  display: grid;
  gap: 18px;
}

.admin-security-card {
  display: grid;
  gap: 16px;
}

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

.compact-form {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.compact-form .button {
  width: fit-content;
}

.admin-account-list {
  display: grid;
  gap: 10px;
}

.admin-account-table {
  min-width: 520px;
}

.order-manager {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
}

.order-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.orders-table tr[data-order-id] {
  cursor: pointer;
}

.orders-table tr.is-selected td {
  background: #eef7f4;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--ink);
  background: #f0ece2;
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-paid,
.status-completed {
  color: #0b4d36;
  background: #dff3e8;
}

.status-processing {
  color: #6d4b00;
  background: #fff0c7;
}

.status-shipped {
  color: #0e514b;
  background: #d9f2ef;
}

.status-cancelled {
  color: #7d2538;
  background: #f6dfe4;
}

.order-detail {
  display: grid;
  gap: 16px;
}

.order-detail h3,
.order-detail h4 {
  margin: 0;
}

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

.detail-grid section,
.order-items-detail,
.whatsapp-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fffdf8;
}

.detail-grid p {
  margin: 8px 0 0;
  color: var(--muted);
}

.order-items-detail {
  display: grid;
  gap: 10px;
}

.order-line-detail {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: start;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.order-line-detail small {
  display: block;
  color: var(--muted);
}

.order-total-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.order-total-detail strong {
  color: var(--wine);
}

.order-update-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fffdf8;
}

.order-action-row,
.order-update-form .status-line {
  grid-column: 1 / -1;
}

.order-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.whatsapp-preview textarea {
  min-height: 180px;
  color: var(--ink);
  background: #f8f4eb;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

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

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

td {
  font-size: 0.94rem;
}

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

.text-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
}

.danger {
  color: #fffdf8;
  border-color: var(--wine);
  background: var(--wine);
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(16, 24, 32, 0.44);
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  height: 100dvh;
  overflow-y: auto;
  padding: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

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

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

.drawer-header h2 {
  margin: 0;
}

.drawer-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 1.5rem;
}

.cart-items {
  overflow: visible;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 3px;
}

.cart-item {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
}

.cart-item img {
  width: 74px;
  height: 74px;
  border-radius: 6px;
  object-fit: cover;
}

.cart-item h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.order-confirmation {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}

.order-confirmation h3 {
  margin: 0;
  color: var(--jade-dark);
  font-size: 1.08rem;
}

.order-block {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.order-block strong {
  color: var(--ink);
}

.order-block p {
  margin: 0;
  color: var(--muted);
}

.order-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  color: var(--muted);
}

.order-line strong {
  grid-column: 1 / -1;
  color: var(--wine);
}

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

.quantity-row button:not(.text-button) {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-weight: 900;
}

.quantity-row .text-button {
  min-width: 54px;
  padding: 0 10px;
}

.cart-summary {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cart-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.total-row {
  color: var(--wine);
  font-size: 1.12rem;
}

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

.checkout-form label:nth-child(4),
.checkout-form label:nth-child(6),
.checkout-consent,
.checkout-button {
  grid-column: span 2;
}

.checkout-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

.checkout-consent input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.payment-notice {
  min-height: 28px;
  margin-top: 12px;
  color: var(--jade-dark);
  font-weight: 800;
}

.site-footer {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 20px;
  padding: clamp(34px, 6vw, 64px) clamp(18px, 5vw, 70px) 28px;
  color: rgba(255, 253, 248, 0.78);
  background:
    linear-gradient(135deg, rgba(16, 13, 9, 0.98), rgba(35, 26, 16, 0.98) 55%, rgba(18, 16, 14, 0.98)),
    repeating-linear-gradient(135deg, rgba(215, 164, 67, 0.08) 0 1px, transparent 1px 20px);
  border-top: 1px solid rgba(215, 164, 67, 0.46);
}

.site-footer::before {
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background:
    linear-gradient(90deg, transparent, rgba(215, 164, 67, 0.9), transparent),
    repeating-linear-gradient(90deg, rgba(215, 164, 67, 0.9) 0 28px, transparent 28px 42px);
  content: "";
}

.site-footer::after {
  position: absolute;
  top: 24px;
  right: clamp(18px, 5vw, 70px);
  width: min(280px, 54vw);
  height: min(280px, 54vw);
  border: 1px solid rgba(215, 164, 67, 0.18);
  border-radius: 50% 50% 0 0;
  content: "";
  opacity: 0.7;
}

.site-footer strong {
  color: #fffdf8;
}

.site-footer p {
  margin: 6px 0 0;
}

.footer-main,
.site-footer nav,
.footer-copyright {
  position: relative;
  z-index: 1;
  width: min(var(--max), 100%);
  margin-inline: auto;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: clamp(20px, 4vw, 44px);
  align-items: stretch;
}

.footer-company {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  max-width: 760px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(215, 164, 67, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.055);
  backdrop-filter: blur(8px);
}

.footer-seal {
  width: clamp(74px, 9vw, 104px);
  height: clamp(74px, 9vw, 104px);
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid rgba(215, 164, 67, 0.65);
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.footer-company > div > strong {
  display: block;
  font-size: clamp(1.45rem, 3vw, 2.45rem);
  line-height: 1.02;
  font-family: Georgia, "Times New Roman", serif;
}

.footer-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.company-reg {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  color: rgba(255, 253, 248, 0.7);
  font-size: 0.94rem;
  font-weight: 800;
}

.company-reg span {
  white-space: nowrap;
}

.footer-contact-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid rgba(215, 164, 67, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.09);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.2);
}

.footer-phone {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  color: rgba(255, 253, 248, 0.82);
}

.footer-phone strong {
  color: #fffdf8;
  font-size: clamp(1.4rem, 3vw, 1.95rem);
  line-height: 1;
}

.footer-whatsapp {
  display: inline-flex;
  min-height: 46px;
  width: fit-content;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  color: #fffdf8;
  background: linear-gradient(135deg, var(--jade), var(--jade-dark));
  border: 1px solid rgba(255, 253, 248, 0.16);
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(14, 81, 75, 0.35);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: flex-start;
  padding-top: 18px;
  border-top: 1px solid rgba(215, 164, 67, 0.18);
}

.site-footer a {
  color: rgba(255, 253, 248, 0.78);
  font-weight: 800;
}

.site-footer a:hover {
  color: #fffdf8;
}

.site-footer a.is-active {
  color: #fffdf8;
}

.footer-copyright {
  margin-top: 0;
  color: rgba(255, 253, 248, 0.62);
}

.visitor-counter {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  color: rgba(255, 253, 248, 0.76);
  border: 1px solid rgba(215, 164, 67, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.06);
  font-size: 0.9rem;
  font-weight: 850;
}

.visitor-counter strong {
  color: #ffe18a;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.floating-whatsapp {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #fffdf8;
  background: linear-gradient(135deg, #1a8f74, var(--jade-dark));
  border: 1px solid rgba(255, 253, 248, 0.22);
  border-radius: 999px;
  box-shadow: 0 18px 36px rgba(14, 81, 75, 0.32);
  font-weight: 900;
}

.install-prompt {
  position: fixed;
  right: 16px;
  bottom: 76px;
  z-index: 72;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  padding: 14px;
  color: #fffdf8;
  border: 1px solid rgba(215, 164, 67, 0.42);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(18, 16, 13, 0.96), rgba(74, 30, 18, 0.94));
  box-shadow: 0 20px 46px rgba(18, 16, 13, 0.28);
}

.install-prompt div:first-child {
  display: grid;
  gap: 3px;
}

.install-prompt span,
.install-prompt p {
  margin: 0;
  color: rgba(255, 253, 248, 0.76);
  font-size: 0.9rem;
  font-weight: 750;
}

.install-actions {
  display: flex;
  gap: 8px;
}

.install-actions button {
  min-height: 38px;
  flex: 1;
  border: 1px solid rgba(255, 253, 248, 0.18);
  border-radius: 7px;
  font-weight: 900;
}

#installAppButton {
  color: #5f0804;
  background: linear-gradient(135deg, #ffe18a, #f3b72c);
}

#dismissInstall {
  color: #fffdf8;
  background: rgba(255, 253, 248, 0.1);
}

[hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .product-grid,
  .legal-grid,
  .admin-panel,
  .order-manager,
  .security-grid,
  .lucky-inner,
  .footer-main {
    grid-template-columns: 1fr;
  }

  .lucky-copy {
    max-width: none;
  }
}

@media (max-width: 680px) {
  .site-header {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 14px;
  }

  .brand {
    gap: 8px;
  }

  .main-nav {
    display: none;
  }

  .site-notice {
    display: grid;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .brand-text strong {
    display: grid;
    max-width: 96px;
    font-size: 0.68rem;
  }

  .brand-word {
    display: block;
  }

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

  .lang-switch button {
    min-width: 42px;
    padding-inline: 8px;
  }

  .cart-button {
    padding-inline: 10px;
  }

  .cart-button span:first-child {
    display: none;
  }

  .hero {
    min-height: 430px;
    align-items: flex-end;
    justify-content: center;
    padding: 260px 16px 26px;
    background:
      linear-gradient(180deg, rgba(6, 4, 2, 0) 0%, rgba(6, 4, 2, 0.16) 42%, rgba(6, 4, 2, 0.96) 72%),
      url("/assets/hero-fopai-cover.jpg") top center / contain no-repeat,
      #080604;
  }

  .hero-content {
    justify-content: center;
  }

  .hero-tags {
    gap: 8px;
  }

  .hero-tags span {
    font-size: 0.78rem;
  }

  .hero-actions .button {
    flex: 1 1 150px;
  }

  .lucky-section {
    padding-block: 44px;
  }

  .lucky-inner {
    gap: 18px;
  }

  .lucky-copy {
    text-align: center;
    justify-items: center;
  }

  .lucky-board-copy {
    top: 41%;
    left: 16%;
    right: 16%;
  }

  .lucky-board-copy p {
    font-size: clamp(0.86rem, 3.8vw, 1.2rem);
    letter-spacing: 0.08em;
  }

  .lucky-board-copy h3 {
    font-size: clamp(1.08rem, 6vw, 1.8rem);
  }

  .lucky-number span {
    border-radius: 6px;
    font-size: clamp(1.45rem, 8vw, 2.8rem);
  }

  .lucky-section .button-primary {
    width: 100%;
  }

  .section {
    padding-inline: 16px;
  }

  .product-grid,
  .legal-grid,
  .form-grid,
  .checkout-form,
  .detail-grid,
  .order-update-form {
    grid-template-columns: 1fr;
  }

  .order-filters {
    grid-template-columns: 1fr;
  }

  .compact-form .button {
    width: 100%;
  }

  .order-line-detail {
    grid-template-columns: 1fr;
  }

  .order-total-detail {
    justify-content: flex-start;
  }

  .span-2,
  .checkout-form label:nth-child(4),
  .checkout-form label:nth-child(6),
  .checkout-consent,
  .checkout-button {
    grid-column: auto;
  }

  .product-title-row {
    display: grid;
  }

  .admin-login {
    display: grid;
  }

  .cart-drawer {
    padding: 16px;
  }

  .site-footer {
    display: grid;
  }

  .footer-company {
    display: grid;
  }

  .footer-seal {
    width: 78px;
    height: 78px;
  }

  .company-reg {
    font-size: 0.88rem;
  }

  .footer-whatsapp {
    width: 100%;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .floating-whatsapp {
    right: 12px;
    bottom: 12px;
    min-height: 44px;
    padding-inline: 14px;
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .brand-text strong {
    max-width: 210px;
    font-size: 0.82rem;
  }

  .header-actions {
    justify-content: flex-start;
  }
}
