:root{
  --azul:#12386b;
  --azul-oscuro:#0a2344;
  --dorado:#c89b3c;
  --fondo:#eef3f9;
  --texto:#1f2937;
  --suave:#6b7280;
  --borde:#d8e0ea;
  --verde:#16803c;
  --rojo:#c62828;
  --naranja:#d88900;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(200,155,60,.22), transparent 32%),
    linear-gradient(135deg, #f7f9fc 0%, var(--fondo) 100%);
  color:var(--texto);
  min-height:100vh;
  padding:24px;
}

.contenedor{
  width:100%;
  max-width:760px;
  margin:0 auto;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(255,255,255,.8);
  padding:28px;
  border-radius:24px;
  box-shadow:0 20px 60px rgba(18,56,107,.16);
}

.hero{
  text-align:center;
  padding:26px 20px;
  border-radius:22px;
  color:white;
  background:linear-gradient(135deg, var(--azul-oscuro), var(--azul));
  position:relative;
  overflow:hidden;
}

.hero::after{
  content:"";
  position:absolute;
  width:230px;
  height:230px;
  right:-90px;
  top:-90px;
  border-radius:50%;
  background:rgba(200,155,60,.24);
}

.logo-portada{
  width:95px;
  height:95px;
  object-fit:contain;
  background:white;
  border-radius:50%;
  padding:10px;
  box-shadow:0 8px 25px rgba(0,0,0,.2);
}

h1,h2,h3{ margin-top:0; }

.hero h1{
  margin:14px 0 6px;
  font-size:32px;
  letter-spacing:.5px;
}

.hero h2{
  margin:0;
  font-size:20px;
  color:#f7d98b;
  font-weight:700;
}

.subtitulo{
  margin:12px auto 0;
  max-width:520px;
  color:#e6edf7;
  line-height:1.5;
}

.seccion{
  background:#fff;
  border:1px solid var(--borde);
  border-radius:18px;
  padding:20px;
  margin-top:20px;
}

.seccion h3{
  color:var(--azul);
  margin-bottom:14px;
}

.pasos{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:12px;
}

.pasos li{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:12px;
  background:#f8fafc;
  border-radius:14px;
  border:1px solid #edf1f6;
}

.numero{
  min-width:30px;
  height:30px;
  border-radius:50%;
  background:var(--azul);
  color:white;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:bold;
}

.grid-info{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:14px;
}

.info-card{
  background:#f8fafc;
  border:1px solid #edf1f6;
  border-radius:16px;
  padding:16px;
}

.info-card strong{
  color:var(--azul);
}

.precio{
  font-size:28px;
  color:var(--azul-oscuro);
  font-weight:800;
}

.acciones{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:20px;
}

input,select,button,.btn{
  width:100%;
  padding:14px 16px;
  margin:8px 0;
  border-radius:14px;
  border:1px solid var(--borde);
  font-size:16px;
}

input:focus,select:focus{
  outline:none;
  border-color:var(--azul);
  box-shadow:0 0 0 4px rgba(18,56,107,.12);
}

button,.btn{
  background:linear-gradient(135deg, var(--azul), var(--azul-oscuro));
  color:white;
  border:none;
  cursor:pointer;
  font-weight:bold;
  text-decoration:none;
  text-align:center;
  transition:.2s;
}

button:hover,.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 20px rgba(18,56,107,.22);
}

.btn-secundario{
  background:#eef3f9;
  color:var(--azul);
}

