/* ========== Reset / base ========== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: black;
  color: #00ff66;
  font-family: 'Courier New', monospace;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Fade entre páginas (script.js lo activa) */
body.fade-out { opacity: 0; transition: opacity .35s ease; }

/* ========== Barra superior ========== */
.white-bar {
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo-left {
  height: 100px;
  width: auto;
  cursor: pointer;
  user-select: none;
}
.logo-center {
  height: 160px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  pointer-events: none;
  user-select: none;
}

/* ========== Iconos arriba (carrito + menú) ========== */
.top-icons { display: flex; gap: 15px; align-items: center; }
.cart-icon { display: flex; align-items: center; cursor: pointer; }
.cart-icon img, #cart-icon, .cart-icon-img {
  width: 28px; height: auto; display: block; cursor: pointer;
}
/* contador ROJO (nº de items) */
#cart-count, .cart-count {
  font-weight: bold;
  margin-left: 6px;
  background: #ff3b3b;
  color: white;
  padding: 2px 6px;
  border-radius: 50%;
  font-size: 0.8rem;
  line-height: 1;
}
.hamburger { color: black; font-size: 30px; cursor: pointer; z-index: 2; }

/* ========== Zona tipo consola ========== */
#console-menu {
  background: black;
  color: #00ff66;
  padding: 20px;
  font-size: 1.2rem;
  flex-grow: 1;
}
.console-line { margin-bottom: 10px; cursor: pointer; }
.console-line.clickable:hover { text-decoration: underline; }
.submenu { margin-left: 20px; }
.hidden { display: none !important; }

/* Línea de consola con input visible (para comando secreto / nav) */
.console-input{
  display:flex; align-items:center; gap:8px;
  font-family:'Courier New', monospace; color:#00ff66; margin-top:10px;
}
.console-input .prompt { color:#00ff66; user-select:none; }
.console-input input#console-secret-input{
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #00ff66;
  font-size: 1rem;
  caret-color: #00ff66;
}
.console-input input#console-secret-input::placeholder{
  color:#007a3a; opacity:.45;
}

/* etiqueta secreta dorada */
.secret-tag { color: #FFD700; } /* dorado */

/* ========== Newsletter sticky ========== */
.newsletter {
  background: black;
  color: #00ff66;
  padding: 30px 20px;
  text-align: center;
  border-top: 1px solid rgba(0,255,102,.25);
}
.sticky-newsletter { position: sticky; bottom: 0; z-index: 5; }
.newsletter input {
  padding: 10px; font-size: 1rem; margin-top: 10px; width: 300px; max-width: 90%;
  background: black; color: #00ff66; border: 1px solid #00ff66; outline: none; border-radius:6px;
}
.newsletter input::placeholder { color: #0f9b56; }
.newsletter button {
  margin-left: 8px; background: #00ff66; color: black; border: none;
  padding: 10px 20px; cursor: pointer; font-family: monospace; border-radius: 8px;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow .18s ease;
  box-shadow: 0 10px 24px rgba(0,255,102,.12);
}
.newsletter button:hover { background: #00cc55; transform: translateY(-1px); box-shadow: 0 14px 30px rgba(0,255,102,.2); }

/* ========== Modal consentimiento newsletter (EN) ========== */
#consent-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: none; align-items: center; justify-content: center; z-index: 9999;
}
#consent-modal {
  width: min(92vw, 560px);
  background: #000;
  color: #00ff66;
  border: 1px solid rgba(0,255,102,.35);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 24px 72px rgba(0,255,102,.20);
}
#consent-modal h3 { margin: 0 0 8px; }
#consent-modal p { margin: 0 0 10px; color: #79ffb0; }
#consent-modal a { color: #79ffb0; }
#consent-modal .consent-row { display:flex; gap:8px; align-items:center; margin:10px 0 14px; }
#consent-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:6px; }
#consent-error { color:#ff6b6b; min-height:18px; margin-top:6px; }

/* ========== Inputs (checkout/newsletter) ========== */
input, select, textarea { font-family: monospace; }
#chk-name, #chk-email, #chk-address, #chk-zip, #chk-method {
  background: #000; color: #00ff66; border: 1px solid #00ff66; padding: 10px;
  margin-top: 8px; border-radius: 8px; width: 100%; box-sizing: border-box;
}
#chk-method { appearance: none; -webkit-appearance: none; -moz-appearance: none; }
#chk-name:focus, #chk-email:focus, #chk-address:focus, #chk-zip:focus, #chk-method:focus {
  outline: none; border-color: #00cc55; box-shadow: 0 0 8px #00ff66;
}

