:root {
  --marfil: #fffaf4;
  --beige: #f2e5d6;
  --caoba: #502824;
  --dorado: #b18345;
  --rosa: #f4e2e2;
  --rosa-marca: #e94f83;
  --tinta: #382824;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--marfil); color: var(--tinta); font: 16px/1.55 system-ui, sans-serif; }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--dorado); outline-offset: 4px; }
.site-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px max(5vw, 20px); border-bottom: 1px solid var(--beige); background: rgb(255 250 244 / .96); backdrop-filter: blur(12px); }
.brand-link { flex: 0 0 auto; }
.logo { display: block; width: 215px; height: auto; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
nav a { padding: 9px 13px; border-radius: 999px; color: var(--caoba); text-decoration: none; font-size: .9rem; font-weight: 650; transition: background .18s ease, color .18s ease; }
nav a:hover { background: var(--beige); }
.menu-toggle { display: none; }
.install-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 15px; border: 1px solid var(--dorado); border-radius: 999px; background: var(--caoba); color: white; font: 650 .88rem system-ui, sans-serif; white-space: nowrap; cursor: pointer; box-shadow: 0 5px 14px rgb(80 40 36 / .12); transition: transform .18s ease, background .18s ease; }
.install-button:hover { background: #6a342d; transform: translateY(-1px); }
.hero { display: grid; grid-template-columns: 5fr 7fr; margin: 0 max(5vw, 20px); min-height: 440px; background: var(--beige); }
.hero-text { align-self: center; padding: clamp(24px, 5vw, 76px); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .73rem; font-weight: 700; color: var(--caoba); }
h1, h2, h3 { font: normal 1.08em/1.08 Georgia, serif; color: var(--caoba); margin: 0; }
h1 { font-size: clamp(2.65rem, 5vw, 5rem); }
.hero-text > p:not(.eyebrow) { max-width: 32ch; margin: 20px 0; }
.hero-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.button { display: inline-block; padding: 11px 19px; background: var(--caoba); color: var(--marfil); text-decoration: none; }
.button:hover { text-decoration: underline; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button-secondary { border: 1px solid var(--caoba); background: transparent; color: var(--caoba); }
.collections { margin: 44px max(5vw, 20px) 52px; }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 22px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.cards article { border-top: 2px solid var(--dorado); padding: 23px; background: var(--beige); scroll-margin-top: 90px; }
.cards article:nth-child(2n) { background: var(--rosa); }
.cards article:target { outline: 2px solid var(--caoba); outline-offset: 3px; }
.cards h3 { font-size: 1.55rem; }
.cards p { margin: 10px 0 0; }
.how-to-order { margin: 0 max(5vw, 20px) 52px; padding: clamp(24px, 5vw, 58px); border: 1px solid #ead9c5; border-radius: 18px; background: linear-gradient(135deg, #f8eee4 0%, #fffaf4 72%); scroll-margin-top: 90px; }
.how-to-order-heading { max-width: 650px; margin-bottom: 26px; }
.how-to-order-heading .eyebrow { margin: 0 0 10px; color: var(--rosa-marca); }
.how-to-order-heading h2 { margin-bottom: 10px; }
.how-to-order-heading > p:last-child { margin: 0; color: #74625a; }
.how-to-order-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.how-step { min-height: 205px; padding: 22px; border: 1px solid #efe4d7; border-radius: 13px; background: white; box-shadow: 0 8px 22px rgb(80 40 36 / .05); }
.how-step-number { display: grid; width: 38px; height: 38px; margin-bottom: 18px; place-items: center; border-radius: 50%; background: #fbe6ed; color: var(--rosa-marca); font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.how-step h3 { margin-bottom: 9px; font-size: 1.4rem; }
.how-step p { margin: 0; color: #74625a; font-size: .92rem; }
.how-order-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 23px; color: var(--caoba); font-weight: 700; text-underline-offset: 4px; }
footer { border-top: 1px solid var(--beige); padding: 18px max(5vw, 20px); color: var(--caoba); }
@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; justify-content: flex-start; gap: 8px; padding: 10px 16px; }
  .brand-link { order: 0; flex: 1 1 auto; }
  .logo { width: clamp(140px, 44vw, 190px); }
  .menu-toggle { order: 1; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 11px; border: 1px solid var(--beige); border-radius: 999px; background: white; color: var(--caoba); font: 600 .9rem system-ui, sans-serif; cursor: pointer; }
  .menu-toggle[aria-expanded="true"] { border-color: var(--dorado); background: var(--beige); }
  .menu-toggle-icon { display: grid; gap: 4px; width: 16px; }
  .menu-toggle-icon span { display: block; height: 2px; border-radius: 2px; background: currentColor; }
  .site-header > .bag-button { order: 2; margin-left: auto; }
  .site-header nav { order: 3; display: none; width: 100%; padding: 8px; border: 1px solid var(--beige); border-radius: 12px; background: white; box-shadow: 0 12px 30px rgb(80 40 36 / .08); }
  .site-header.nav-open nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-header nav a { padding: 12px; border-radius: 8px; background: var(--marfil); }
  .site-header > .install-button { order: 4; width: 100%; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-image { height: auto; aspect-ratio: 16 / 9; }
}

.hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.hero-image { object-position: center; min-width: 0; }
.cards article { padding: 0 0 23px; overflow: hidden; }
.cards article img { width: 100%; height: auto; aspect-ratio: 25 / 18; object-fit: cover; display: block; margin-bottom: 19px; }
.cards h3, .cards p { margin-inline: 23px; }
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-image { aspect-ratio: auto; }
  .how-to-order-grid { grid-template-columns: 1fr; }
  .how-step { min-height: 0; }
}

.logo { width: clamp(170px, 20vw, 235px); }
.category-link { display: inline-block; margin: 14px 23px 0; color: var(--caoba); font-weight: 650; text-underline-offset: 4px; }
.catalog { margin: 52px max(5vw, 20px); padding-top: 30px; border-top: 1px solid var(--beige); scroll-margin-top: 90px; }
.catalog h2 { margin-bottom: 8px; }
.catalog-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 270px); align-items: end; gap: 16px; max-width: 900px; margin: 16px 0 14px; }
.catalog-search { display: block; margin: 0 0 6px; color: var(--caoba); font-weight: 650; }
.catalog-sort-group label { display: block; margin-bottom: 6px; color: var(--caoba); font-weight: 650; }
.search-input, .sort-select { display: block; width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid #c7b29b; border-radius: 7px; background: white; color: var(--tinta); font: inherit; }
.sort-select { cursor: pointer; }
.search-input:focus-visible { outline: 3px solid var(--dorado); outline-offset: 3px; }
.sort-select:focus-visible { outline: 3px solid var(--dorado); outline-offset: 3px; }
@media (max-width: 760px) { .catalog-tools { grid-template-columns: 1fr; gap: 10px; } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
[hidden] { display: none !important; }
.filters button { border: 1px solid var(--caoba); background: var(--marfil); color: var(--caoba); border-radius: 2px; padding: 8px 13px; font: inherit; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--caoba); color: var(--marfil); }
.filters button:focus-visible { outline: 3px solid var(--dorado); outline-offset: 3px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,230px),1fr)); gap: 14px; }
.catalog-empty { margin: 18px 0; padding: 24px; border: 1px solid #eadfd3; border-radius: 12px; background: #fffaf4; color: #6b5550; text-align: center; }
.product { background: white; border: 1px solid var(--beige); }
.product img { width: 100%; height: auto; display: block; aspect-ratio: 25 / 18; object-fit: cover; }
.product-body { padding: 18px; }
.product h3 { font-size: 1.45rem; }
.product p { margin: 9px 0 13px; }
.product-code, .bag-code { color: #806044; font-size: .82rem; letter-spacing: .025em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.bag-button, .add-to-bag, .close-bag, .bag-controls button { cursor: pointer; font: inherit; border-radius: 3px; padding: 8px 12px; }
.bag-button, .close-bag, .bag-controls button { background: var(--marfil); color: var(--caoba); border: 1px solid var(--caoba); }
.bag-button { white-space: nowrap; }
.bag-button.bag-bumped { animation: bag-bump .38s ease-out; }
@keyframes bag-bump { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.12); } 72% { transform: scale(.96); } }
.add-to-bag { display: block; margin-top: 12px; background: var(--caoba); color: white; border: 1px solid var(--caoba); }
button:focus-visible { outline: 3px solid var(--dorado); outline-offset: 3px; }
.bag-toast { position: fixed; z-index: 30; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; width: min(calc(100% - 24px), 560px); padding: 13px 14px; border: 1px solid #dfcfbb; border-left: 4px solid var(--rosa-marca); border-radius: 12px; background: white; color: var(--tinta); box-shadow: 0 14px 42px rgb(44 28 24 / .2); transform: translateX(-50%); animation: bag-toast-in .22s ease-out both; }
.bag-toast-error { border-left-color: #b64d42; }
@keyframes bag-toast-in { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
.toast-check { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--rosa-marca); color: white; font-weight: 800; }
.bag-toast-error .toast-check { background: #f8e9e6; color: #9d4037; }
#mensaje-bolsa { flex: 1; margin: 0; font-size: .92rem; font-weight: 600; line-height: 1.35; }
.toast-open { flex: 0 0 auto; padding: 8px 11px; border: 0; border-radius: 7px; background: var(--rosa-marca); color: white; font: 650 .83rem system-ui, sans-serif; cursor: pointer; }
.toast-close { flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #806f65; font: 1.4rem/1 system-ui, sans-serif; cursor: pointer; }
.toast-close:hover { background: var(--beige); color: var(--caoba); }
#bolsa { width: min(100% - 28px, 620px); max-height: calc(100% - 28px); overflow: auto; border: 1px solid var(--dorado); border-radius: 16px; padding: clamp(16px, 4vw, 28px); color: var(--caoba); background: var(--marfil); box-shadow: 0 24px 80px rgb(44 28 24 / .2); }
#bolsa::backdrop { background: rgb(44 28 24 / .55); }
.bag-heading, .bag-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bag-heading { position: sticky; top: -28px; z-index: 3; margin: calc(clamp(16px, 4vw, 28px) * -1) calc(clamp(16px, 4vw, 28px) * -1) 0; padding: 16px clamp(16px, 4vw, 28px) 12px; border-bottom: 1px solid var(--beige); background: var(--marfil); }
.bag-heading h2 { margin: 0; font-size: 2rem; }
.bag-eyebrow { margin: 0 0 4px; color: var(--dorado); font-size: .68rem; font-weight: 800; letter-spacing: .18em; }
.close-bag { display: inline-flex; align-items: center; gap: 5px; }
.close-bag span:first-child { font-size: 1.35rem; line-height: 1; }
.close-label { font-size: .83rem; }
.checkout-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 4px; padding: 0 0 14px; border-bottom: 1px solid var(--beige); list-style: none; }
.checkout-progress li { display: flex; align-items: center; gap: 7px; color: #8f8178; font-size: .78rem; font-weight: 650; }
.checkout-progress li span { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid #d9cec1; border-radius: 50%; background: white; font-size: .75rem; }
.checkout-progress li[aria-current="step"] { color: var(--caoba); }
.checkout-progress li[aria-current="step"] span { border-color: var(--caoba); background: var(--caoba); color: white; box-shadow: 0 0 0 3px rgb(177 131 69 / .16); }
.bag-intro { margin: 15px 0 5px; color: #74625a; font-size: .9rem; }
.bag-empty { display: grid; justify-items: center; gap: 7px; margin: 20px 0; padding: 28px 18px; border: 1px dashed #d8c7b0; border-radius: 12px; background: white; text-align: center; }
.bag-empty strong { color: var(--caoba); font: normal 1.25rem Georgia, serif; }
.bag-empty > span:last-child { color: #74625a; font-size: .88rem; }
.empty-bag-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 50%; background: var(--rosa); color: var(--caoba); font-size: 1.8rem; }
#productos-bolsa { list-style: none; padding: 0; }
#productos-bolsa li { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--beige); }
#productos-bolsa .bag-thumb { width: 84px; height: 84px; flex: 0 0 84px; object-fit: cover; border-radius: 4px; background: var(--beige); }
.bag-item-content { flex: 1; min-width: 0; }
#productos-bolsa h3 { font-size: 1.2rem; }
.bag-code { margin: 5px 0 2px; }
.precio-unitario { margin: 4px 0 8px; }
.bag-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bag-controls button { min-width: 40px; }
.bag-controls button:disabled { opacity: .5; cursor: default; }
.bag-note { margin-bottom: 0; font-size: .9rem; }
.bag-summary { position: sticky; bottom: -28px; margin: 8px calc(clamp(16px, 4vw, 28px) * -1) calc(clamp(16px, 4vw, 28px) * -1); padding: 14px clamp(16px, 4vw, 28px) clamp(16px, 4vw, 28px); border-top: 1px solid var(--beige); background: var(--marfil); }
.bag-summary .bag-total { font-size: 1.05rem; }
.bag-summary .bag-total strong { font-size: 1.25rem; }
.bag-summary-note { margin: 4px 0 0; color: #74625a; font-size: .8rem; }

.checkout-action { background: var(--caoba); color: white; border: 1px solid var(--caoba); border-radius: 7px; cursor: pointer; font: 650 .96rem system-ui, sans-serif; padding: 12px 15px; margin-top: 14px; transition: background .18s ease, transform .18s ease; }
.checkout-action:hover:not(:disabled) { background: #6a342d; transform: translateY(-1px); }
.bag-summary .checkout-action { display: flex; width: 100%; justify-content: space-between; align-items: center; }
.checkout-action:disabled { opacity: .5; cursor: default; }
#datos-pedido { display: grid; gap: 8px; margin-top: 14px; }
#datos-pedido input, #datos-pedido select { width: 100%; padding: 8px 10px; border: 1px solid var(--caoba); border-radius: 3px; font: inherit; color: var(--tinta); background: white; }
.order-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.order-actions .checkout-action { margin-top: 0; }
.order-products { padding-left: 20px; }
.order-products li { margin-block: 4px; }
.ticket-title { margin: 8px 0 10px; font-size: 1.6rem; }
.ticket-help { color: #6b5550; font-size: .92rem; }
.ticket-preview { display: block; width: min(100%, 430px); max-height: 54vh; object-fit: contain; margin: 18px auto; border: 1px solid var(--beige); background: white; box-shadow: 0 8px 28px rgb(80 40 36 / .12); }
.ticket-actions { display: grid; gap: 9px; }
.ticket-actions .checkout-action { margin: 0; }
.ticket-link { display: block; padding: 10px 12px; border: 1px solid var(--caoba); border-radius: 3px; text-align: center; color: var(--caoba); font-weight: 650; text-decoration: none; }
.ticket-link:hover { background: var(--beige); }
#estado-whatsapp { color: var(--caoba); }
.install-dialog { width: min(100% - 28px, 460px); max-height: calc(100% - 28px); overflow: auto; border: 1px solid var(--dorado); border-radius: 16px; padding: 0 clamp(18px, 5vw, 28px) 22px; color: var(--caoba); background: var(--marfil); box-shadow: 0 24px 80px rgb(44 28 24 / .2); }
.install-dialog::backdrop { background: rgb(44 28 24 / .55); }
.install-dialog-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 calc(clamp(18px, 5vw, 28px) * -1); padding: 18px clamp(18px, 5vw, 28px) 14px; border-bottom: 1px solid var(--beige); background: var(--marfil); }
.install-dialog-heading h2 { margin: 0; font-size: 1.8rem; }
.install-intro { color: #74625a; }
.install-dialog section { padding: 14px 16px; border-radius: 10px; background: white; }
.install-dialog section h3 { font-size: 1.25rem; }
.install-dialog ol { margin-bottom: 0; padding-left: 22px; color: #594640; }
.install-dialog li { margin: 9px 0; padding-left: 3px; }
.install-secure-note { margin: 16px 0 0; color: #74625a; font-size: .82rem; }

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

.bag-button { display: inline-flex; align-items: center; justify-content: center; position: relative; height: 44px; min-width: 48px; }
.bag-icon { display: block; position: relative; width: 20px; height: 17px; margin-top: 5px; border: 2px solid currentColor; border-radius: 2px 2px 4px 4px; }
.bag-icon::before { content: ''; position: absolute; width: 8px; height: 7px; left: 50%; top: -8px; transform: translateX(-50%); border: 2px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; }
#contador-bolsa { position: absolute; top: -6px; right: -7px; min-width: 19px; padding: 0 4px; height: 19px; border-radius: 20px; background: var(--caoba); color: white; font-size: 11px; line-height: 19px; }
#estado-whatsapp:empty { display: none; }
#abrir-whatsapp { text-underline-offset: 3px; }