.btn-dorado{
  background:linear-gradient(135deg, #d6aa50, #a87921);
}

.card{
  background:white;
  padding:26px;
  border-radius:22px;
  border:1px solid var(--borde);
  box-shadow:0 15px 40px rgba(18,56,107,.12);
  text-align:center;
}

.estado-badge{
  display:inline-block;
  padding:10px 16px;
  border-radius:999px;
  font-size:18px;
  font-weight:bold;
  margin:10px 0 18px;
}

.pendiente{ color:var(--naranja); background:#fff7e6; }
.validado{ color:var(--verde); background:#eaf8ef; }
.rechazado{ color:var(--rojo); background:#fdecec; }

.datos-card{
  display:grid;
  gap:10px;
  text-align:left;
  margin:18px 0;
}

.dato-linea{
  background:#f8fafc;
  border:1px solid #edf1f6;
  border-radius:14px;
  padding:12px 14px;
}

.dato-linea strong{
  color:var(--azul);
  display:block;
  margin-bottom:3px;
}

#resultado,#ticket{
  display:none;
  margin-top:20px;
}

.ticket-oficial{
  max-width:430px;
  margin:22px auto 0;
  padding:0;
  background:#fff;
  border-radius:26px;
  overflow:hidden;
  text-align:center;
  border:1px solid #e4d2a3;
  box-shadow:0 20px 50px rgba(0,0,0,.14);
}

.ticket-header{
  background:linear-gradient(135deg, var(--azul-oscuro), var(--azul));
  color:white;
  padding:24px 20px 18px;
}

.ticket-logo{
  width:96px;
  height:96px;
  object-fit:contain;
  background:#fff;
  border-radius:50%;
  padding:9px;
  margin-bottom:10px;
}

.ticket-header h1{
  margin:6px 0 0;
  font-size:28px;
  letter-spacing:1px;
}

.ticket-header h2{
  margin:3px 0 0;
  color:#f7d98b;
  font-size:20px;
}

.ticket-body{
  padding:22px;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(200,155,60,.18) 48% 52%, transparent 52% 100%),
    #fff;
}

.ticket-sub{
  color:var(--azul);
  font-weight:bold;
  margin:0 0 10px;
}

.ticket-meta{
  background:#f8fafc;
  border:1px solid #edf1f6;
  border-radius:16px;
  padding:12px;
  margin:14px 0;
  text-align:left;
}

.ticket-datos{
  display:grid;
  gap:10px;
  text-align:left;
  margin:16px 0;
}

.ticket-datos div{
  border-bottom:1px dashed #cfd8e3;
  padding-bottom:8px;
}

.ticket-datos strong{
  color:var(--azul);
}

.codigo{
  color:var(--rojo);
  font-weight:bold;
  font-size:19px;
  letter-spacing:.5px;
}

#qr{
  margin:16px auto;
  width:fit-content;
  padding:10px;
  background:white;
  border:1px solid #e5e7eb;
  border-radius:16px;
}

.ticket-footer{
  background:#f7f1e3;
  padding:14px 22px;
  font-size:13px;
  color:#4b5563;
}

@media(max-width:650px){
  body{ padding:12px; }
  .contenedor{ padding:18px; border-radius:18px; }
  .acciones,.grid-info{ grid-template-columns:1fr; }
  .hero h1{ font-size:26px; }
}

.cantidad-control{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin:8px 0 16px;
}

.cantidad-control input{
  width:90px;
  text-align:center;
  font-size:20px;
  font-weight:bold;
  margin:0;
  padding:12px;
}

.btn-cantidad{
  width:48px !important;
  height:48px;
  min-width:48px;
  padding:0 !important;
  margin:0 !important;
  border-radius:50%;
  font-size:26px;
  display:flex;
  align-items:center;
  justify-content:center;
}





.contador-card{
  display:flex;
  align-items:center;
  gap:18px;
  padding:20px;
  border-radius:18px;
  background:linear-gradient(135deg, #12386b, #0a2344);
  color:white;
  box-shadow:0 15px 35px rgba(18,56,107,.25);
  animation:pulseCard 2s infinite ease-in-out;
}

.contador-icono{
  width:70px;
  height:70px;
  border-radius:50%;
  background:rgba(255,255,255,.15);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:34px;
}

.contador-card p{
  margin:0;
  font-size:16px;
  opacity:.9;
}

.contador-card h2{
  margin:5px 0;
  font-size:42px;
  color:#f7d98b;
}

.contador-card small{
  color:#e6edf7;
}

@keyframes pulseCard{
  0%{ transform:scale(1); }
  50%{ transform:scale(1.015); }
  100%{ transform:scale(1); }
}


button:disabled{
    background:#999 !important;
    cursor:not-allowed;
    opacity:.7;
}


/* RESPONSIVE GENERAL */
@media(max-width:768px){

  body{
    padding:12px;
  }

  .contenedor{
    width:100%;
    padding:16px;
    border-radius:18px;
  }

  .hero{
    padding:22px 14px;
  }

  .logo-portada{
    width:80px;
    height:80px;
  }

  .hero h1{
    font-size:26px;
  }

  .hero h2{
    font-size:18px;
  }

  .subtitulo{
    font-size:14px;
  }

  .seccion{
    padding:16px;
  }

  .grid-info,
  .acciones{
    grid-template-columns:1fr;
  }

  input,
  select,
  button,
  .btn{
    font-size:15px;
    padding:14px;
  }

  .contador-card{
    padding:18px;
    gap:14px;
  }

  .contador-icono{
    width:58px;
    height:58px;
    font-size:28px;
  }

  .contador-card h2{
    font-size:34px;
  }

  .cantidad-control{
    justify-content:center;
  }

  .btn-cantidad{
    width:48px !important;
    height:48px;
  }

  .ticket-oficial{
    width:100%;
    max-width:100%;
    border-radius:18px;
  }

  .ticket-header{
    padding:20px 14px;
  }

  .ticket-logo{
    width:78px;
    height:78px;
  }

  .ticket-header h1{
    font-size:24px;
  }

  .ticket-header h2{
    font-size:18px;
  }

  .ticket-body{
    padding:16px;
  }

  #qr canvas,
  #qr img{
    width:150px !important;
    height:150px !important;
  }

  .card{
    padding:20px 14px;
  }

  .estado-badge{
    font-size:16px;
  }
}

@media(max-width:420px){

  body{
    padding:8px;
  }

  .contenedor{
    padding:12px;
    border-radius:16px;
  }

  .hero h1{
    font-size:23px;
  }

  .hero h2{
    font-size:16px;
  }

  .contador-card{
    flex-direction:column;
    text-align:center;
  }

  .contador-card h2{
    font-size:38px;
  }

  .pasos li{
    font-size:14px;
  }

  .ticket-header h1{
    font-size:21px;
  }

  .codigo{
    font-size:16px;
    word-break:break-word;
  }
}




.modal-agotadas{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.65);
  z-index:9999;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.modal-contenido{
  background:white;
  max-width:420px;
  width:100%;
  padding:28px;
  border-radius:22px;
  text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
}

.modal-contenido h2{
  color:#c40000;
  margin-bottom:12px;
}

.modal-mensaje{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.65);
  z-index:99999;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.modal-mensaje-contenido{
  background:white;
  max-width:430px;
  width:100%;
  padding:28px;
  border-radius:22px;
  text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
}

.modal-mensaje-contenido h2{
  margin-bottom:12px;
  color:#12386b;
}

.modal-mensaje-contenido p{
  font-size:16px;
  color:#1f2937;
  line-height:1.5;
}

.modal-mensaje{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.65);
  z-index:99999;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.modal-mensaje-contenido{
  background:white;
  max-width:430px;
  width:100%;
  padding:28px;
  border-radius:22px;
  text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
}

.modal-mensaje-contenido h2{
  margin-bottom:12px;
  color:#12386b;
}

.modal-mensaje-contenido p{
  font-size:16px;
  color:#1f2937;
  line-height:1.5;
}


.aviso-preventa{
  margin-top:20px;
  padding:22px 18px;
  border-radius:18px;
  text-align:center;
  background:linear-gradient(135deg, #fff1f1, #ffffff);
  border:2px solid #c40000;
  box-shadow:0 12px 30px rgba(196,0,0,.12);
}

.aviso-preventa h2{
  margin:0;
  color:#c40000;
  font-size:30px;
  font-weight:900;
  letter-spacing:1px;
}

.aviso-preventa p{
  margin:8px 0 0;
  color:#1f2937;
  font-size:20px;
  font-weight:bold;
}

@media(max-width:650px){
  .aviso-preventa h2{
    font-size:24px;
  }

  .aviso-preventa p{
    font-size:17px;
  }
}


.preventa-centrada{
  text-align:center;
  border:2px solid #c89b3c;
  background:#fffaf0;
}

.preventa-centrada h3{
  color:#12386b;
  font-size:28px;
  margin-bottom:10px;
  letter-spacing:1.5px;
}

.fecha-preventa-texto{
  display:block;
  color:#8a5a00;
  font-size:21px;
  margin-bottom:16px;
  font-weight:800;
}

.preventa-centrada p{
  font-size:17px;
  margin:10px 0;
}

.barra-superior{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-bottom:20px;
}

.btn-excel{
    background:#15803d;
    padding:12px 22px;
    font-size:15px;
    font-weight:bold;
}