:root {
  --chocolate: #2a1711;
  --chocolate-soft: #4a2b20;
  --gold: #b9852d;
  --gold-dark: #8e641f;
  --cream: #f6efe3;
  --paper: #fff;
  --surface: #fbfaf8;
  --line: #e4d8ca;
  --ink: #292522;
  --muted: #736a64;
  --whatsapp: #168c53;
  --danger: #a2382d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}
button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgb(185 133 45 / 32%);
  outline-offset: 2px;
}

.store-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(10px);
}
.header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: min(1440px, 100%);
  min-height: 76px;
  margin: 0 auto;
  padding: 10px 24px;
  gap: 24px;
}
.brand, .footer-brand { display: flex; align-items: center; gap: 10px; color: var(--chocolate); text-decoration: none; }
.brand img { width: 54px; height: 54px; object-fit: contain; }
.brand span, .footer-brand span { display: flex; flex-direction: column; }
.brand strong, .footer-brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.brand small, .footer-brand small { margin-top: 3px; color: var(--gold-dark); font-size: 9px; font-weight: 800; }
.search-box {
  display: flex;
  align-items: center;
  width: min(640px, 100%);
  height: 44px;
  margin: 0 auto;
  padding: 0 14px;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.search-box svg { width: 19px; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.cart-trigger, .profile-trigger, .mobile-cart, .whatsapp-button, .add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-weight: 800;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.profile-trigger { width: 44px; height: 44px; border: 1px solid var(--line); background: #fff; color: var(--chocolate); }
.profile-trigger:hover { border-color: var(--gold); background: var(--cream); }
.profile-trigger svg { width: 19px; }
.cart-trigger { height: 44px; padding: 0 14px; gap: 8px; background: var(--chocolate); color: #fff; }
.cart-trigger svg { width: 19px; }
.cart-trigger strong { display: grid; min-width: 22px; height: 22px; place-items: center; background: var(--gold); font-size: 12px; }
.category-nav {
  display: flex;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 24px 10px;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.category-nav button {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.category-nav button:hover { color: var(--chocolate); background: var(--cream); }
.category-nav button.active { border-color: var(--gold); background: var(--cream); color: var(--chocolate); }

.store-main { width: min(1440px, 100%); min-height: 70vh; margin: 0 auto; padding: 32px 24px 72px; }
.catalog-toolbar { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; gap: 20px; }
.catalog-toolbar h1 { margin: 0; color: var(--chocolate); font-family: Georgia, "Times New Roman", serif; font-size: 28px; }
.catalog-toolbar p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.sort-control { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; font-weight: 800; }
.sort-control select { height: 38px; padding: 0 34px 0 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.product-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.store-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 3px 12px rgb(42 23 17 / 5%);
}
.store-card:hover { border-color: #cdbb9f; box-shadow: 0 7px 20px rgb(42 23 17 / 10%); }
.card-image {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1.2;
  place-items: center;
  border: 0;
  border-bottom: 1px solid #eee8e2;
  background: #fff;
}
.card-image img { width: 86%; height: 86%; object-fit: contain; }
.card-image .view-icon {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  color: var(--chocolate);
  opacity: 0;
}
.store-card:hover .view-icon, .card-image:focus-visible .view-icon { opacity: 1; }
.view-icon svg { width: 16px; }
.card-body { display: flex; min-height: 168px; flex: 1; flex-direction: column; padding: 13px; }
.card-category { margin-bottom: 7px; color: var(--gold-dark); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.card-body h2 {
  min-height: 40px;
  margin: 0;
  color: var(--chocolate);
  font-size: 13px;
  line-height: 1.28;
  text-transform: uppercase;
}
.card-meta { display: flex; margin: 8px 0 14px; gap: 10px; color: var(--muted); font-size: 10px; }
.card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-footer { display: flex; align-items: end; justify-content: space-between; margin-top: auto; gap: 10px; }
.card-price { color: var(--chocolate); font-size: 18px; font-weight: 850; white-space: nowrap; }
.card-price small { font-size: 10px; }
.add-button { width: 38px; height: 38px; flex: 0 0 38px; background: var(--gold); color: #fff; }
.add-button:hover { background: var(--gold-dark); }
.add-button svg { width: 18px; }
.empty-state { display: grid; min-height: 340px; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-state svg { width: 36px; height: 36px; margin-bottom: 14px; }
.empty-state span { margin-top: 6px; font-size: 13px; }

.store-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  padding: 26px max(24px, calc((100vw - 1392px) / 2));
  gap: 32px;
  border-top: 1px solid var(--line);
  background: var(--cream);
  color: var(--chocolate);
}
.footer-brand img { width: 48px; height: 48px; object-fit: contain; }
.store-footer > div:not(.footer-brand) { display: flex; flex-direction: column; font-size: 11px; }
.store-footer a { margin-top: 5px; color: var(--chocolate); font-size: 15px; font-weight: 800; text-decoration: none; }
.store-footer p { margin: 0; color: var(--muted); font-size: 11px; }
.mobile-cart { display: none; }

dialog { padding: 0; border: 0; background: #fff; color: var(--ink); box-shadow: 0 20px 70px rgb(0 0 0 / 28%); }
dialog::backdrop { background: rgb(25 17 13 / 55%); backdrop-filter: blur(2px); }
.welcome-splash { position: fixed; z-index: 80; inset: 0; display: grid; place-content: center; justify-items: center; background: #fff; color: var(--chocolate); transition: opacity 400ms ease, transform 400ms ease; }
.welcome-splash[hidden] { display: none; }
.welcome-splash img { width: 150px; height: 150px; object-fit: contain; animation: logo-arrival 900ms cubic-bezier(.2,.8,.2,1) both; }
.welcome-splash strong { margin-top: 12px; font-family: Georgia, "Times New Roman", serif; font-size: 22px; animation: logo-copy 900ms 180ms ease both; }
.welcome-splash.leaving { opacity: 0; transform: translateY(-18px); }
@keyframes logo-arrival { from { opacity: 0; transform: scale(.72) translateY(22px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes logo-copy { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.profile-dialog { width: min(680px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: hidden; border-radius: 6px; }
.choice-dialog { width: min(460px, calc(100% - 28px)); border-radius: 6px; }
.choice-content { display: flex; align-items: center; flex-direction: column; padding: 28px; text-align: center; }
.choice-content > img { width: 82px; height: 82px; margin-bottom: 8px; object-fit: contain; }
.choice-main-icon { width: 42px; height: 42px; margin: 4px 0 18px; color: var(--gold-dark); }
.choice-content > span { color: var(--gold-dark); font-size: 9px; font-weight: 800; }
.choice-content h2 { margin: 8px 0 0; color: var(--chocolate); font-family: Georgia, "Times New Roman", serif; font-size: 23px; line-height: 1.2; }
.choice-content p { max-width: 350px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.choice-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-top: 24px; gap: 8px; }
.choice-actions button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 8px 12px; gap: 8px; border: 1px solid var(--chocolate); background: var(--chocolate); color: #fff; font-size: 10px; font-weight: 800; }
.choice-actions button svg { width: 17px; }
.choice-actions .secondary-choice { border-color: var(--line); background: #fff; color: var(--chocolate); }
.profile-dialog[open] form { display: flex; max-height: calc(100vh - 28px); flex-direction: column; }
.profile-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line); }
.profile-header > div { display: flex; flex-direction: column; gap: 4px; }
.profile-header span { color: var(--gold-dark); font-size: 9px; font-weight: 800; }
.profile-header h2 { margin: 0; color: var(--chocolate); font-family: Georgia, "Times New Roman", serif; font-size: 22px; }
.profile-content { display: grid; grid-template-columns: 1fr 1fr; padding: 22px; gap: 14px; overflow-y: auto; }
.profile-content > label { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.profile-content label > span { color: var(--muted); font-size: 9px; font-weight: 800; }
.profile-content input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.profile-wide { grid-column: 1 / -1; }
.location-box { display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 10px; gap: 10px; border: 1px solid var(--line); background: var(--surface); }
.location-box button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 14px; gap: 8px; border: 0; background: var(--chocolate); color: #fff; font-size: 10px; font-weight: 800; }
.location-box button:disabled { opacity: .55; cursor: wait; }
.location-box button svg { width: 17px; }
.location-box small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.location-box a { color: var(--muted); font-size: 8px; white-space: nowrap; }
.cep-control { display: grid !important; grid-template-columns: 1fr 42px; border: 1px solid var(--line); }
.cep-control input { border: 0; }
.cep-control button { display: grid; place-items: center; border: 0; border-left: 1px solid var(--line); background: var(--cream); color: var(--chocolate); }
.cep-control button svg { width: 17px; }
#cep-status { min-height: 12px; color: var(--gold-dark); font-size: 9px; }
.profile-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; gap: 18px; border-top: 1px solid var(--line); background: var(--surface); }
.profile-footer > span { color: var(--muted); font-size: 10px; }
.save-profile-button { display: inline-flex; height: 44px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0 18px; gap: 8px; border: 0; background: var(--chocolate); color: #fff; font-size: 10px; font-weight: 800; }
.save-profile-button svg { width: 17px; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; background: transparent; color: var(--chocolate); }
.icon-button:hover { background: var(--cream); }
.icon-button svg { width: 20px; }
.detail-dialog { width: min(760px, calc(100% - 28px)); border-radius: 6px; }
.dialog-close { position: absolute; z-index: 2; top: 10px; right: 10px; background: #fff; }
.add-dialog { width: min(460px, calc(100% - 28px)); border-radius: 6px; }
.add-dialog-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line); }
.add-dialog-header > div { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.add-dialog-header span, .add-dialog-footer span { color: var(--gold-dark); font-size: 9px; font-weight: 800; }
.add-dialog-header strong { overflow: hidden; color: var(--chocolate); font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.2; text-overflow: ellipsis; }
.add-dialog-body { display: grid; grid-template-columns: 116px 1fr; align-items: center; padding: 22px 20px; gap: 20px; }
.add-dialog-body > img { width: 116px; height: 116px; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.add-dialog-info { display: flex; min-width: 0; flex-direction: column; }
.add-dialog-info > span { margin-bottom: 18px; color: var(--muted); font-size: 11px; font-weight: 700; }
.add-dialog-info label { margin-bottom: 7px; color: var(--chocolate); font-size: 9px; font-weight: 800; }
.add-quantity-control { display: grid; grid-template-columns: 42px minmax(62px, 1fr) 42px; height: 44px; border: 1px solid var(--line); }
.add-quantity-control button { display: grid; place-items: center; border: 0; background: var(--cream); color: var(--chocolate); }
.add-quantity-control button:hover { background: #eadcc8; }
.add-quantity-control button svg { width: 18px; }
.add-quantity-control input { min-width: 0; border: 0; border-right: 1px solid var(--line); border-left: 1px solid var(--line); outline: 0; color: var(--chocolate); font-size: 15px; font-weight: 800; text-align: center; }
.add-quantity-control input::-webkit-inner-spin-button { appearance: none; }
.add-dialog-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; gap: 16px; border-top: 1px solid var(--line); background: var(--surface); }
.add-dialog-footer > div { display: flex; flex-direction: column; gap: 4px; }
.add-dialog-footer strong { color: var(--chocolate); font-size: 20px; }
.confirm-add-button { display: inline-flex; height: 44px; align-items: center; justify-content: center; padding: 0 17px; gap: 8px; border: 0; background: var(--chocolate); color: #fff; font-size: 10px; font-weight: 800; }
.confirm-add-button:hover { background: #44271d; }
.confirm-add-button svg { width: 17px; }
.detail-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 430px; }
.detail-image { display: grid; min-height: 360px; place-items: center; border-right: 1px solid var(--line); background: var(--surface); }
.detail-image img { width: 88%; height: 88%; object-fit: contain; }
.detail-copy { display: flex; flex-direction: column; padding: 52px 30px 30px; }
.detail-copy .card-category { font-size: 10px; }
.detail-copy h2 { margin: 5px 0 18px; color: var(--chocolate); font-size: 22px; line-height: 1.2; text-transform: uppercase; }
.detail-data { display: grid; grid-template-columns: auto 1fr; margin: 0; gap: 8px 15px; font-size: 12px; }
.detail-data dt { color: var(--muted); font-weight: 700; }
.detail-data dd { margin: 0; color: var(--ink); }
.detail-price { margin: auto 0 18px; color: var(--chocolate); font-size: 27px; font-weight: 850; }
.detail-add { width: 100%; height: 46px; gap: 9px; background: var(--gold); color: #fff; }

.cart-dialog { width: min(480px, 100%); height: 100%; max-height: 100%; margin: 0 0 0 auto; }
.cart-dialog[open] { display: flex; flex-direction: column; }
.cart-header { display: flex; min-height: 72px; align-items: center; justify-content: space-between; padding: 0 18px 0 22px; border-bottom: 1px solid var(--line); }
.cart-header > div { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 10px; }
.cart-header strong { color: var(--chocolate); font-size: 16px; }
.cart-items { overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: 68px 1fr auto; padding: 16px 18px; gap: 12px; border-bottom: 1px solid var(--line); }
.cart-line img { width: 68px; height: 68px; object-fit: contain; border: 1px solid #eee8e2; }
.cart-line-copy { min-width: 0; }
.cart-line h3 { margin: 0 0 7px; color: var(--chocolate); font-size: 12px; line-height: 1.25; text-transform: uppercase; }
.cart-line-price { color: var(--muted); font-size: 11px; }
.quantity-control { display: inline-grid; grid-template-columns: 30px 34px 30px; height: 30px; margin-top: 10px; border: 1px solid var(--line); }
.quantity-control button { display: grid; place-items: center; border: 0; background: var(--surface); color: var(--chocolate); }
.quantity-control span { display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.cart-line-total { display: flex; align-items: end; flex-direction: column; justify-content: space-between; white-space: nowrap; }
.cart-line-total strong { color: var(--chocolate); font-size: 13px; }
.remove-line { width: 30px; height: 30px; color: var(--danger); }
.cart-empty { display: grid; flex: 1; place-content: center; justify-items: center; color: var(--muted); }
.cart-empty svg { width: 42px; height: 42px; margin-bottom: 13px; }
.cart-empty strong { font-size: 12px; }
.cart-checkout { margin-top: auto; padding: 20px 22px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.cart-total { display: flex; align-items: center; justify-content: space-between; color: var(--chocolate); }
.cart-total span { font-size: 12px; font-weight: 800; }
.cart-total strong { font-size: 24px; }
.checkout-profile { display: grid; grid-template-columns: auto 1fr auto; width: 100%; align-items: center; margin: 18px 0 10px; padding: 11px; gap: 10px; border: 1px solid var(--line); background: #fff; color: var(--chocolate); text-align: left; }
.checkout-profile > svg { width: 18px; }
.checkout-profile > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.checkout-profile small { color: var(--gold-dark); font-size: 8px; font-style: normal; font-weight: 800; }
.checkout-profile strong { font-size: 11px; }
.checkout-profile em { overflow: hidden; color: var(--muted); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.payment-method { display: flex; flex-direction: column; margin-bottom: 12px; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 800; }
.payment-method select { width: 100%; height: 43px; padding: 0 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.whatsapp-button { width: 100%; height: 48px; gap: 9px; background: var(--whatsapp); color: #fff; }
.whatsapp-button:hover { background: #117243; }
.whatsapp-button svg { width: 20px; }
.toast { position: fixed; z-index: 50; right: 20px; bottom: 20px; max-width: 360px; padding: 13px 16px; background: var(--chocolate); color: #fff; font-size: 12px; opacity: 0; transform: translateY(15px); pointer-events: none; transition: 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .header-main { grid-template-columns: 1fr auto; gap: 12px; }
  .search-box { grid-column: 1 / -1; grid-row: 2; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .store-footer { grid-template-columns: 1fr auto; }
  .store-footer p { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { padding-bottom: 68px; }
  .header-main { min-height: 64px; padding: 8px 14px; }
  .brand img { width: 44px; height: 44px; }
  .brand strong { font-size: 15px; }
  .brand small { font-size: 8px; }
  .cart-trigger { width: 42px; padding: 0; }
  .cart-trigger span, .cart-trigger strong { display: none; }
  .search-box { height: 42px; }
  .category-nav { padding: 0 14px 8px; }
  .store-main { padding: 22px 12px 50px; }
  .catalog-toolbar { align-items: start; }
  .catalog-toolbar h1 { font-size: 23px; }
  .sort-control span { display: none; }
  .sort-control select { width: 118px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card-body { min-height: 157px; padding: 10px; }
  .card-body h2 { min-height: 49px; font-size: 11px; }
  .card-meta { flex-direction: column; margin: 6px 0 11px; gap: 3px; }
  .card-price { font-size: 15px; }
  .add-button { width: 36px; height: 36px; flex-basis: 36px; }
  .store-footer { display: flex; align-items: flex-start; flex-direction: column; padding: 24px 18px; gap: 18px; }
  .mobile-cart { position: fixed; z-index: 18; right: 10px; bottom: 10px; left: 10px; display: flex; height: 50px; padding: 0 17px; gap: 9px; background: var(--chocolate); color: #fff; box-shadow: 0 7px 24px rgb(0 0 0 / 25%); }
  .mobile-cart strong { margin-left: auto; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-image { min-height: 245px; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-copy { min-height: 330px; padding: 25px 20px 20px; }
  .detail-copy h2 { font-size: 18px; }
  .cart-dialog { width: 100%; }
  .add-dialog { width: calc(100% - 24px); }
  .add-dialog-body { grid-template-columns: 92px 1fr; padding: 18px; gap: 15px; }
  .add-dialog-body > img { width: 92px; height: 92px; }
  .add-dialog-footer { padding: 14px 18px; }
  .header-actions { gap: 6px; }
  .profile-trigger { width: 42px; height: 42px; }
  .profile-dialog { width: calc(100% - 20px); max-height: calc(100% - 20px); }
  .choice-dialog { width: calc(100% - 24px); }
  .choice-content { padding: 24px 18px; }
  .choice-content h2 { font-size: 21px; }
  .profile-dialog[open] form { max-height: calc(100vh - 20px); }
  .profile-content { grid-template-columns: 1fr; padding: 17px; gap: 11px; }
  .profile-wide, .customer-status { grid-column: auto; }
  .profile-footer { align-items: stretch; flex-direction: column; padding: 14px 17px 17px; gap: 10px; }
  .save-profile-button { width: 100%; }
  .location-box { grid-template-columns: 1fr; }
  .location-box a { justify-self: end; }
}
