:root {
  --cream: #fff8f2;
  --paper: #fffdf9;
  --coral: #df6d78;
  --coral-dark: #c75161;
  --coral-soft: #f6d7d5;
  --brown: #39271d;
  --brown-soft: #786256;
  --line: rgba(57, 39, 29, 0.11);
  --green: #318b68;
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 90% 0%, rgba(223,109,120,.1), transparent 20rem), var(--cream);
  color: var(--brown);
  font-family: "Avenir Next", "Trebuchet MS", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.has-cart { padding-bottom: 104px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.catalog-header {
  width: min(1040px, calc(100% - 28px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.catalog-logo { width: 43px; height: 43px; position: relative; overflow: hidden; border-radius: 50%; background: #fff9f4; }
.catalog-logo img { position: absolute; width: 94px; max-width: none; left: -1px; top: -1px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(49,139,104,.16); border-radius: 999px; color: var(--green); background: rgba(255,255,255,.72); font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.live-pill > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(49,139,104,.1); }
.live-pill--offline { color: var(--brown-soft); border-color: var(--line); }

main { width: min(1040px, calc(100% - 28px)); margin: 0 auto; }
.loading-state, .error-state { min-height: calc(100vh - 160px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.loading-heart, .error-heart { color: var(--coral); font-family: Georgia, serif; font-size: 64px; line-height: 1; animation: pulse 1.5s ease-in-out infinite; }
.loading-state p { color: var(--brown-soft); font-family: Georgia, serif; }
.error-state { max-width: 520px; margin: 0 auto; }
.error-state h1 { margin: 6px 0 16px; font-family: Georgia, serif; font-size: clamp(38px, 10vw, 60px); line-height: 1; font-weight: 400; letter-spacing: -.04em; }
.error-state > p:not(.eyebrow) { margin: 0; color: var(--brown-soft); font-family: Georgia, serif; font-size: 16px; line-height: 1.6; }
.error-state > a { margin-top: 24px; padding: 13px 18px; border-radius: 999px; background: var(--coral); color: white; font-size: 12px; font-weight: 800; }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .55; } }

.catalog-intro { padding: 24px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.eyebrow { margin: 0 0 5px; color: var(--coral-dark); font-size: 8px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.catalog-intro h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(32px, 9vw, 50px); font-weight: 400; line-height: 1; letter-spacing: -.035em; }
.intro-help { margin: 8px 0 0; color: var(--brown-soft); font-size: 12px; }
.intro-help strong { color: var(--coral-dark); }
.catalog-divider { height: 40px; display: flex; align-items: center; justify-content: space-between; color: var(--brown-soft); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.catalog-divider i { color: var(--coral); font-style: normal; }
.promotions-section { margin: 0 0 10px; }
.promotions-heading { display: none; }
.promotions-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.promotion-card { min-height: 62px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; overflow: hidden; border: 1px solid rgba(223,109,120,.25); border-radius: 16px; background: linear-gradient(135deg, rgba(246,215,213,.7), rgba(255,255,255,.9)); }
.promotion-badge { padding: 5px 7px; border-radius: 999px; background: var(--coral); color: white; font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.promotion-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.promotion-name { color: var(--brown); font-family: Georgia, serif; font-size: 17px; font-weight: 400; line-height: 1; }
.promotion-detail { overflow: hidden; color: var(--brown-soft); font-size: 9px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.promotion-heart { display: none; }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.product-card { min-width: 0; min-height: 158px; padding: 12px; display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: 70px auto; grid-template-areas: "visual info" "control control"; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.8); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.product-card--selected { border-color: rgba(223,109,120,.55); box-shadow: 0 8px 22px rgba(106,62,39,.08); transform: translateY(-1px); }
.product-card--sold-out { order: 2; opacity: .52; }
.product-visual { grid-area: visual; width: 56px; height: 68px; position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 45% 55% 56% 44% / 37% 42% 58% 63%; background: color-mix(in srgb, var(--product-color) 70%, white); box-shadow: inset -8px -10px 16px rgba(57,39,29,.06); transform: rotate(-3deg); }
.product-visual::before { content: ""; width: 12px; height: 5px; position: absolute; top: 14px; left: 12px; border-radius: 50%; background: rgba(255,255,255,.65); transform: rotate(-28deg); }
.product-emoji { font-size: 27px; filter: drop-shadow(0 4px 4px rgba(57,39,29,.11)); transform: rotate(3deg); }
.product-info { grid-area: info; min-width: 0; align-self: center; }
.product-name { margin: 0 0 6px; overflow-wrap: anywhere; font-family: Georgia, serif; font-size: 18px; font-weight: 400; line-height: 1.05; }
.stock-badge { display: block; color: var(--green); font-size: 10px; font-weight: 800; line-height: 1.2; }
.stock-badge--empty { color: var(--coral-dark); }
.product-price { margin: 4px 0 0; color: var(--coral-dark); font-size: 12px; font-weight: 850; line-height: 1.2; }
.quantity-control { grid-area: control; min-width: 0; height: 40px; padding: 3px; display: grid; grid-template-columns: 36px minmax(24px, 1fr) 36px; align-items: center; gap: 4px; border-radius: 14px; background: rgba(57,39,29,.045); }
.quantity-button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 11px; background: white; color: var(--brown); font-size: 21px; line-height: 1; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.quantity-button--plus { background: var(--coral); color: white; }
.quantity-button:disabled { opacity: .22; cursor: default; }
.quantity-value { min-width: 24px; text-align: center; font-size: 13px; font-weight: 900; }
.stock-note { margin: 20px auto 0; color: var(--brown-soft); text-align: center; font-size: 9px; line-height: 1.4; }
.stock-note span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--green); }
.empty-state { padding: 54px 18px; border: 1px dashed rgba(223,109,120,.35); border-radius: 22px; text-align: center; }
.empty-state > span { color: var(--coral); font-size: 48px; }
.empty-state h2 { margin: 8px 0; font-family: Georgia, serif; font-size: 27px; font-weight: 400; }
.empty-state p { margin: 0; color: var(--brown-soft); font-family: Georgia, serif; }

.cart-dock { position: fixed; z-index: 30; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); width: min(620px, calc(100% - 20px)); min-height: 70px; padding: 8px 8px 8px 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid rgba(255,255,255,.5); border-radius: 20px; background: rgba(57,39,29,.97); color: white; box-shadow: 0 15px 42px rgba(57,39,29,.26); transform: translateX(-50%); backdrop-filter: blur(16px); }
.cart-dock > div { min-width: 0; display: flex; flex-direction: column; }
.cart-dock > div span { color: rgba(255,255,255,.64); font-size: 9px; }
.cart-dock > div strong { margin-top: 1px; font-family: Georgia, serif; font-size: 22px; font-weight: 400; line-height: 1; }
.cart-dock > div small { max-width: 230px; margin-top: 2px; overflow: hidden; color: #f3b7b8; font-size: 8px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.cart-dock > #whatsapp-button { min-height: 54px; padding: 0 15px; display: inline-flex; align-items: center; gap: 9px; border: 0; border-radius: 15px; background: var(--coral); color: white; font-size: 11px; font-weight: 900; cursor: pointer; }
.cart-dock > #whatsapp-button:disabled { opacity: .65; cursor: wait; }
.cart-dock > #whatsapp-button:active { transform: scale(.98); }
.customer-button { width: fit-content; margin: 3px 0 0; padding: 0; border: 0; background: transparent; color: rgba(255,255,255,.76); font-size: 8px; text-align: left; cursor: pointer; }
.order-error { color: #ffd1d1 !important; white-space: normal !important; }

.customer-dialog { width: min(420px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 24px; background: var(--paper); color: var(--brown); box-shadow: 0 24px 80px rgba(57,39,29,.3); }
.customer-dialog::backdrop { background: rgba(57,39,29,.48); backdrop-filter: blur(4px); }
.customer-dialog form { padding: 26px 22px 20px; }
.dialog-mark { float: right; color: var(--coral); font-family: Georgia, serif; font-size: 34px; line-height: .8; }
.customer-dialog h2 { margin: 4px 0 8px; font-family: Georgia, serif; font-size: 31px; font-weight: 400; letter-spacing: -.025em; }
.customer-dialog p:not(.eyebrow) { margin: 0 0 20px; color: var(--brown-soft); font-size: 13px; line-height: 1.45; }
.customer-dialog p strong { color: var(--brown); }
.customer-dialog label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 800; }
.customer-dialog input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid rgba(57,39,29,.18); border-radius: 14px; outline: none; background: white; color: var(--brown); font: inherit; font-size: 16px; }
.customer-dialog input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(223,109,120,.12); }
.customer-phone-field { margin-top: 16px; }
.customer-phone-field small { display: block; margin-top: 6px; color: var(--brown-soft); font-size: 10px; line-height: 1.35; }
.customer-error { display: block; margin-top: 7px; color: var(--coral-dark); font-size: 10px; }
.dialog-actions { margin-top: 20px; display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; }
.dialog-actions button { min-height: 48px; border: 0; border-radius: 14px; font-weight: 850; cursor: pointer; }
.dialog-cancel { background: rgba(57,39,29,.06); color: var(--brown-soft); }
.dialog-confirm { background: var(--coral); color: white; }
.catalog-footer { width: min(1040px, calc(100% - 28px)); min-height: 76px; margin: 38px auto 0; padding: 20px 0; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--brown-soft); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.catalog-footer > span { color: var(--brown); font-family: Georgia, serif; font-size: 16px; }
.catalog-footer > span::first-letter { color: var(--coral); }
.catalog-footer strong { color: var(--brown); }

@media (max-width: 620px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-card { min-height: 150px; padding: 10px; grid-template-columns: 50px minmax(0, 1fr); grid-template-rows: 66px auto; gap: 8px; border-radius: 18px; }
  .product-visual { width: 50px; height: 62px; }
  .product-emoji { font-size: 24px; }
  .product-name { font-size: 16px; }
  .stock-badge { font-size: 9px; }
  .promotions-list { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .catalog-header, main, .catalog-footer { width: calc(100% - 20px); }
  .catalog-intro h1 { font-size: 29px; }
  .product-card { grid-template-columns: 44px minmax(0, 1fr); padding: 8px; }
  .product-visual { width: 44px; height: 58px; }
  .product-name { font-size: 15px; }
  .cart-dock > #whatsapp-button { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