/* ========== Productos ========== */
.shop-grid { display: flex; gap: 30px; flex-wrap: wrap; padding: 20px; justify-content: center; }
.product {
  border: 1px solid #00ff66; padding: 20px; width: 220px; text-align: center; background-color: black;
  transition: transform 0.3s ease, box-shadow .3s ease;
  border-radius: 12px; box-shadow: 0 12px 36px rgba(0,255,102,.08);
}
.product:hover { transform: scale(1.03); box-shadow: 0 16px 42px rgba(0,255,102,.16); }
.product img { width: 100%; height: auto; cursor: pointer; border-radius: 8px; }
.product button {
  margin-top: 10px; background: #00ff66; color: black; border: none; padding: 8px 15px; cursor: pointer;
  border-radius: 8px; transition: background 0.2s ease, transform 0.2s ease, box-shadow .2s ease;
  box-shadow: 0 10px 24px rgba(0,255,102,.12);
}
.product button:hover { background: #00cc55; transform: translateY(-1px); box-shadow: 0 14px 30px rgba(0,255,102,.2); }
select {
  margin-top: 10px; padding: 6px 8px; background: black; color: #00ff66; border: 1px solid #00ff66; border-radius: 8px;
}

/* ========== Drawer del carrito (slide-in right) ========== */
#cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
  display: none; z-index: 9997;
}
#cart-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(460px, 92vw);
  background: #000; color: #00ff66; border-left: 1px solid #00ff66;
  box-shadow: -20px 0 60px rgba(0,255,102,.12);
  transform: translateX(100%); transition: transform .28s ease-out;
  z-index: 9998; display: flex; flex-direction: column; border-top-left-radius: 12px; border-bottom-left-radius: 12px;
}
#cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 16px 18px; border-bottom: 1px solid rgba(0,255,102,.35);
  background: linear-gradient(180deg, rgba(0,255,102,.07), rgba(0,255,102,0));
}
.cart-drawer-header h2 { margin: 0; font-size: 1.15rem; letter-spacing: .4px; }
.btn-close {
  background: transparent; border: 1px solid #00ff66; color: #9feabf;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.btn-close:hover { background: #00ff66; color: #001a0c; }

.cart-drawer-body {
  padding: 14px 18px 8px;
  overflow-y: auto;
  flex: 1;
}
.cart-drawer-footer {
  padding: 14px 18px 24px; /* un poco más alto para móviles */
  border-top: 1px solid rgba(0,255,102,.35);
  background: linear-gradient(180deg, rgba(0,255,102,.05), rgba(0,0,0,1));
}
@media (max-width: 520px) {
  .cart-drawer-footer { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}

/* === CART ROW: layout estable en una sola línea (grid) === */
#cart-drawer #cart-items .cart-row{
  display: grid !important;
  grid-template-columns: 1fr max-content; /* texto elástico + controles fijos */
  align-items: center;
  column-gap: 8px;
  margin-bottom: 12px;
}
#cart-drawer #cart-items .cart-row .info{
  min-width: 0; /* para que funcione elipsis en grid */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cart-drawer #cart-items .cart-row .controls{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap; /* evita saltos de línea */
  flex-wrap: nowrap;
}
#cart-drawer #cart-items .cart-row .controls .qty-btn,
#cart-drawer #cart-items .cart-row .controls .remove-btn{
  background: #111; color: #00ff66; border: 1px solid #00ff66;
  padding: 4px 8px; line-height: 1; border-radius: 6px; flex: 0 0 auto;
}
#cart-drawer #cart-items .cart-row .controls .qty-btn:hover,
#cart-drawer #cart-items .cart-row .controls .remove-btn:hover{
  background: #00ff66; color: black;
}
#cart-drawer #cart-items .cart-row .controls span{
  display: inline-block;
  min-width: 22px; text-align: center;
}

/* ========== Total del carrito ========== */
.cart-total-line {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 8px 0 12px; font-size: 1.05rem;
}

