/* Catálogo Spacekicks × DFYNE — mobile-first, tema oscuro deportivo */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; } /* el atributo hidden SIEMPRE gana sobre display:flex de las clases */
:root {
  --bg: #0d0f12; --panel: #16191f; --panel2: #1e232b; --line: #2a303a;
  --txt: #eef1f5; --dim: #8b93a1; --acc: #7c5cff; --acc2: #9d85ff;
  --ok: #2ecc71; --warn: #f1c40f; --bad: #e74c3c;
}
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--txt); font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif; min-height: 100vh; }

.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: rgba(13,15,18,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: 2px; font-size: 17px; }
.brand span { color: var(--acc2); }
.brand em { font-style: normal; color: var(--dim); font-weight: 600; font-size: 13px; }
.cart-btn { position: relative; background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  font-size: 18px; padding: 8px 14px; border-radius: 12px; cursor: pointer; }
.badge { position: absolute; top: -6px; right: -6px; background: var(--acc); color: #fff; font-size: 11px;
  font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }

.toolbar { padding: 12px 16px 4px; display: flex; flex-direction: column; gap: 10px; }
#search { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--txt); font-size: 15px; outline: none; }
#search:focus { border-color: var(--acc); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select { background: var(--panel); color: var(--txt); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--dim); cursor: pointer; }

main { padding: 8px 16px 40px; max-width: 1200px; margin: 0 auto; }
.meta { color: var(--dim); font-size: 12px; padding: 4px 0 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer;
  transition: transform .12s, border-color .12s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-2px); border-color: var(--acc); }
.card .imgbox { aspect-ratio: 3/4; background: var(--panel2); overflow: hidden; position: relative; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .agotado-badge { position: absolute; top: 8px; left: 8px; background: rgba(13,15,18,.85); color: var(--bad);
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.card .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .nombre { font-size: 13px; font-weight: 600; line-height: 1.3; }
.card .color { color: var(--dim); font-size: 12px; }
.card .precio { font-weight: 800; font-size: 15px; color: var(--acc2); }
.card .mini-tallas { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.mt { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 7px; border: 1px solid var(--line); color: var(--dim); }
.mt.ok   { color: var(--ok);   border-color: rgba(46,204,113,.4); }
.mt.warn { color: var(--warn); border-color: rgba(241,196,15,.4); }
.mt.bad  { color: var(--bad);  border-color: rgba(231,76,60,.4); }
.mt.off  { text-decoration: line-through; opacity: .45; }

.vacio { text-align: center; color: var(--dim); padding: 60px 0; }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.65); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .overlay { align-items: center; } }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 18px 18px 0 0; width: 100%; max-width: 860px;
  max-height: 92vh; overflow-y: auto; position: relative; padding: 18px; }
@media (min-width: 700px) { .sheet { border-radius: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } .sheet.carrito { display: block; max-width: 480px; } }
.cerrar { position: absolute; top: 12px; right: 12px; z-index: 2; background: var(--panel2); border: 1px solid var(--line);
  color: var(--txt); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 14px; }

.galeria img { width: 100%; border-radius: 12px; aspect-ratio: 3/4; object-fit: cover; background: var(--panel2); }
.thumbs { display: flex; gap: 6px; margin-top: 8px; }
.thumbs img { width: 56px; height: 70px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .55; border: 1px solid var(--line); }
.thumbs img.act { opacity: 1; border-color: var(--acc); }

.detalle h2 { font-size: 18px; margin: 6px 0 4px; padding-right: 30px; }
.detalle .precio { font-size: 22px; font-weight: 800; color: var(--acc2); margin-bottom: 14px; }
.tallas-label { font-size: 13px; color: var(--dim); margin-bottom: 8px; }
.frescura { font-size: 11px; }
.tallas { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.talla-btn { background: var(--panel2); border: 1.5px solid var(--line); color: var(--txt); border-radius: 10px;
  padding: 8px 12px; cursor: pointer; font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; }
.talla-btn small { font-size: 10px; font-weight: 700; }
.talla-btn small.ok { color: var(--ok); } .talla-btn small.warn { color: var(--warn); } .talla-btn small.bad { color: var(--bad); }
.talla-btn.sel { border-color: var(--acc); background: rgba(124,92,255,.14); }
.talla-btn:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 13px; color: var(--dim); }
.qty { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { background: var(--panel2); border: none; color: var(--txt); width: 36px; height: 36px; font-size: 17px; cursor: pointer; }
.qty span { width: 36px; text-align: center; font-weight: 700; }

.cta { width: 100%; background: linear-gradient(135deg, var(--acc), var(--acc2)); border: none; color: #fff;
  font-size: 15px; font-weight: 800; padding: 14px; border-radius: 12px; cursor: pointer; }
.cta:disabled { opacity: .4; cursor: not-allowed; }
.nota-encargo { font-size: 12px; color: var(--dim); text-align: center; margin-top: 10px; }

/* Carrito */
.carrito h2 { margin-bottom: 12px; }
.cart-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 52px; height: 66px; object-fit: cover; border-radius: 8px; }
.cart-item .ci-info { flex: 1; font-size: 13px; }
.cart-item .ci-info b { display: block; }
.cart-item .ci-info span { color: var(--dim); font-size: 12px; }
.cart-item .quitar { background: none; border: none; color: var(--bad); cursor: pointer; font-size: 16px; }
.total { font-size: 17px; font-weight: 800; padding: 14px 0; text-align: right; }
#formPedido { display: flex; flex-direction: column; gap: 10px; }
#formPedido input, #formPedido textarea { background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 11px 13px; font-size: 14px; font-family: inherit; outline: none; }
#formPedido input:focus, #formPedido textarea:focus { border-color: var(--acc); }
.hp { position: absolute; left: -9999px; }
.pedido-ok { text-align: center; padding: 24px 10px; font-size: 15px; line-height: 1.7; }

footer { text-align: center; color: var(--dim); font-size: 12px; padding: 24px 16px 34px; border-top: 1px solid var(--line); }
