:root {
  /* Paleta de mayoristaelgauchito.com */
  --blue: #185593;
  --blue-l: #119BEF;
  --blue-dark: #0f3d6e;
  --cyan: #21B6E8;
  --orange: #F7941D;
  --orange-dark: #EF6C1A;
  --yellow: #FBBE3C;
  --cream: #FCEFC9;
  --sky: #DDF2FC;
  --ink: #16263C;
  --muted: #3a4d63;
  --line: #e7eef5;
  --paper: #ffffff;
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --shadow-card: 0 28px 64px rgba(8, 40, 70, .34);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); font-family: var(--font-body); color: var(--ink); }
#scene { display: block; width: 100%; height: 100%; }
.hidden { display: none !important; }
h1, h2, .price, .brand-tag { font-family: var(--font-display); }
kbd { display: inline-block; padding: 2px 7px; border-radius: 6px; background: #fff; color: var(--ink); border: 1px solid #cddde6; box-shadow: 0 2px 0 #cddde6; font-size: 12px; font-family: inherit; font-weight: 700; margin-right: 3px; }

/* ---------- Overlay de entrada ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(17,155,239,0.55), rgba(16,43,62,0.92));
  backdrop-filter: blur(4px);
}
.overlay-card {
  position: relative;
  background: var(--paper); border-radius: 26px; padding: 30px 44px 34px; text-align: center;
  max-width: 480px; box-shadow: var(--shadow-card); border-top: 8px solid var(--orange);
}
.logo-img { width: 300px; max-width: 80%; display: block; margin: 0 auto 6px; }
.mascot { position: absolute; width: 150px; right: -70px; bottom: -8px; filter: drop-shadow(0 8px 14px rgba(8,40,70,.35)); pointer-events: none; }
.tagline { color: var(--muted); margin: 0 0 22px; font-weight: 600; }
#enter-btn {
  background: linear-gradient(180deg, #FBB041 0%, #F58A1E 55%, #EF6C1A 100%);
  color: #fff; border: none; border-radius: 999px; padding: 14px 36px;
  font-family: var(--font-display); font-size: 20px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 0 var(--orange-dark); transition: transform .1s;
}
#enter-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--orange-dark); }
.controls { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 58%, rgba(8, 30, 52, .42) 100%); }
.quality-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; font-size: 13px; font-weight: 700; color: var(--muted); }
.quality-row select { font-family: inherit; font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 8px; border: 1px solid #cddde6; color: var(--ink); background: #fff; }
#hud-top { position: absolute; top: 14px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: center; }
.brand-logo { height: 54px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.45)); }
#cart-badge { background: var(--blue); color: #fff; padding: 8px 18px 7px; border-radius: 18px; font-weight: 800; font-size: 15px; box-shadow: 0 4px 12px rgba(8,40,70,.35); border: 2px solid rgba(255,255,255,.25); text-align: center; }
#cart-badge small { display: block; font-size: 11px; font-weight: 600; color: #cfe7f5; margin-top: 2px; }
#cart-badge small kbd { font-size: 10px; padding: 0 5px; margin: 0; box-shadow: 0 1px 0 #cddde6; }
#cart-badge.pulse { animation: badgePulse .6s ease-out; }
@keyframes badgePulse { 0% { transform: scale(1); } 30% { transform: scale(1.12); background: var(--orange); } 100% { transform: scale(1); } }
#online-chip { position: absolute; top: 84px; left: 20px; background: rgba(16,43,62,.82); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; border-left: 4px solid var(--orange); }
#online-chip b { color: var(--yellow); }
#zoom-chip { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); background: rgba(16,43,62,.85); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid rgba(255,255,255,.2); }
#zoom-chip b { color: var(--yellow); font-family: var(--font-display); font-size: 14px; }
#crosshair.zoom { width: 26px; height: 26px; margin: -13px 0 0 -13px; border-color: var(--yellow); border-width: 1.5px; opacity: .9; }
#crosshair.zoom::before, #crosshair.zoom::after { content: ''; position: absolute; background: var(--yellow); }
#crosshair.zoom::before { left: 50%; top: -8px; width: 1.5px; height: 10px; margin-left: -1px; box-shadow: 0 32px 0 var(--yellow); }
#crosshair.zoom::after { top: 50%; left: -8px; height: 1.5px; width: 10px; margin-top: -1px; box-shadow: 32px 0 0 var(--yellow); }
#cart-btn { display: block; margin: 12px auto 0; background: #fff; color: var(--blue); border: 2px solid var(--blue); border-radius: 999px; padding: 10px 24px; font-family: var(--font-display); font-size: 16px; font-weight: 800; cursor: pointer; }
#cart-btn:hover { background: var(--sky); }
#crosshair {
  position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 6px rgba(0,0,0,.8); opacity: .85;
}
#hover-tip {
  position: absolute; left: 50%; top: 56%; transform: translateX(-50%);
  background: rgba(16,43,62,0.9); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  border-left: 4px solid var(--yellow); white-space: nowrap; font-weight: 600;
}
#hover-tip b { color: var(--yellow); font-family: var(--font-display); font-size: 16px; }
#hover-tip small { display: block; color: #cfe7f5; font-size: 11px; margin-top: 2px; font-weight: 400; }
#hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.75); font-size: 12px; text-shadow: 0 1px 4px #000; font-weight: 600; }

/* ---------- Carrito ---------- */
#cart-panel {
  position: fixed; right: 20px; top: 80px; width: 340px; max-height: calc(100% - 110px); z-index: 20;
  background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; overflow: hidden; border-top: 6px solid var(--blue);
}
#cart-panel.readonly { pointer-events: none; opacity: .94; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.cart-head h2 { margin: 0; font-size: 20px; color: var(--blue); }
.icon-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); }
#cart-items { overflow-y: auto; padding: 0 16px; flex: 1; }
#cart-items .empty { color: var(--muted); font-size: 13px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.cart-item .name { font-weight: 800; }
.cart-item .sub { color: var(--muted); font-size: 12px; grid-column: 1; }
.cart-item .line { font-weight: 800; text-align: right; color: var(--blue); }
.cart-item .ctrls { grid-column: 2; display: flex; gap: 4px; justify-content: flex-end; }
.cart-item .ctrls button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid #cddde6; background: #fff; cursor: pointer; font-weight: 800; color: var(--blue); }
.cart-item .ctrls button.rm { color: var(--orange-dark); }
.cart-item .ctrls button.go { width: auto; padding: 0 9px; font-size: 12px; background: var(--sky); border-color: #bfdff0; }
.peek-hint { display: none; font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
#cart-panel.readonly #checkout-btn { display: none; }
#cart-panel.readonly .peek-hint { display: block; }
.cart-foot { padding: 12px 16px 16px; border-top: 2px solid var(--line); background: #f7fafb; }
.cart-foot .total { display: flex; justify-content: space-between; font-size: 17px; font-weight: 800; margin-bottom: 10px; }
#checkout-btn { width: 100%; background: linear-gradient(180deg, #FBB041 0%, #F58A1E 55%, #EF6C1A 100%); color: #fff; border: none; border-radius: 12px; padding: 12px; font-family: var(--font-display); font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 var(--orange-dark); }
#checkout-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-dark); }

/* ---------- Ficha de producto ---------- */
#modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(16,43,62,.6); }
.modal-card { background: var(--paper); border-radius: 26px; display: grid; grid-template-columns: 300px 1fr; width: 720px; max-width: 94vw; overflow: hidden; box-shadow: var(--shadow-card); }
.preview-wrap { background: radial-gradient(circle at 50% 35%, #ffffff, var(--sky)); display: flex; align-items: center; justify-content: center; }
#preview { width: 280px; height: 320px; }
.info { padding: 28px 28px 24px; display: flex; flex-direction: column; }
.brand-tag { display: inline-block; background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; align-self: flex-start; }
.info h2 { margin: 10px 0 2px; font-size: 28px; color: var(--blue); }
.variant { margin: 0; color: var(--muted); font-weight: 700; }
.desc { font-size: 14px; color: var(--muted); line-height: 1.45; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 14px; }
.price { font-size: 32px; font-weight: 800; color: var(--orange-dark); }
.price-row small { color: var(--muted); font-weight: 600; }
.qty-row { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.qty-row button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid #cddde6; background: #fff; font-size: 18px; cursor: pointer; color: var(--blue); font-weight: 800; }
.qty-row input { width: 64px; height: 36px; text-align: center; font-size: 16px; border: 1px solid #cddde6; border-radius: 10px; font-family: inherit; font-weight: 700; }
.info button.primary { background: linear-gradient(180deg, #21A6F2 0%, #0E8DE0 100%); color: #fff; border: none; border-radius: 12px; padding: 13px; font-family: var(--font-display); font-size: 17px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 #0B7BD0; }
.info button.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #0B7BD0; }
.info button.ghost { background: none; border: none; color: var(--muted); margin-top: 10px; cursor: pointer; font-size: 14px; font-weight: 700; font-family: inherit; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); background: #21A24A; color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 800; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .25s ease-out; }
@keyframes pop { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Buscador ---------- */
#search { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(16,43,62,.35); pointer-events: none; }
.search-box { width: 520px; max-width: 92vw; background: var(--paper); border-radius: 22px; box-shadow: var(--shadow-card); overflow: hidden; border-top: 6px solid var(--yellow); }
.search-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search-icon { font-size: 20px; }
#search-input { flex: 1; border: none; outline: none; font-size: 20px; font-family: var(--font-display); font-weight: 700; color: var(--ink); background: transparent; }
#search-input::placeholder { color: #8aa0ad; font-weight: 600; }
#search-results { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow-y: auto; }
#search-results li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 14px; border-radius: 12px; cursor: pointer; }
#search-results li .name { font-weight: 800; font-size: 15px; grid-column: 1; grid-row: 1; }
#search-results li .meta { color: var(--muted); font-size: 12px; font-weight: 600; grid-column: 1; grid-row: 2; }
#search-results li .price { font-size: 16px; color: var(--orange-dark); grid-column: 2; grid-row: 1 / span 2; align-self: center; }
#search-results li.active { background: var(--blue); color: #fff; }
#search-results li.active .meta { color: #cfe7f5; }
#search-results li.active .price { color: var(--yellow); }
#search-results .none { padding: 16px; color: var(--muted); font-weight: 600; text-align: center; }
.search-help { padding: 8px 18px 12px; font-size: 12px; color: var(--muted); font-weight: 600; border-top: 1px solid var(--line); background: #f7fafb; }
#travel-banner { position: fixed; top: 90px; left: 50%; transform: translateX(-50%); background: var(--blue); color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 800; z-index: 15; box-shadow: 0 8px 24px rgba(8,40,70,.4); }
#travel-banner b { color: var(--yellow); }
#idle-banner { position: fixed; bottom: 48px; left: 50%; transform: translateX(-50%); background: rgba(16,43,62,.9); color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; z-index: 15; border: 1px solid rgba(255,255,255,.25); box-shadow: 0 8px 24px rgba(8,40,70,.4); }
#idle-banner kbd { margin: 0 2px; }
