:root {
  color-scheme: dark;
  --bg: #0b0f19;
  --surface: #12192c;
  --card: #161f36;
  --raised: #1c2846;
  --amber: #f59e0b;
  --gold: #fbbf24;
  --text: #f8fafc;
  --muted: #a1aec3;
  --line: #28334a;
  --red: #fda4af;
  --green: #86efac;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --shadow: 0 18px 48px #0005;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: #35405a var(--bg); scroll-padding-top: 86px; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.55; }
body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
::selection { background: var(--amber); color: var(--bg); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--text); letter-spacing: -.038em; line-height: 1.15; }
h2 { font-size: clamp(1.35rem, 2.8vw, 1.95rem); }
h3 { font-size: 1.15rem; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .62; }
button[aria-busy=true] { cursor: wait; }
button[aria-busy=true]::before { content: ""; flex: 0 0 auto; width: .92rem; height: .92rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
img { display: block; max-width: 100%; }
input, select, textarea {
  min-width: 0; width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: .65rem;
  background: #0e1423; color: var(--text); transition: border-color 160ms;
}
input:focus, select:focus, textarea:focus { border-color: var(--amber); }
input::placeholder { color: #8794ac; opacity: 1; }
input[type=checkbox] { width: auto; accent-color: var(--amber); }
input[type=file] { padding: .55rem; }
input::file-selector-button { color: var(--text); background: var(--raised); border: 0; border-radius: .35rem; padding: .35rem; margin-right: .55rem; }
textarea { resize: vertical; }
label { font-size: .875rem; font-weight: 700; }
label :is(input, textarea, select) { margin-top: .35rem; }
label .muted { font-weight: 500; }
summary { cursor: pointer; }
.skip { position: fixed; top: .6rem; left: .6rem; transform: translateY(-160%); z-index: 20; background: var(--gold); color: var(--bg); padding: .75rem; }
.skip:focus { transform: none; }
.shell { width: min(100% - clamp(2rem, 7vw, 7rem), 1272px); margin-inline: auto; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.wide { width: 100%; }
.stack { display: grid; gap: 1rem; }
.actions { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.button, .icon-button, .link-button, .pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; color: var(--text); background: transparent;
  border: 1px solid transparent; border-radius: .65rem; font-weight: 800; min-height: 44px;
  transition: transform 135ms var(--ease), background-color 150ms, border-color 150ms, color 150ms;
}
.button { padding: .65rem 1.05rem; font-size: .875rem; text-align: center; }
.button:active:not(:disabled), .icon-button:active:not(:disabled), .pill:active:not(:disabled) { transform: scale(.975); }
.primary { color: #1c1001; background: linear-gradient(110deg, #ffcb5d, #f59e0b); border-color: #ffbf54; box-shadow: 0 5px 22px #f59e0b20; }
.primary:hover:not(:disabled) { background: linear-gradient(110deg, #ffd987, #ffb32e); box-shadow: 0 7px 28px #f59e0b4b; }
.secondary { background: #ffffff09; border-color: #8195b849; }
.secondary:hover:not(:disabled), .icon-button:hover { background: #ffffff13; border-color: #a3afc183; }
.link-button { color: var(--gold); padding: .2rem 0; font-size: .875rem; }
.link-button:hover { color: #ffe2a4; }
.icon-button { flex: 0 0 auto; width: 44px; height: 44px; font-size: 1.55rem; background: #ffffff08; border-color: var(--line); line-height: 1; }
.topbar { position: sticky; top: 0; z-index: 5; background: #0b0f19ed; border-bottom: 1px solid #ffffff13; backdrop-filter: blur(15px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: clamp(.65rem, 2vw, 2rem); min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; line-height: 1; font-size: .9rem; font-weight: 800; letter-spacing: .025em; white-space: nowrap; }
.brand img { object-fit: contain; }
.brand-store { display: block; color: var(--gold); letter-spacing: .235em; font-size: .62rem; margin-top: .3rem; }
.nav-links, .header-actions { display: flex; align-items: center; gap: clamp(.6rem, 1.8vw, 1.55rem); }
.nav-links a { color: var(--muted); font-size: .875rem; font-weight: 700; white-space: nowrap; padding: .6rem 0; }
.nav-links a:hover, .nav-links a[aria-current=page] { color: var(--text); }
.nav-links a[aria-current=page] { box-shadow: inset 0 -2px var(--gold); }
.search { position: relative; flex: 1 1 12rem; width: clamp(10rem, 19vw, 18rem); }
.search input { padding-left: 2.3rem; border-radius: 999px; font-size: .875rem; background: #151b2b; }
.search-glyph { position: absolute; top: 50%; left: .9rem; width: 12px; height: 12px; border: 1.6px solid var(--muted); border-radius: 50%; transform: translateY(-57%); pointer-events: none; }
.search-glyph::after { content: ""; position: absolute; width: 6px; height: 1.6px; background: var(--muted); transform: rotate(45deg); top: 9px; left: 8px; }
.cart-trigger { background: #f59e0b12; color: #ffd583; border-color: #a46327; white-space: nowrap; }
.cart-count { display: grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding-inline: .25rem; background: #f59e0b22; border-radius: 999px; font-size: .75rem; }
.bag-glyph { position: relative; height: 13px; width: 13px; border: 1.5px solid currentColor; border-radius: 2px; margin-top: .2rem; }
.bag-glyph::before { content: ""; position: absolute; width: 6px; height: 5px; top: -5px; left: 2px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; }
.demo-banner { padding: .25rem .85rem; background: #2b201b; color: #ffd69e; text-align: center; font-size: .78rem; }

/* User menu dropdown */
.user-menu-dropdown { position: relative; }
.user-menu-toggle { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; background: transparent; border: 1px solid transparent; border-radius: .65rem; color: var(--text); transition: background-color 150ms, border-color 150ms; }
.user-menu-toggle:hover { background: #ffffff0d; border-color: var(--line); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.user-name { font-size: .85rem; font-weight: 700; }
.user-dropdown { position: absolute; top: calc(100% + .5rem); right: 0; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: .85rem; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 0s 180ms; z-index: 10; }
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s; }
.dropdown-header { padding: .85rem; border-bottom: 1px solid var(--line); }
.dropdown-header .user-avatar { width: 36px; height: 36px; }
.dropdown-header strong { display: block; font-size: .9rem; }
.dropdown-header small { color: var(--muted); font-size: .78rem; }
.dropdown-divider { margin: .4rem 0; border-color: var(--line); }
.dropdown-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .65rem .85rem; background: transparent; border: 0; border-radius: .55rem; color: var(--text); font-size: .875rem; font-weight: 600; text-align: left; transition: background-color 120ms; }
.dropdown-item:hover { background: #ffffff0d; }
.dropdown-danger { color: #ffb4b4; }
.dropdown-danger:hover { background: #ff4d4f1a; }

.store { padding-block: 1.65rem 4rem; }
.benefit-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex-shrink: 0; border: 1px solid #f59e0b39; background: #f59e0b11; color: #ffd17b; border-radius: .65rem; font-size: 1.35rem; }
.store-section { margin-top: clamp(2rem, 4.5vw, 3.6rem); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .95rem; }
.section-heading p { font-size: .86rem; margin-top: .35rem; }
.section-heading p:empty { display: none; }
.category-grid, .product-grid { display: grid; gap: .85rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.category {
  --tone: #f59e0b; display: grid; grid-template-columns: 2.6rem minmax(0,1fr); gap: .8rem; align-items: center;
  min-height: 92px; padding: .85rem; text-align: left; border: 1px solid var(--line); border-radius: .95rem;
  background: linear-gradient(120deg, color-mix(in srgb,var(--tone) 11%, var(--surface)), var(--surface)); color: var(--text);
  transition: transform 135ms var(--ease), border-color 150ms;
}
.category[aria-pressed=true] { border-color: var(--tone); }
.category:active { transform: scale(.985); }
.category b, .category small { display: block; overflow-wrap: anywhere; }
.category b { font-size: .92rem; line-height: 1.25; }
.category small { color: var(--muted); font-size: .75rem; margin-top: .22rem; }
.category-icon { display: grid; place-items: center; width: 2.55rem; height: 2.55rem; border-radius: .65rem; font-size: 1.3rem; background: color-mix(in srgb,var(--tone) 12%, transparent); border: 1px solid color-mix(in srgb,var(--tone) 46%, var(--line)); }
.sort-control { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.sort-control select { margin: 0; width: auto; font-size: .85rem; }
.pills { display: flex; gap: .5rem; overflow-x: auto; padding: 4px; margin: 0 -4px .8rem; }
.pill { flex-shrink: 0; border-color: var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; font-size: .84rem; padding: .45rem .95rem; min-height: 42px; white-space: nowrap; }
.pill:hover, .pill[aria-pressed=true], .pill[aria-selected=true] { color: #ffe0a4; border-color: #a46327; background: #35251c; }
.product {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem;
  transition: border-color 150ms;
}
.product-art { --tone: #f59e0b; display: grid; place-items: center; background: radial-gradient(ellipse at 60% 35%, color-mix(in srgb,var(--tone) 25%, #151b30), #101525 75%); position: relative; aspect-ratio: 16/9; overflow: hidden; border-bottom: 1px solid var(--line); }
.product-art::before { content: ""; position: absolute; width: 48%; aspect-ratio: 1; border: 1px solid color-mix(in srgb,var(--tone) 35%, transparent); border-radius: 28%; transform: rotate(-20deg); box-shadow: 0 0 0 9px #ffffff06, 0 0 0 26px #ffffff05; pointer-events: none; }
.product-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) and (pointer: fine) {
  .product:hover { border-color: #9ab7ed7d; }
  .product-art img { transition: transform 190ms var(--ease); }
  .product:hover .product-art img { transform: scale(1.025); }
}
.product-symbol { font-size: clamp(2rem, 5.4vw, 3.15rem); filter: drop-shadow(0 5px 10px #000a); }
.product-badge { position: absolute; top: .6rem; left: .6rem; background: #0b0f19ed; color: #ffd68c; border: 1px solid #cf902b89; border-radius: .45rem; padding: .2rem .45rem; font-size: .72rem; font-weight: 800; max-width: calc(100% - 1.2rem); overflow-wrap: anywhere; }
.product-info { padding: .9rem; display: flex; flex: 1; flex-direction: column; }
.product-info h3 { margin: .2rem 0 .4rem; }
.product-info p { font-size: .83rem; color: var(--muted); overflow-wrap: anywhere; }
.product-category { color: #ffd28b; font-size: .72rem; letter-spacing: .05em; font-weight: 800; text-transform: uppercase; }
.product-price { display: flex; flex-wrap: wrap; gap: .32rem .55rem; align-items: baseline; padding: .8rem 0 .6rem; margin-top: auto; }
.product-price strong { color: var(--gold); font-size: 1.3rem; letter-spacing: -.05em; }
.product-price del { color: var(--muted); font-size: .8rem; }
.product-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .38rem; }
.product-buttons .button { padding-inline: .35rem; min-width: 0; font-size: .78rem; }
.empty, .panel, .order-card, .stat, .admin-table { background: var(--surface); border: 1px solid var(--line); border-radius: .95rem; }
.empty { display: grid; justify-items: center; align-content: center; gap: .75rem; min-height: 214px; padding: 1.3rem; text-align: center; }
.empty p { color: var(--muted); max-width: 30rem; }
.skeleton { background: var(--surface); border: 1px solid var(--line); border-radius: .85rem; min-height: 5rem; }
.product-grid .skeleton { min-height: 18rem; }
.footer { background: #0e1320; border-top: 1px solid var(--line); color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.45fr 1fr 1fr 1fr; gap: 1.25rem; padding-block: 2.2rem; }
.footer h2 { font-size: .875rem; margin-bottom: .55rem; letter-spacing: 0; }
.footer p, .footer-grid div > a:not(.brand) { display: block; font-size: .85rem; margin-top: .3rem; }
.footer a:hover { color: var(--gold); }
.footer-brand { color: var(--text); margin-bottom: .35rem; }
.footer-end { padding-block: .85rem; font-size: .77rem; border-top: 1px solid var(--line); }
dialog { color: var(--text); background: #121a2a; border: 1px solid #4b5265; padding: 0; box-shadow: 0 0 36px #f59e0b14, var(--shadow); }
dialog::backdrop { background: #04070db8; backdrop-filter: blur(5px); animation: fade 180ms; }
.modal { width: min(100% - 1.5rem, 620px); max-height: calc(100dvh - 1.5rem); border-radius: 1rem; }
.modal[open] { animation: modal-in 210ms var(--ease); }
.drawer { inset: 0 0 0 auto; width: min(100%, 435px); max-width: none; height: 100dvh; max-height: none; margin: 0; border-block: 0; border-right: 0; }
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in 275ms var(--ease-drawer); }
dialog[open][data-keyboard-open], dialog[open][data-keyboard-open]::backdrop { animation: none; }
.dialog-header, .drawer-footer { background: #131c2c; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.dialog-header h2 { font-size: 1.25rem; }
.dialog-header p, .fine-print { font-size: .82rem; color: var(--muted); }
.dialog-body, .drawer-body { padding: 1rem; }
.drawer-body { overflow: auto; flex: 1; }
.drawer-footer { border-bottom: 0; border-top: 1px solid var(--line); }
.drawer-footer .button { margin-top: .65rem; }
.cart-item { display: grid; gap: .65rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.cart-item h3 { font-size: 1rem; }
.cart-row, .total-row, .payment-top, .order-head, .summary-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.total-row strong { color: var(--gold); font-size: 1.3rem; }
.qty-controls { display: flex; align-items: center; gap: .6rem; }
.qty-controls button { font-size: 1.1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .85rem; }
.inline-form { display: flex; gap: .55rem; }
.inline-form .button { flex: 0 0 auto; }
.summary { display: grid; gap: .55rem; background: #0e1523; border: 1px solid var(--line); padding: .85rem; border-radius: .7rem; font-size: .88rem; overflow-wrap: anywhere; }
.summary .total-row { border-top: 1px solid var(--line); padding-top: .45rem; }
.notice { padding: .65rem .8rem; margin-bottom: .65rem; border-radius: .6rem; border: 1px solid #936228; background: #2b231d; color: #ffe0aa; font-size: .865rem; }
.notice.error { color: #ffd0d7; background: #3a2028; border-color: #97515c; }
.qr-box { padding: .8rem; border-radius: .65rem; align-self: center; justify-self: center; background: #fff; color: #1d2736; min-width: 220px; min-height: 220px; display: grid; place-items: center; text-align: center; font-size: .82rem; animation: fade 250ms; }
.qr-box:empty { display: none; }
.payment-top strong { font-size: 1.45rem; white-space: nowrap; }
.success-stage { text-align: center; justify-items: center; }
.success-mark { display: grid; place-items: center; width: 3.6rem; height: 3.6rem; background: #23633e5e; border: 1px solid #66b585; color: var(--green); font-size: 2rem; border-radius: 50%; }
.success-stage .summary { width: 100%; }
.toasts { position: fixed; z-index: 20; bottom: 1rem; right: 1rem; display: grid; gap: .5rem; width: min(23rem, calc(100% - 2rem)); pointer-events: none; }
.toast { margin: 0; box-shadow: var(--shadow); animation: reveal 240ms var(--ease); }
.subpage { min-height: 65vh; padding-block: clamp(1.5rem, 5vw, 4rem); }
.order-layout { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.panel, .order-card { padding: 1.05rem; }
.panel h2, .order-card h2 { font-size: 1.2rem; }
.order-details { margin-top: .8rem; }
.order-details .summary { margin-top: .6rem; }
.status-badge { border-radius: 999px; border: 1px solid #8d672a; color: #ffdb9c; background: #39291b; padding: .27rem .6rem; font-size: .75rem; font-weight: 800; }
.status-PAGO, .status-ENTREGUE { color: #a7f3c3; border-color: #4b8c65; background: #1d372a; }
.status-CANCELADO { color: #ffc4cf; border-color: #97515c; background: #3e2330; }
.login { width: min(100%, 430px); margin: 2rem auto; }
.login h1, #admin-dashboard h1 { font-size: clamp(1.85rem, 4vw, 2.9rem); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .65rem; margin-bottom: 1rem; }
.stat { display: grid; gap: .35rem; padding: .8rem; }
.stat strong { color: var(--gold); font-size: clamp(1rem, 3vw, 1.6rem); }
.admin-tabs { position: sticky; top: 75px; z-index: 2; background: var(--bg); }
.admin-toolbar { display: flex; justify-content: space-between; gap: .6rem; align-items: center; margin-bottom: .7rem; flex-wrap: wrap; }
.admin-toolbar input { max-width: 20rem; }
.order-toolbar select { max-width: 15rem; }
.admin-item, .check-field { display: flex; align-items: center; gap: .6rem; }
.admin-item img { border-radius: .4rem; object-fit: cover; }
.check-field input { margin: 0; }
.pagination { margin-top: .8rem; }
.admin-table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .87rem; }
th, td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); }
tbody tr:hover { background: #ffffff08; }
td small { display: block; color: var(--muted); }
td .actions { flex-wrap: nowrap; }
.admin-orders { display: grid; gap: .75rem; }
.admin-orders .actions { margin-top: .7rem; }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.982); } to { opacity: 1; transform: none; } }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-in { animation: reveal 230ms var(--ease) both; }
@media (max-width: 980px) {
  .nav-links { gap: .75rem; }
  .category-grid, .product-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 750px) {
  html { scroll-padding-top: 118px; }
  .topbar-inner { flex-wrap: wrap; min-height: 0; padding-block: .45rem; gap: .28rem .65rem; }
  .nav-links { order: 3; width: 100%; justify-content: center; gap: 1.4rem; }
  .nav-links a { font-size: .81rem; padding: .32rem 0; }
  .header-actions { flex: 1; justify-content: end; gap: .42rem; min-width: 0; }
  .search { flex: 0 1 14rem; min-width: 0; }
  .store { padding-top: .75rem; }
  .category-grid, .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .order-layout { grid-template-columns: 1fr; }
  .admin-tabs { top: 60px; }
}
@media (max-width: 455px) {
  .topbar .brand img { width: 32px; height: 32px; }
  .topbar .brand { font-size: .7rem; gap: .26rem; }
  .brand-store { margin-top: .18rem; font-size: .51rem; }
  .cart-trigger { padding-inline: .45rem; gap: .32rem; }
  .cart-trigger > span:nth-child(2) { display: none; }
  .search input { font-size: .78rem; padding-left: 1.7rem; padding-right: .35rem; }
  .search-glyph { left: .55rem; }
  .category-grid { gap: .48rem; }
  .category { grid-template-columns: 1fr; min-height: 98px; gap: .4rem; padding: .5rem; }
  .category b { font-size: .84rem; }
  .category small { font-size: .72rem; }
  .product-grid { grid-template-columns: 1fr; }
  .sort-control { font-size: 0; gap: 0; }
  .sort-control select { max-width: 8.75rem; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
