:root {
  --greige: #e4ddd3;
  --wall: #ebe5db;
  --charcoal: #2a2724;
  --charcoal-soft: #3a3531;
  --slate: #6f675f;
  --linen: #f7f3ec;
  --terracotta: #c45a32;
  --terracotta-hot: #d4683c;
  --terracotta-deep: #a34828;
  --sand: #cfc5b8;
  --taupe: #8a8178;
  --brown: var(--charcoal);

  --accent: var(--terracotta);
  --page-bg: var(--wall);
  --surface: var(--linen);
  --text: var(--charcoal);
  --muted: var(--slate);
  --radius: 26px;
  --container: 1120px;
  --font-sans: "Plus Jakarta Sans", "Segoe UI", ui-sans-serif, sans-serif;
  --font-display: "Syne", "Plus Jakarta Sans", ui-sans-serif, sans-serif;
  --puff:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 6px rgba(42, 39, 36, 0.1),
    0 22px 50px rgba(42, 39, 36, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--page-bg);
}

body {
  background:
    radial-gradient(900px 480px at 10% -8%, rgba(196, 90, 50, 0.12), transparent 55%),
    radial-gradient(720px 420px at 90% 0%, rgba(42, 39, 36, 0.07), transparent 50%),
    linear-gradient(180deg, #efe9df 0%, var(--wall) 45%, #e5ddd2 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.sf-aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sf-island {
  position: absolute;
  border-radius: 34px;
  box-shadow: var(--puff);
  animation: sf-drift 18s ease-in-out infinite;
}

.sf-island-a {
  width: 110px;
  height: 110px;
  left: 8%;
  top: 16%;
  background: linear-gradient(160deg, #f0ebe3, #d8d0c4);
  opacity: 0.8;
}

.sf-island-b {
  width: 96px;
  height: 96px;
  right: 12%;
  top: 30%;
  background: linear-gradient(160deg, #3a3531, #1f1c1a);
  opacity: 0.75;
  animation-delay: -6s;
}

.sf-island-c {
  width: 120px;
  height: 120px;
  left: 40%;
  bottom: 12%;
  background: linear-gradient(160deg, #d4683c, #a34828);
  opacity: 0.7;
  animation-delay: -11s;
  animation-duration: 24s;
}

@keyframes sf-drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-2deg); }
  50% { transform: translate3d(14px, -16px, 0) rotate(3deg); }
}

#app {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 18px 90px;
}

.loading {
  min-height: 60vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

header {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 12px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(58, 53, 49, 0.96), rgba(42, 39, 36, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--puff);
  color: #f3ebe1;
  animation: sf-in 0.55s ease both;
}

@keyframes sf-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

header b,
.shop-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  font-weight: 750;
  color: #f3ebe1;
}

.shop-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
}

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

.header-actions button,
.hero button,
.product button,
.submit-order,
#finish-order,
#checkout {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: linear-gradient(145deg, var(--terracotta-hot), var(--terracotta-deep));
  color: #fff8f2;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(196, 90, 50, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.header-actions button {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.header-actions button:hover,
.hero button:hover,
.product button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

body.card-bordered .product {
  border: 1px solid rgba(42, 39, 36, 0.14);
  box-shadow: none;
  background: var(--surface);
}
body.card-flat .product {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}
body.card-soft .product { box-shadow: var(--puff); }

body.button-outline .hero button,
body.button-outline .product button,
body.button-outline .submit-order {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}

body.button-pill .hero button,
body.button-pill .product button,
body.button-pill .submit-order,
body.button-pill .header-actions button {
  border-radius: 999px;
}

body.header-minimal header {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  top: 0;
  color: var(--text);
}
body.header-minimal header b,
body.header-minimal .shop-logo { color: var(--text); }
body.header-minimal .header-actions button {
  background: var(--charcoal);
  color: #fff;
}

body.header-solid header {
  background: var(--charcoal);
}

body.header-glass header {
  background: linear-gradient(180deg, rgba(58, 53, 49, 0.92), rgba(42, 39, 36, 0.96));
  backdrop-filter: blur(18px);
}

main {
  display: grid;
  gap: 28px;
  margin-top: 28px;
}

.hero {
  min-height: min(74vh, 580px);
  padding: clamp(36px, 7vw, 72px);
  border-radius: 36px;
  background:
    linear-gradient(145deg, rgba(42, 39, 36, 0.9), rgba(58, 53, 49, 0.78)),
    radial-gradient(circle at 82% 18%, rgba(196, 90, 50, 0.38), transparent 42%),
    linear-gradient(180deg, #3a3531, #2a2724);
  color: #f6efe6;
  box-shadow: var(--puff);
  animation: sf-in 0.7s ease both;
  display: grid;
  align-content: end;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: 8%;
  top: 14%;
  border-radius: 40px;
  background: linear-gradient(160deg, #d4683c, #a34828);
  box-shadow: var(--puff);
  opacity: 0.85;
  animation: sf-drift 14s ease-in-out infinite;
}

.hero > div { position: relative; z-index: 1; }

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}
.hero.banner .hero-media img { opacity: 0.55; }

.hero small {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #e4ddd3;
  font-size: 11px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 0.98;
  max-width: 11ch;
  letter-spacing: -0.04em;
  font-weight: 750;
}

.hero p {
  margin: 0;
  max-width: 34ch;
  color: rgba(246, 239, 230, 0.78);
  line-height: 1.55;
}

.hero button,
.hero-cta {
  width: fit-content;
  margin-top: 8px;
  text-decoration: none;
  display: inline-flex;
}

section h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
}

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