/* ========== Botones base ========== */
button {
  background: #00ff66; color: #001a0c; border: none; padding: 10px 20px; cursor: pointer;
  font-family: monospace; border-radius: 8px; transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 10px 24px rgba(0,255,102,.12);
}
button:hover { background: #00cc55; transform: translateY(-1px); box-shadow: 0 14px 30px rgba(0,255,102,.2); }
button:disabled { background: #044d1c; color: #555; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: transparent; color: #00ff66; border: 1px solid #00ff66; padding: 10px 20px; border-radius: 8px; }
.btn-ghost:hover { background: #00ff66; color: #001a0c; }

/* ========== Loaders (intro + entre páginas) ========== */
#hack-screen {
  position: fixed; inset: 0; background: black; color: #00ff66;
  display: flex; align-items: center; justify-content: center; font-family: 'Courier New', monospace; font-size: 2rem;
  z-index: 99999; transition: opacity 0.3s ease-out;
}
#page-loader {
  position: fixed; inset: 0; background: black; display: none; align-items: center; justify-content: center; z-index: 99999;
}
#page-loader img { width: 120px; height: auto; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%{ transform: scale(1); opacity: .8;} 50%{ transform: scale(1.08); opacity: 1;} 100%{ transform: scale(1); opacity:.8;} }

/* Glitch texto (ACCESS GRANTED) */
.glitch-text { position: relative; color: #00ff66; animation: glitch 0.6s infinite; }
@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, 1px); }
  80% { transform: translate(1px, -2px); }
  100% { transform: translate(0); }
}

/* ========== Tablas (admin) ========== */
table { color: #00ff66; width: 100%; border-collapse: collapse; }
thead th { text-align:left; border-bottom:1px solid rgba(0,255,102,.35); padding:8px; background:#001c0d; }
tbody td { border-bottom:1px solid rgba(0,255,102,.15); padding:8px; }
tbody tr:hover { background: rgba(0,255,102,.04); }

/* ========== Ajustes responsive ========== */
@media (max-width: 780px) {
  .logo-center { height: 120px; }
  .logo-left { height: 88px; }
}
@media (max-width: 520px) {
  .logo-center { display: none; }
  .white-bar { padding: 6px 14px; }
}
/* FIX: mostrar textlogo en móvil y escalarlo correctamente */
@media (max-width: 520px) {
  .logo-center {
    display: block !important;    /* vuelve a mostrarse */
    height: 110px;                /* más pequeño para caber */
    width: auto;
    left: 50%;
    transform: translateX(-50%);
    object-fit: contain;
    z-index: 1;                   /* por debajo de los iconos */
    pointer-events: none;         /* que no bloquee clics */
  }
  .top-icons { z-index: 2; }      /* asegúrate de que iconos queden encima */
  .white-bar { padding-right: 70px; } /* deja espacio para el carrito/hamburguesa */
}

/* === FIX móvil: textlogo visible + iconos (carrito/hamburguesa) pegados a la derecha === */
@media (max-width: 520px){
  /* Asegura anclajes relativos dentro de la barra */
  .white-bar{
    position: sticky; /* ya lo tienes, pero reafirmamos el contexto */
    top: 0;
    z-index: 10;
    padding-right: 16px;  /* margen visual, no exagerado para no empujar nada */
  }

  /* El textlogo se ve centrado y no “empuja” el layout */
  .logo-center{
    display: block !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100px;
    width: auto;
    object-fit: contain;
    pointer-events: none;   /* no bloquea toques/clicks */
    z-index: 1;             /* por debajo de los iconos */
  }

  /* Los iconos van ABSOLUTOS a la derecha y centrados verticalmente */
  .top-icons{
    position: absolute;
    right: 12px;            /* pegado al borde derecho */
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;   /* ignora el flex del contenedor principal */
    gap: 12px;
    align-items: center;
    z-index: 2;             /* por encima del textlogo */
  }

  /* Evita que el flex parent “recoloque” los hijos laterales */
  .white-bar > .logo-left{
    flex: 0 0 auto;
  }

  /* Tamaños cómodos en móvil */
  .logo-left{ height: 84px; }
  .cart-icon img, #cart-icon, .cart-icon-img{
    width: 26px;
    height: auto;
  }
  #cart-count, .cart-count{
    font-size: 0.78rem;
    padding: 2px 6px;
    margin-left: 6px;
  }

  /* Si notas solapamientos extremos en móviles muy pequeños, puedes bajar un poco más el textlogo: */
  /* .logo-center { height: 90px; } */
}
/* === Carrito: subir un poco los botones del footer === */
.cart-drawer-footer{
  padding-top: 16px;
  padding-bottom: 36px;              /* más espacio debajo = botones se ven más “arriba” */
}

/* En móviles, subimos aún más para evitar la franja inferior / gestos del SO */
@media (max-width: 520px){
  .cart-drawer-footer{
    padding-bottom: 160px;            /* empuja visualmente los botones hacia arriba */
  }
}

/* Por si algún navegador comprime el padding, garantizamos separación extra */
.cart-drawer-footer > *:last-child{
  margin-bottom: 6px;                /* micro-‘aire’ adicional bajo la última fila de botones */
}