.categories button {
  border: 1px solid rgba(42, 39, 36, 0.08);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 24px rgba(42, 39, 36, 0.05);
}

.categories button.active,
.categories button:hover {
  background: var(--charcoal);
  color: #f3ebe1;
  border-color: transparent;
}

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

#catalog-search {
  border: 1px solid rgba(42, 39, 36, 0.08);
  background: var(--surface);
  border-radius: 999px;
  padding: 11px 16px;
  min-width: min(280px, 100%);
  outline: 0;
}

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

.grid.mode-list { grid-template-columns: 1fr; }
.grid.mode-compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

.product {
  background: var(--surface);
  border: 1px solid rgba(42, 39, 36, 0.06);
  border-radius: 28px;
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: var(--puff);
  animation: sf-in 0.55s ease both;
}

.product img,
.product .image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  background: linear-gradient(160deg, #e4ddd3, #d5cdc1);
  display: grid;
  place-items: center;
  color: var(--taupe);
}

.product h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.product p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.product select {
  border: 1px solid rgba(42, 39, 36, 0.08);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
}

.features {
  padding: 8px 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.feature-grid article {
  background: var(--surface);
  border-radius: 24px;
  padding: 22px;
  border: 1px solid rgba(42, 39, 36, 0.06);
  box-shadow: var(--puff);
  font-family: var(--font-display);
  font-weight: 650;
}

.text {
  background: var(--charcoal);
  color: #f3ebe1;
  border-radius: 32px;
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--puff);
}

.text h2 { color: #fff; }
.text p { color: rgba(243, 235, 225, 0.72); max-width: 48ch; }

.cart-drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(380px, calc(100vw - 24px));
  background: linear-gradient(180deg, #3a3531, #2a2724);
  color: #f3ebe1;
  border-radius: 32px;
  box-shadow: var(--puff);
  transform: translateX(110%);
  transition: transform 0.28s ease;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.cart-drawer.open { transform: none; }

.cart-drawer > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-drawer h2 {
  margin: 0;
  font-family: var(--font-display);
}

.cart-drawer section {
  padding: 16px 22px;
  overflow: auto;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-line small { color: rgba(243, 235, 225, 0.55); }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button,
.remove,
#close {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.cart-drawer footer {
  padding: 18px 22px 22px;
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.empty-cart { color: rgba(243, 235, 225, 0.55); padding: 24px 0; }

#modal { position: relative; z-index: 30; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 39, 36, 0.45);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: auto;
}

.checkout-card,
.success-card,
.profile-card {
  width: min(920px, 100%);
  background: var(--linen);
  border-radius: 32px;
  padding: 24px;
  box-shadow: var(--puff);
  border: 1px solid rgba(42, 39, 36, 0.06);
}

.checkout-head,
.success-card {
  position: relative;
}

.checkout-head h2,
.success-card h2 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}

.checkout-card label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.checkout-card input,
.checkout-card textarea,
.checkout-card select {
  border: 1px solid rgba(42, 39, 36, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}

.option {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(42, 39, 36, 0.08);
  border-radius: 16px;
  margin-bottom: 8px !important;
  background: color-mix(in srgb, var(--greige) 45%, white);
}

.option input { width: auto; }

.pvz-map {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 12px;
}
.pvz-pin {
  text-align: left;
  border: 1px solid rgba(42, 39, 36, 0.1);
  background: #fff;
  border-radius: 16px;
  padding: 10px 12px;
  cursor: pointer;
}
.pvz-pin.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.pvz-pin b { display: block; }
.pvz-pin small { color: var(--muted); }

.order-summary {
  padding: 18px;
  border-radius: 24px;
  background: var(--charcoal);
  color: #f3ebe1;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 18px;
}

.order-summary p,
.order-summary .grand {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
}

.order-summary .grand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-top: 14px;
}

.success-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--terracotta-hot), var(--terracotta-deep));
  color: #fff;
  font-size: 24px;
  margin-bottom: 12px;
  box-shadow: var(--puff);
}

.portal-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.portal-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--greige) 55%, white);
  cursor: pointer;
}

.portal-tabs button.active {
  background: var(--accent);
  color: #fff;
}

.loyalty-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(196, 90, 50, 0.18), rgba(42, 39, 36, 0.06));
  margin-bottom: 12px;
}

.loyalty-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
}

.profile-orders article {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(42, 39, 36, 0.08);
}

.error {
  max-width: 28rem;
  margin: 20vh auto;
  padding: 1.5rem;
  text-align: center;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--puff);
}

@media (max-width: 820px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero::after { display: none; }
  .sf-island { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .sf-island, .hero::after { animation: none !important; }
}
