/* =========================
   RESET GENERAL
========================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f1f4f8;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================
   HEADER Y NAVEGACIÓN
========================= */
header {
  background-color: #0056b3;
  color: white;
  padding: 1rem 0.5rem;
  text-align: center;
  position: fixed;
  width: 100%;
  top: 0; left: 0;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Botón INICIAR SESIÓN (fijo al costado del título, sin mover diseño) */
.btn-login-header {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #00408a;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.25);
  transition: background-color .3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 10000;
  font-size: 0.95rem;
}
.btn-login-header:hover { background-color: #023e73; }
.btn-login-header:visited { color: #fff !important; }

nav ul {
  display: flex;
  justify-content: center;
  background-color: #00408a;
  list-style: none;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

nav ul li { margin: 0 1.2rem; }

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active { background-color: #023e73; }

/* =========================
   MAIN
========================= */
main {
  padding: 2rem 1rem 3rem;
  margin-top: 130px;
  max-width: 1200px;
  margin-left: auto; margin-right: auto;
}

/* =========================
   SECCIONES
========================= */
.seccion { display: none; opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s ease; }
.seccion-activa { display: block; opacity: 1; transform: translateY(0); }

.seccion h2 {
  position: relative; display: inline-block;
  font-size: 2rem; color: #003d7a; margin-bottom: 1.5rem;
  animation: subirTexto 1.2s ease forwards; animation-delay: .2s; opacity: 0;
  text-transform: uppercase; letter-spacing: 1px;
}
.seccion h2::after {
  content: ""; position: absolute; top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: skewX(-20deg); animation: brillo 3s infinite;
}

/* =========================
   PROMOCIONES
========================= */
.promo { position: relative; margin-bottom: 2rem; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 14px rgba(0,0,0,0.15); }
.promo img { width: 100%; max-height: 300px; object-fit: cover; display: block; border-radius: 12px; transition: transform .8s ease; }
.promo:hover img { transform: scale(1.08); }

.promo-texto {
  position: absolute; bottom: 20px; left: 20px;
  background: rgba(0, 0, 0, 0.5);
  color: white; padding: 1rem 1.5rem; font-size: 1.2rem; font-weight: 700;
  border-radius: 10px; box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
  transition: all .5s ease; animation: subirTexto 1.2s ease forwards; animation-delay: .3s; opacity: 0;
}
.promo:hover .promo-texto { background: rgba(0, 0, 0, 0.7); transform: scale(1.05); box-shadow: 0 0 25px rgba(0,0,0,0.6); }

@keyframes subirTexto { 0%{opacity:0; transform:translateY(30px);} 60%{opacity:1; transform:translateY(-5px);} 100%{opacity:1; transform:translateY(0);} }
@keyframes brillo { 0%{left:-75%;} 100%{left:125%;} }

/* =========================
   PRODUCTOS
========================= */
.productos { display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center; }

.producto {
  background-color: white; border-radius: 12px; box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  width: 220px; padding: 1rem; text-align: center;
  transition: transform .3s ease, box-shadow .3s ease, opacity .4s ease;
  opacity: 0; transform: translateY(20px);
  position: relative;              /* contenedor del ribbon */
  overflow: hidden;                /* impide que la cinta se salga del card */
}
.seccion-activa .producto { opacity: 1; transform: translateY(0); }
.producto:hover { transform: scale(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); transition: .2s; }

.producto img {
  width: 100%; height: 140px; object-fit: contain; margin-bottom: .8rem;
  position: relative; z-index: 1;
}
.producto h3 { margin-bottom: .5rem; color: #003d7a; }
.producto p { color: #555; font-weight: 600; margin-bottom: 1rem; }

.producto button {
  background-color: #0056b3; color: white; border: none;
  padding: 0.6rem 0; width: 100%; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: 600;
  transition: background-color .3s ease;
}
.producto button:hover { background-color: #023e73; }
.producto .descripcion { font-size: 0.9rem; color: #444; margin-bottom: 1rem; line-height: 1.3; }

/* Oculta cualquier div antiguo que agregue la cinta desde JS */
.ribbon-agotado { display: none !important; }

/* CINTA DIAGONAL "AGOTADO" (no mueve el contenido) */
.producto.agotado::before{
  content:"AGOTADO";
  position:absolute;
  top:10px;              /* subir/bajar la franja */
  left:-36px;            /* meter/sacar desde la izquierda */
  width:200px;           /* largo de la franja para card de 220px */
  transform:rotate(-35deg);
  background:#dc3545;
  color:#fff;
  text-align:center;
  padding:8px 0;
  font-weight:900;
  letter-spacing:1px;
  text-transform:uppercase;
  border-top:1px solid rgba(255,255,255,.35);
  border-bottom:1px solid rgba(0,0,0,.2);
  box-shadow:0 6px 14px rgba(0,0,0,.2);
  z-index:2;             /* por encima de la imagen */
}

/* Atenúa la imagen cuando está agotado (opcional) */
.producto.agotado img{ filter:grayscale(.25) contrast(.97); }

/* =========================
   CARRITO
========================= */
#carrito {
  position: fixed; top: 120px; right: -380px;
  width: 340px; max-height: 460px; background-color: white;
  border-radius: 12px 0 0 12px; box-shadow: -4px 0 25px rgba(0,0,0,0.25);
  padding: 1rem; overflow-y: auto; z-index: 99999; transition: right .4s ease;
}
#carrito.mostrar { right: 20px; }
#carrito h3 { text-align: center; margin-bottom: 1rem; color: #0056b3; font-weight: 700; }

#lista-carrito { list-style: none; margin-bottom: 1rem; }

#lista-carrito li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #ddd;
  font-weight: 600;
}
#lista-carrito li .col.precio,
#lista-carrito li .col.cantidad { white-space: nowrap; }

#total-carrito {
  font-weight: 700; font-size: 1.2rem; margin-bottom: 1rem; text-align: center; color: #004080;
}

#carrito button {
  background-color: #0056b3; color: white; border: none;
  padding: 0.7rem; border-radius: 8px; cursor: pointer; font-weight: 700; width: 100%; margin-top: 0.5rem;
  transition: background-color .3s ease;
}
#carrito button:hover { background-color: #023e73; }

#input-cupon {
  width: 100%; padding: 0.5rem 10px; margin-bottom: 0.5rem; border-radius: 8px; border: 2px solid #0056b3;
}

/* =========================
   BOTÓN WHATSAPP
========================= */
.btn-whatsapp {
  position: fixed; bottom: 20px; right: 20px; background-color: #25d366; color: white;
  font-size: 2.8rem; border-radius: 50%; padding: 0.3rem 0.4rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); z-index: 10000; transition: background-color .3s ease, transform .2s ease;
  text-decoration: none;
}
.btn-whatsapp:hover { background-color: #1ebe57; transform: scale(1.05); }

/* =========================
   BUSCADOR
========================= */
.buscador-container { margin: 20px 0 30px 0; width: 100%; max-width: 400px; position: relative; margin-left: auto; margin-right: auto; }
.buscador-container input {
  width: 100%; padding: 10px 40px 10px 55px; font-size: 1rem; border: 2px solid #ccc; border-radius: 30px;
  outline: none; transition: border-color .3s ease, box-shadow .3s ease; color: #333;
}
.buscador-container input::placeholder { text-indent: 25px; color: #999; }
.buscador-container::before {
  content: "🔍"; position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  font-size: 1.2rem; color: #999; pointer-events: none;
}
.buscador-container input:focus { border-color: #007bff; box-shadow: 0 0 8px rgba(0, 123, 255, 0.5); }

/* =========================
   QUIÉNES SOMOS / PROMOS
========================= */
.quienes-somos {
  background: #e9f2ff;
  padding: 1.5rem;
  text-align: justify;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.quienes-somos h2 { color: #003d7a; margin-bottom: 1rem; font-size: 1.8rem; text-transform: uppercase; }
.quienes-somos p { color: #333; font-size: 1rem; margin-bottom: 0.7rem; line-height: 1.6; }

.promociones-vigentes {
  background: #f8fbff;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  text-align: center;
}
.promociones-vigentes h2 { color: #003d7a; margin-bottom: 1.2rem; font-size: 1.8rem; text-transform: uppercase; }

.promos-container {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem;
}
.promo-card {
  background: #fff; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 1rem; width: 230px; text-align: center;
  transition: transform .3s ease, box-shadow .3s ease;
}
.promo-card:hover { transform: scale(1.03); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.promo-card img {
  width: 100%; height: 130px; object-fit: cover; border-radius: 8px; margin-bottom: 0.6rem;
}
.promo-card p { font-weight: 600; color: #003d7a; margin-bottom: 0.3rem; }
.promo-card span { color: #555; font-size: 0.9rem; display: block; margin-bottom: 0.6rem; }
.promo-card .precio { margin: 0.35rem 0 0.6rem; color: #003d7a; font-weight: 700; }
.promo-card button {
  background-color: #0056b3; color: white; border: none; padding: 0.6rem 1rem; border-radius: 8px; font-weight: 600;
  cursor: pointer; transition: background-color .3s ease; width: 100%;
}
.promo-card button:hover { background-color: #023e73; }

/* =========================
   FOOTER
========================= */
footer {
  background-color: #00408a; color: white; text-align: center; padding: 1.5rem 0.5rem; margin-top: auto;
}
.footer-container {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.5rem;
}
.footer-container h4 { font-size: 1.1rem; margin-bottom: 0.6rem; }
.footer-container .social a img, .footer-container .pagos img {
  width: 40px; height: 40px; margin: 0 0.5rem; transition: transform .3s ease; border-radius: 8px;
}
.footer-container .social a img:hover, .footer-container .pagos img:hover { transform: scale(1.15); }
.copy { font-size: 0.85rem; opacity: 0.85; margin-top: 0.8rem; }

/* =========================
   RESPONSIVE (Móvil)
========================= */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  .btn-login-header {
    position: static;
    transform: none;
    margin-top: 0.5rem;
    background-color: #00408a;
    color: #fff !important;
    border: 1.5px solid rgba(255,255,255,0.25);
    display: inline-block;
    padding: 0.4rem 0.9rem;
  }

  nav ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .4rem;
    padding: .5rem .6rem;
    margin-top: 0.5rem;
  }
  nav ul li { margin: 0; }
  nav ul li a {
    display: block;
    text-align: center;
    padding: .5rem .4rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.15);
    white-space: nowrap;
  }

  .productos { justify-content: center; gap: 1rem; }
  .producto { width: 160px; padding: 0.8rem; }
  .producto button { font-size: 0.9rem; padding: 0.5rem; }

  #carrito { width: 90%; right: -100%; top: 90px; max-height: 350px; border-radius: 12px; }
  #carrito.mostrar { right: 5%; }

  /* Compensación por header fijo en móvil */
  main { margin-top: 180px !important; }

  /* Ribbon más compacto en móvil */
  .producto.agotado::before {
    top: 8px;
    left: -30px;
    width: 170px;
    padding: 7px 0;
    font-size: 0.9rem;
  }
}

/* =========================
   MODAL DETALLE DE PRODUCTO
========================= */
.mdet.hidden { display: none; }
.mdet{
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100000;
}
.mdet-card{
  width: 95%; max-width: 620px; background: #fff; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  border: 2px solid #0056b3; padding: 1rem 1rem 1.2rem;
  animation: mdetPop .15s ease-out;
}
@keyframes mdetPop { from { transform: scale(.98); opacity:.95; } to { transform: scale(1); opacity:1; } }

.mdet-close{
  background: transparent; border: none; color: #0056b3;
  font-size: 1.6rem; font-weight: 700; cursor: pointer; float: right; line-height: 1;
}
.mdet-body{ display: flex; gap: 1rem; align-items: flex-start; }
.mdet-body img{
  width: 130px; height: 130px; object-fit: contain; border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.1); background: #f8fbff;
}
.mdet-info h3{ margin: 0 0 .25rem; color: #003d7a; }
.mdet-precio{ color: #004080; font-weight: 800; margin: .25rem 0 .5rem; }
.mdet-desc{ color: #333; line-height: 1.45; margin: .35rem 0 .75rem; }
.mdet-actions{
  display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .2rem;
}
.mdet-primary, .mdet-secondary{
  padding: .8rem; border-radius: 10px; font-weight: 800; border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); transition: transform .1s ease, filter .2s ease;
}
.mdet-primary{ background: #0056b3; color: #fff; }
.mdet-primary:hover{ filter: brightness(.95); transform: translateY(-1px); }
.mdet-secondary{ background: #e9f2ff; color: #003d7a; border: 2px solid #0056b3; }
.mdet-secondary:hover{ filter: brightness(.98); transform: translateY(-1px); }

/* ====== Admin: textarea de descripción (base) ====== */
#form-agregar-producto textarea{
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 2px solid #ccc;
  outline: none;
  resize: vertical;
  min-height: 90px;
  transition: border-color .2s ease, box-shadow .2s ease;
  font-family: inherit;
}
#form-agregar-producto textarea:focus{
  border-color:#007bff;
  box-shadow: 0 0 6px rgba(0,123,255,.25);
}

/* =========================================================
   PANEL ADMIN – Estilos visuales (scope: #admin)
========================================================= */
#admin {
  --adm-bg: #f4f7ff;
  --adm-card-bg: #ffffff;
  --adm-primary: #0056b3;
  --adm-primary-2: #023e73;
  --adm-accent: #2563eb;
  --adm-border: #e6ecf5;
  --adm-text: #0f172a;
  --adm-muted: #6b7280;
}

/* Tarjetas contenedoras dentro del admin */
#admin .admin-card {
  background: var(--adm-card-bg);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
  padding: 1.25rem 1.25rem 1.35rem;
  max-width: 980px;
  margin: 1rem auto 1.2rem;
  position: relative;
}

/* Títulos admin */
#admin h2 { color: var(--adm-primary); letter-spacing: .5px; margin-bottom: 1rem; }
#admin h3 { color: var(--adm-primary-2); margin: .6rem 0 1rem; }

/* LOGIN admin */
#admin #login-panel form {
  display: grid;
  gap: .8rem;
  align-items: center;
  grid-template-columns: 1fr auto;
}
#admin #login-panel label { font-weight: 600; color: var(--adm-muted); }

/* 👇 Añadido: estilos también para input[type="text"] (usuario) */
#admin #login-panel input[type="password"],
#admin #login-panel input[type="text"] {
  grid-column: 1 / -1;
  width: 100%;
  padding: .7rem .9rem;
  border: 2px solid var(--adm-border);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
#admin #login-panel input[type="password"]:focus,
#admin #login-panel input[type="text"]:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 4px rgba(0,86,179,.12);
}

#admin #login-panel button[type="submit"] {
  justify-self: start;
  background: var(--adm-primary);
  color: #fff;
  border: 0;
  padding: .65rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
#admin #login-panel button[type="submit"]:hover {
  filter: brightness(.96);
  transform: translateY(-1px);
}
#login-error { margin-top: .4rem; }

/* FORM AGREGAR PRODUCTO */
#admin #form-agregar-producto {
  background: linear-gradient(180deg, #f9fbff, #f4f7ff);
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  gap: .8rem;
  grid-template-columns: 1fr 1fr;
}
#admin #form-agregar-producto select,
#admin #form-agregar-producto input[type="text"],
#admin #form-agregar-producto input[type="number"],
#admin #form-agregar-producto textarea {
  width: 100%;
  padding: .7rem .9rem;
  border: 2px solid var(--adm-border);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  font: inherit;
  color: var(--adm-text);
  background: #fff;
}
#admin #form-agregar-producto textarea { grid-column: 1 / -1; min-height: 96px; }
#admin #form-agregar-producto select:focus,
#admin #form-agregar-producto input:focus,
#admin #form-agregar-producto textarea:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 4px rgba(0,86,179,.10);
}
#admin #form-agregar-producto button[type="submit"] {
  grid-column: 1 / -1;
  background: var(--adm-primary);
  color: #fff;
  border: 0;
  padding: .75rem 1.1rem;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,86,179,.18);
  transition: transform .08s ease, filter .15s ease, box-shadow .2s ease;
}
#admin #form-agregar-producto button[type="submit"]:hover {
  filter: brightness(.97);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,86,179,.22);
}

/* LISTADO DE PRODUCTOS */
#admin #listado-productos-admin h4 {
  margin: 1rem 0 .6rem;
  color: var(--adm-primary);
  font-size: 1.02rem;
  letter-spacing: .2px;
}
#admin #listado-productos-admin ul {
  list-style: none;
  display: grid;
  gap: .55rem;
  margin-bottom: 1rem;
  padding-left: 0;
}
#admin #listado-productos-admin li {
  background: #fff;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: .6rem .7rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,.04);
}
#admin #listado-productos-admin li button {
  background: #eef4ff;
  color: var(--adm-primary-2);
  border: 1px solid #dbe7ff;
  border-radius: 9px;
  padding: .45rem .7rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, transform .08s ease, box-shadow .2s ease;
}
#admin #listado-productos-admin li button:hover {
  background: #e6f0ff;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(2,62,115,.12);
}
#admin #listado-productos-admin li button:nth-child(2) {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}
#admin #listado-productos-admin li button:nth-child(2):hover {
  background: #fecaca;
  box-shadow: 0 6px 12px rgba(185,28,28,.12);
}

/* EDITOR INLINE */
#admin .editor-inline {
  margin-top: .55rem;
  background: #fafcff;
  border: 1px dashed #cfe0ff;
  border-radius: 10px;
  padding: .7rem;
  display: grid;
  gap: .55rem;
  grid-template-columns: 1fr 140px;
}
#admin .editor-inline input[type="text"],
#admin .editor-inline input[type="number"],
#admin .editor-inline textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 2px solid var(--adm-border);
  border-radius: 8px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  font: inherit;
}
#admin .editor-inline textarea { grid-column: 1 / -1; min-height: 80px; }
#admin .editor-inline input:focus,
#admin .editor-inline textarea:focus {
  border-color: var(--adm-accent);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
#admin .editor-inline label span { font-weight: 600; color: var(--adm-muted); }
#admin .editor-inline button {
  background: var(--adm-primary);
  color: #fff;
  border: 0;
  padding: .55rem .9rem;
  border-radius: 9px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
#admin .editor-inline button:hover { filter: brightness(.96); transform: translateY(-1px); }
#admin .editor-inline button + button {
  background: #e9f2ff;
  color: var(--adm-primary-2);
  border: 1px solid #d6e6ff;
}

/* BOTÓN CERRAR SESIÓN */
#admin #admin-panel > button {
  margin-top: .6rem;
  background: #0f172a;
  color: #fff;
  border: 0;
  padding: .65rem 1rem;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
#admin #admin-panel > button:hover { filter: brightness(.98); transform: translateY(-1px); }

/* Responsive admin */
@media (max-width: 768px) {
  #admin .admin-card { padding: 1rem; }
  #admin #form-agregar-producto { grid-template-columns: 1fr; }
  #admin .editor-inline { grid-template-columns: 1fr; }
  #admin #login-panel form { grid-template-columns: 1fr; }
  #admin #listado-productos-admin li { grid-template-columns: 1fr auto; }
}

/* Botón cerrar del carrito */
#carrito .carrito-cerrar{
  position: absolute;
  top: 8px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #e9f2ff;
  color: #003d7a;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: transform .08s ease, filter .15s ease;
}
#carrito .carrito-cerrar:hover{ transform: translateY(-1px); filter: brightness(.97); }

/* Overlay del carrito (clic para cerrar) */
#carrito-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 99997; /* debajo del panel (#carrito tiene 99999) */
}
#carrito-overlay.visible{
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   MEJORAS VISUALES EXTRAS
   (compatibles, no rompen tu diseño)
========================= */

/* Input cupón deshabilitado (cuando ya se aplicó) */
#input-cupon[disabled]{
  background: #f3f6fb;
  border-color: #9db7e3;
  color: #5f6b7a;
  cursor: not-allowed;
  opacity: .75;
  
}


/* Accesibilidad: foco visible en el botón cerrar del carrito */
#carrito .carrito-cerrar:focus{
  outline: 3px solid rgba(0,86,179,.35);
  outline-offset: 2px;
}

/* Asegura que el “slide” del carrito sea suave en Safari/iOS */
#carrito{
  will-change: right;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* En pantallas pequeñas, que el botón “×” sea fácil de tocar */
@media (max-width: 768px){
  #carrito .carrito-cerrar{
    top: 6px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
}

/* =========================================================
   🔧 AÑADIDOS COMPATIBLES: botón “×” del MODAL DETALLE
   (no altera tu diseño; solo asegura que sea clickeable y visible)
========================================================= */

/* Necesario para posicionar el botón dentro de la tarjeta */
.mdet-card{
  position: relative;            /* añadido */
  padding-right: 3rem;           /* deja espacio para la “×” sin tapar el título */
}

/* Botón “×” del modal: área grande de toque y contraste sutil */
.mdet-close{
  position: absolute;            /* antes flotaba; ahora fijo arriba a la derecha */
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e9f2ff;
  color: #003d7a;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: transform .08s ease, filter .15s ease, background-color .15s ease;
  z-index: 1;                    /* por encima del contenido del modal */
}

.mdet-close:hover{
  transform: translateY(-1px);
  filter: brightness(.97);
  background: #dfeafc;
}

.mdet-close:focus{
  outline: 3px solid rgba(0,86,179,.35);
  outline-offset: 2px;
}

/* En móvil, un poquito más grande */
@media (max-width: 768px){
  .mdet-close{
    top: 6px;
    right: 8px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 24px;
  }
}

/* =========================
   FLYER INICIO (Portada)
========================= */
.flyer-inicio {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem auto;
  width: 100%;
  max-width: 1000px;
}

.flyer-inicio img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flyer-inicio img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.45);
}
/* Ajustes generales móviles para que nada se desborde */
@media (max-width: 768px) {
  /* Títulos y textos grandes */
  .seccion h2 {
    font-size: 1.4rem;      /* antes 2rem */
    margin-bottom: 1rem;
  }
  .quienes-somos h2 { font-size: 1.35rem; }
  .quienes-somos p {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  /* Flyer (portada) */
  .flyer-inicio { 
    margin: 1rem auto; 
    max-width: 100%;
    padding: 0 .5rem;        /* pequeño respiro lateral */
  }
  .flyer-inicio img {
    border-radius: 12px;
    max-height: 48vh;        /* evita que tape todo el scroll */
    object-fit: contain;     /* no se deforma */
  }

  /* Promos de inicio (tarjetas) */
  .promociones-vigentes { padding: 1rem; }
  .promos-container { gap: 1rem; }
  .promo-card { width: 100%; max-width: 320px; margin: 0 auto; }
  .promo-card img { height: 120px; object-fit: cover; }

  /* Banners grandes de inicio */
  .promo img { max-height: 200px; }

  /* Productos más compactos ya lo tienes,
     pero aseguramos que nunca se desborden */
  .producto img { max-height: 120px; }
  /* Mensajes debajo del input de cupón */
#cupon-msg{
  margin-top: .25rem;
  font-size: .92rem;
  font-weight: 600;
}
#cupon-msg.success{ color:#0f766e; }   /* verde */
#cupon-msg.error{   color:#b91c1c; }   /* rojo  */

/* Borde rojo si hay error en el input */
#input-cupon.input-error{
  border-color:#dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}

/* Pill “Cupón aplicado” (opcional, bonito) */
.badge-cupon{
  display:inline-block;
  margin-top:.4rem;
  background:#e6fffa;
  color:#065f46;
  border:1px solid #99f6e4;
  padding:.25rem .5rem;
  border-radius:9999px;
  font-weight:800;
  font-size:.8rem;
}

/* Botón estilo contorno (por si lo usas en promos/admin) */
.btn-outline{
  background:#fff;
  color:#0056b3;
  border:2px solid #0056b3;
}
.btn-outline:hover{ background:#f0f6ff; }

}
#cupon-msg {
  display: block;
  font-size: 0.85rem;
  margin-top: 4px;
  text-align: center;
}
#cupon-msg.success {
  color: #16a34a; /* verde */
}
#cupon-msg.error {
  color: #dc2626; /* rojo */
}


/* =========================================================
   CUPONES (ADMIN) – estilos del formulario y el <select>
   Pegar al final del archivo
========================================================= */
#cupon-admin {
  background: var(--adm-card-bg);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
}

#cupon-admin h3 {
  color: var(--adm-primary-2);
  margin-bottom: .8rem;
}

#cupon-admin #form-cupon {
  display: block;           /* ya usas grid con <div> interno; mantenemos simple */
}

#cupon-admin #form-cupon label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-weight: 600;
  color: var(--adm-muted);
}

/* inputs y select del form de cupón (incluye #cup-plataforma) */
#cupon-admin #form-cupon input[type="text"],
#cupon-admin #form-cupon input[type="number"],
#cupon-admin #form-cupon input[type="datetime-local"],
#cupon-admin #form-cupon select {
  width: 100%;
  padding: .7rem .9rem;
  border: 2px solid var(--adm-border);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  font: inherit;
  color: var(--adm-text);
  background: #fff;
}

/* foco consistente */
#cupon-admin #form-cupon input:focus,
#cupon-admin #form-cupon select:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 4px rgba(0,86,179,.10);
}

/* botón crear cupón */
#cupon-admin #form-cupon button[type="submit"],
#cupon-admin #form-cupon button {
  background: var(--adm-primary);
  color: #fff;
  border: 0;
  padding: .75rem 1.1rem;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,86,179,.18);
  transition: transform .08s ease, filter .15s ease, box-shadow .2s ease;
}
#cupon-admin #form-cupon button:hover {
  filter: brightness(.97);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,86,179,.22);
}

/* Mensaje de respuesta del cupón */
#cupon-admin #cup-resp {
  font-weight: 700;
  margin-top: .25rem;
  display: inline-block;
}

/* select con carita limpia (opcional) */
#cup-plataforma {
  appearance: none;
  background-color: #fff;
  background-image: none; /* puedes poner un ícono de caret si quieres */
}

/* estado de error reutilizable para cualquier input/select del admin */
#admin .input-error,
#admin .input-error:focus,
#admin #form-cupon .input-error,
#admin #form-cupon .input-error:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 4px rgba(220,38,38,.12) !important;
}

/* responsive: que no se pegue a los bordes en móvil */
@media (max-width: 768px){
  #cupon-admin {
    margin-left: .5rem;
    margin-right: .5rem;
  }
}

/* ===== POPUP SORTEO ===== */

.popup-sorteo {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.popup-sorteo-content {
  position: relative;            /* 👈 IMPORTANTE para posicionar la X */
  background: #ffffff;
  padding: 1.8rem 1.5rem 1.4rem;
  border-radius: 14px;
  max-width: 420px;
  width: 92%;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
  animation: popupZoom .28s ease;
}

@keyframes popupZoom {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.popup-img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 1rem;
  object-fit: cover;
}

.popup-btn {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.7rem 1.5rem;
  background: #0a4cbc;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.popup-btn:hover {
  background: #073a8f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

/* 🔴 BOTÓN X – bien visible arriba a la derecha */
.popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background .15s ease, transform .1s ease;
}

.popup-close:hover {
  background: #d1d5db;
  transform: scale(1.05);
}

.popup-close:active {
  transform: scale(0.96);
}
/* =========================
   RESET GENERAL
========================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f1f4f8;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================
   HEADER Y NAVEGACIÓN
========================= */
header {
  background-color: #0056b3;
  color: white;
  padding: 1rem 0.5rem;
  text-align: center;
  position: fixed;
  width: 100%;
  top: 0; left: 0;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Botón INICIAR SESIÓN (fijo al costado del título, sin mover diseño) */
.btn-login-header {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #00408a;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.25);
  transition: background-color .3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 10000;
  font-size: 0.95rem;
}
.btn-login-header:hover { background-color: #023e73; }
.btn-login-header:visited { color: #fff !important; }

nav ul {
  display: flex;
  justify-content: center;
  background-color: #00408a;
  list-style: none;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

nav ul li { margin: 0 1.2rem; }

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active { background-color: #023e73; }

/* =========================
   MAIN
========================= */
main {
  padding: 2rem 1rem 3rem;
  margin-top: 130px;
  max-width: 1200px;
  margin-left: auto; margin-right: auto;
}

/* =========================
   SECCIONES
========================= */
.seccion { display: none; opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s ease; }
.seccion-activa { display: block; opacity: 1; transform: translateY(0); }

.seccion h2 {
  position: relative; display: inline-block;
  font-size: 2rem; color: #003d7a; margin-bottom: 1.5rem;
  animation: subirTexto 1.2s ease forwards; animation-delay: .2s; opacity: 0;
  text-transform: uppercase; letter-spacing: 1px;
}
.seccion h2::after {
  content: ""; position: absolute; top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: skewX(-20deg); animation: brillo 3s infinite;
}

/* ===== BANNERS ===== */
.promo {
  position: relative;
  margin: 1rem auto;
  max-width: 900px;            /* límite general para PC */
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}

.promo img {
  width: 100%;
  height: auto;                /* mantiene proporción natural */
  display: block;
  object-fit: cover;
  border-radius: 12px;
}

/* Texto dentro del banner */
.promo-texto {
  position: absolute;
  bottom: 10%;
  left: 8%;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}


/* =====📱 VISTA MÓVIL ===== */
@media (max-width: 480px) {
  .promo {
    border-radius: 10px;
    max-height: 260px;
  }

  .promo img {
    height: 100%;
    object-fit: cover;
  }

  .promo-texto {
    font-size: 0.7rem;      /* 👈 texto más pequeño */
    left: 6%;
    bottom: 10%;
    max-width: 75%;
    line-height: 1.25;
    padding: 0.3rem 0.6rem; /* menos “bloque” sobre la imagen */
  }
}


/* =========================
   PRODUCTOS
========================= */
.productos { display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center; }

.producto {
  background-color: white; border-radius: 12px; box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  width: 220px; padding: 1rem; text-align: center;
  transition: transform .3s ease, box-shadow .3s ease, opacity .4s ease;
  opacity: 0; transform: translateY(20px);
  position: relative;              /* contenedor del ribbon */
  overflow: hidden;                /* impide que la cinta se salga del card */
}
.seccion-activa .producto { opacity: 1; transform: translateY(0); }
.producto:hover { transform: scale(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); transition: .2s; }

.producto img {
  width: 100%; height: 140px; object-fit: contain; margin-bottom: .8rem;
  position: relative; z-index: 1;
}
.producto h3 { margin-bottom: .5rem; color: #003d7a; }
.producto p { color: #555; font-weight: 600; margin-bottom: 1rem; }

.producto button {
  background-color: #0056b3; color: white; border: none;
  padding: 0.6rem 0; width: 100%; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: 600;
  transition: background-color .3s ease;
}
.producto button:hover { background-color: #023e73; }
.producto .descripcion { font-size: 0.9rem; color: #444; margin-bottom: 1rem; line-height: 1.3; }

/* Oculta cualquier div antiguo que agregue la cinta desde JS */
.ribbon-agotado { display: none !important; }

/* CINTA DIAGONAL "AGOTADO" (no mueve el contenido) */
.producto.agotado::before{
  content:"AGOTADO";
  position:absolute;
  top:10px;              /* subir/bajar la franja */
  left:-36px;            /* meter/sacar desde la izquierda */
  width:200px;           /* largo de la franja para card de 220px */
  transform:rotate(-35deg);
  background:#dc3545;
  color:#fff;
  text-align:center;
  padding:8px 0;
  font-weight:900;
  letter-spacing:1px;
  text-transform:uppercase;
  border-top:1px solid rgba(255,255,255,.35);
  border-bottom:1px solid rgba(0,0,0,.2);
  box-shadow:0 6px 14px rgba(0,0,0,.2);
  z-index:2;             /* por encima de la imagen */
}

/* Atenúa la imagen cuando está agotado (opcional) */
.producto.agotado img{ filter:grayscale(.25) contrast(.97); }

/* =========================
   CARRITO
========================= */
#carrito {
  position: fixed; top: 120px; right: -380px;
  width: 340px; max-height: 460px; background-color: white;
  border-radius: 12px 0 0 12px; box-shadow: -4px 0 25px rgba(0,0,0,0.25);
  padding: 1rem; overflow-y: auto; z-index: 99999; transition: right .4s ease;
}
#carrito.mostrar { right: 20px; }
#carrito h3 { text-align: center; margin-bottom: 1rem; color: #0056b3; font-weight: 700; }

#lista-carrito { list-style: none; margin-bottom: 1rem; }

#lista-carrito li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #ddd;
  font-weight: 600;
}
#lista-carrito li .col.precio,
#lista-carrito li .col.cantidad { white-space: nowrap; }

#total-carrito {
  font-weight: 700; font-size: 1.2rem; margin-bottom: 1rem; text-align: center; color: #004080;
}

#carrito button {
  background-color: #0056b3; color: white; border: none;
  padding: 0.7rem; border-radius: 8px; cursor: pointer; font-weight: 700; width: 100%; margin-top: 0.5rem;
  transition: background-color .3s ease;
}
#carrito button:hover { background-color: #023e73; }

#input-cupon {
  width: 100%; padding: 0.5rem 10px; margin-bottom: 0.5rem; border-radius: 8px; border: 2px solid #0056b3;
}

/* =========================
   BOTÓN WHATSAPP
========================= */
.btn-whatsapp {
  position: fixed; bottom: 20px; right: 20px; background-color: #25d366; color: white;
  font-size: 2.8rem; border-radius: 50%; padding: 0.3rem 0.4rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); z-index: 10000; transition: background-color .3s ease, transform .2s ease;
  text-decoration: none;
}
.btn-whatsapp:hover { background-color: #1ebe57; transform: scale(1.05); }

/* =========================
   BUSCADOR
========================= */
.buscador-container { margin: 20px 0 30px 0; width: 100%; max-width: 400px; position: relative; margin-left: auto; margin-right: auto; }
.buscador-container input {
  width: 100%; padding: 10px 40px 10px 55px; font-size: 1rem; border: 2px solid #ccc; border-radius: 30px;
  outline: none; transition: border-color .3s ease, box-shadow .3s ease; color: #333;
}
.buscador-container input::placeholder { text-indent: 25px; color: #999; }
.buscador-container::before {
  content: "🔍"; position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  font-size: 1.2rem; color: #999; pointer-events: none;
}
.buscador-container input:focus { border-color: #007bff; box-shadow: 0 0 8px rgba(0, 123, 255, 0.5); }

/* =========================
   QUIÉNES SOMOS / PROMOS
========================= */
.quienes-somos {
  background: #e9f2ff;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.quienes-somos h2 { color: #003d7a; margin-bottom: 1rem; font-size: 1.8rem; text-transform: uppercase; }
.quienes-somos p { color: #333; font-size: 1rem; margin-bottom: 0.7rem; line-height: 1.6; }

.promociones-vigentes {
  background: #f8fbff;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  text-align: center;
}
.promociones-vigentes h2 { color: #003d7a; margin-bottom: 1.2rem; font-size: 1.8rem; text-transform: uppercase; }

.promos-container {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem;
}
.promo-card {
  background: #fff; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 1rem; width: 230px; text-align: center;
  transition: transform .3s ease, box-shadow .3s ease;
}
.promo-card:hover { transform: scale(1.03); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.promo-card img {
  width: 100%; height: 130px; object-fit: cover; border-radius: 8px; margin-bottom: 0.6rem;
}
.promo-card p { font-weight: 600; color: #003d7a; margin-bottom: 0.3rem; }
.promo-card span { color: #555; font-size: 0.9rem; display: block; margin-bottom: 0.6rem; }
.promo-card .precio { margin: 0.35rem 0 0.6rem; color: #003d7a; font-weight: 700; }
.promo-card button {
  background-color: #0056b3; color: white; border: none; padding: 0.6rem 1rem; border-radius: 8px; font-weight: 600;
  cursor: pointer; transition: background-color .3s ease; width: 100%;
}
.promo-card button:hover { background-color: #023e73; }

/* =========================
   FOOTER
========================= */
footer {
  background-color: #00408a; color: white; text-align: center; padding: 1.5rem 0.5rem; margin-top: auto;
}
.footer-container {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.5rem;
}
.footer-container h4 { font-size: 1.1rem; margin-bottom: 0.6rem; }
.footer-container .social a img, .footer-container .pagos img {
  width: 40px; height: 40px; margin: 0 0.5rem; transition: transform .3s ease; border-radius: 8px;
}
.footer-container .social a img:hover, .footer-container .pagos img:hover { transform: scale(1.15); }
.copy { font-size: 0.85rem; opacity: 0.85; margin-top: 0.8rem; }

/* =========================
   RESPONSIVE (Móvil)
========================= */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  .btn-login-header {
    position: static;
    transform: none;
    margin-top: 0.5rem;
    background-color: #00408a;
    color: #fff !important;
    border: 1.5px solid rgba(255,255,255,0.25);
    display: inline-block;
    padding: 0.4rem 0.9rem;
  }

  nav ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .4rem;
    padding: .5rem .6rem;
    margin-top: 0.5rem;
  }
  nav ul li { margin: 0; }
  nav ul li a {
    display: block;
    text-align: center;
    padding: .5rem .4rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.15);
    white-space: nowrap;
  }

  .productos { justify-content: center; gap: 1rem; }
  .producto { width: 160px; padding: 0.8rem; }
  .producto button { font-size: 0.9rem; padding: 0.5rem; }

  #carrito { width: 90%; right: -100%; top: 90px; max-height: 350px; border-radius: 12px; }
  #carrito.mostrar { right: 5%; }

  /* Compensación por header fijo en móvil */
  main { margin-top: 180px !important; }

  /* Ribbon más compacto en móvil */
  .producto.agotado::before {
    top: 8px;
    left: -30px;
    width: 170px;
    padding: 7px 0;
    font-size: 0.9rem;
  }
}

/* =========================
   MODAL DETALLE DE PRODUCTO
========================= */
.mdet.hidden { display: none; }
.mdet{
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100000;
}
.mdet-card{
  width: 95%; max-width: 620px; background: #fff; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  border: 2px solid #0056b3; padding: 1rem 1rem 1.2rem;
  animation: mdetPop .15s ease-out;
}
@keyframes mdetPop { from { transform: scale(.98); opacity:.95; } to { transform: scale(1); opacity:1; } }

.mdet-close{
  background: transparent; border: none; color: #0056b3;
  font-size: 1.6rem; font-weight: 700; cursor: pointer; float: right; line-height: 1;
}
.mdet-body{ display: flex; gap: 1rem; align-items: flex-start; }
.mdet-body img{
  width: 130px; height: 130px; object-fit: contain; border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.1); background: #f8fbff;
}
.mdet-info h3{ margin: 0 0 .25rem; color: #003d7a; }
.mdet-precio{ color: #004080; font-weight: 800; margin: .25rem 0 .5rem; }
.mdet-desc{ color: #333; line-height: 1.45; margin: .35rem 0 .75rem; }
.mdet-actions{
  display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .2rem;
}
.mdet-primary, .mdet-secondary{
  padding: .8rem; border-radius: 10px; font-weight: 800; border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); transition: transform .1s ease, filter .2s ease;
}
.mdet-primary{ background: #0056b3; color: #fff; }
.mdet-primary:hover{ filter: brightness(.95); transform: translateY(-1px); }
.mdet-secondary{ background: #e9f2ff; color: #003d7a; border: 2px solid #0056b3; }
.mdet-secondary:hover{ filter: brightness(.98); transform: translateY(-1px); }

/* ====== Admin: textarea de descripción (base) ====== */
#form-agregar-producto textarea{
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 2px solid #ccc;
  outline: none;
  resize: vertical;
  min-height: 90px;
  transition: border-color .2s ease, box-shadow .2s ease;
  font-family: inherit;
}
#form-agregar-producto textarea:focus{
  border-color:#007bff;
  box-shadow: 0 0 6px rgba(0,123,255,.25);
}

/* =========================================================
   PANEL ADMIN – Estilos visuales (scope: #admin)
========================================================= */
#admin {
  --adm-bg: #f4f7ff;
  --adm-card-bg: #ffffff;
  --adm-primary: #0056b3;
  --adm-primary-2: #023e73;
  --adm-accent: #2563eb;
  --adm-border: #e6ecf5;
  --adm-text: #0f172a;
  --adm-muted: #6b7280;
}

/* Tarjetas contenedoras dentro del admin */
#admin .admin-card {
  background: var(--adm-card-bg);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
  padding: 1.25rem 1.25rem 1.35rem;
  max-width: 980px;
  margin: 1rem auto 1.2rem;
  position: relative;
}

/* Títulos admin */
#admin h2 { color: var(--adm-primary); letter-spacing: .5px; margin-bottom: 1rem; }
#admin h3 { color: var(--adm-primary-2); margin: .6rem 0 1rem; }

/* LOGIN admin */
#admin #login-panel form {
  display: grid;
  gap: .8rem;
  align-items: center;
  grid-template-columns: 1fr auto;
}
#admin #login-panel label { font-weight: 600; color: var(--adm-muted); }

/* 👇 Añadido: estilos también para input[type="text"] (usuario) */
#admin #login-panel input[type="password"],
#admin #login-panel input[type="text"] {
  grid-column: 1 / -1;
  width: 100%;
  padding: .7rem .9rem;
  border: 2px solid var(--adm-border);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
#admin #login-panel input[type="password"]:focus,
#admin #login-panel input[type="text"]:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 4px rgba(0,86,179,.12);
}

#admin #login-panel button[type="submit"] {
  justify-self: start;
  background: var(--adm-primary);
  color: #fff;
  border: 0;
  padding: .65rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
#admin #login-panel button[type="submit"]:hover {
  filter: brightness(.96);
  transform: translateY(-1px);
}
#login-error { margin-top: .4rem; }

/* FORM AGREGAR PRODUCTO */
#admin #form-agregar-producto {
  background: linear-gradient(180deg, #f9fbff, #f4f7ff);
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  gap: .8rem;
  grid-template-columns: 1fr 1fr;
}
#admin #form-agregar-producto select,
#admin #form-agregar-producto input[type="text"],
#admin #form-agregar-producto input[type="number"],
#admin #form-agregar-producto textarea {
  width: 100%;
  padding: .7rem .9rem;
  border: 2px solid var(--adm-border);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  font: inherit;
  color: var(--adm-text);
  background: #fff;
}
#admin #form-agregar-producto textarea { grid-column: 1 / -1; min-height: 96px; }
#admin #form-agregar-producto select:focus,
#admin #form-agregar-producto input:focus,
#admin #form-agregar-producto textarea:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 4px rgba(0,86,179,.10);
}
#admin #form-agregar-producto button[type="submit"] {
  grid-column: 1 / -1;
  background: var(--adm-primary);
  color: #fff;
  border: 0;
  padding: .75rem 1.1rem;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,86,179,.18);
  transition: transform .08s ease, filter .15s ease, box-shadow .2s ease;
}
#admin #form-agregar-producto button[type="submit"]:hover {
  filter: brightness(.97);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,86,179,.22);
}

/* LISTADO DE PRODUCTOS */
#admin #listado-productos-admin h4 {
  margin: 1rem 0 .6rem;
  color: var(--adm-primary);
  font-size: 1.02rem;
  letter-spacing: .2px;
}
#admin #listado-productos-admin ul {
  list-style: none;
  display: grid;
  gap: .55rem;
  margin-bottom: 1rem;
  padding-left: 0;
}
#admin #listado-productos-admin li {
  background: #fff;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: .6rem .7rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,.04);
}
#admin #listado-productos-admin li button {
  background: #eef4ff;
  color: var(--adm-primary-2);
  border: 1px solid #dbe7ff;
  border-radius: 9px;
  padding: .45rem .7rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, transform .08s ease, box-shadow .2s ease;
}
#admin #listado-productos-admin li button:hover {
  background: #e6f0ff;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(2,62,115,.12);
}
#admin #listado-productos-admin li button:nth-child(2) {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}
#admin #listado-productos-admin li button:nth-child(2):hover {
  background: #fecaca;
  box-shadow: 0 6px 12px rgba(185,28,28,.12);
}

/* EDITOR INLINE */
#admin .editor-inline {
  margin-top: .55rem;
  background: #fafcff;
  border: 1px dashed #cfe0ff;
  border-radius: 10px;
  padding: .7rem;
  display: grid;
  gap: .55rem;
  grid-template-columns: 1fr 140px;
}
#admin .editor-inline input[type="text"],
#admin .editor-inline input[type="number"],
#admin .editor-inline textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 2px solid var(--adm-border);
  border-radius: 8px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  font: inherit;
}
#admin .editor-inline textarea { grid-column: 1 / -1; min-height: 80px; }
#admin .editor-inline input:focus,
#admin .editor-inline textarea:focus {
  border-color: var(--adm-accent);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
#admin .editor-inline label span { font-weight: 600; color: var(--adm-muted); }
#admin .editor-inline button {
  background: var(--adm-primary);
  color: #fff;
  border: 0;
  padding: .55rem .9rem;
  border-radius: 9px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
#admin .editor-inline button:hover { filter: brightness(.96); transform: translateY(-1px); }
#admin .editor-inline button + button {
  background: #e9f2ff;
  color: var(--adm-primary-2);
  border: 1px solid #d6e6ff;
}

/* BOTÓN CERRAR SESIÓN */
#admin #admin-panel > button {
  margin-top: .6rem;
  background: #0f172a;
  color: #fff;
  border: 0;
  padding: .65rem 1rem;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
#admin #admin-panel > button:hover { filter: brightness(.98); transform: translateY(-1px); }

/* Responsive admin */
@media (max-width: 768px) {
  #admin .admin-card { padding: 1rem; }
  #admin #form-agregar-producto { grid-template-columns: 1fr; }
  #admin .editor-inline { grid-template-columns: 1fr; }
  #admin #login-panel form { grid-template-columns: 1fr; }
  #admin #listado-productos-admin li { grid-template-columns: 1fr auto; }
}

/* Botón cerrar del carrito */
#carrito .carrito-cerrar{
  position: absolute;
  top: 8px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #e9f2ff;
  color: #003d7a;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: transform .08s ease, filter .15s ease;
}
#carrito .carrito-cerrar:hover{ transform: translateY(-1px); filter: brightness(.97); }

/* Overlay del carrito (clic para cerrar) */
#carrito-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 99997; /* debajo del panel (#carrito tiene 99999) */
}
#carrito-overlay.visible{
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   MEJORAS VISUALES EXTRAS
   (compatibles, no rompen tu diseño)
========================= */

/* Input cupón deshabilitado (cuando ya se aplicó) */
#input-cupon[disabled]{
  background: #f3f6fb;
  border-color: #9db7e3;
  color: #5f6b7a;
  cursor: not-allowed;
  opacity: .75;
  
}


/* Accesibilidad: foco visible en el botón cerrar del carrito */
#carrito .carrito-cerrar:focus{
  outline: 3px solid rgba(0,86,179,.35);
  outline-offset: 2px;
}

/* Asegura que el “slide” del carrito sea suave en Safari/iOS */
#carrito{
  will-change: right;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* En pantallas pequeñas, que el botón “×” sea fácil de tocar */
@media (max-width: 768px){
  #carrito .carrito-cerrar{
    top: 6px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
}

/* =========================================================
   🔧 AÑADIDOS COMPATIBLES: botón “×” del MODAL DETALLE
   (no altera tu diseño; solo asegura que sea clickeable y visible)
========================================================= */

/* Necesario para posicionar el botón dentro de la tarjeta */
.mdet-card{
  position: relative;            /* añadido */
  padding-right: 3rem;           /* deja espacio para la “×” sin tapar el título */
}

/* Botón “×” del modal: área grande de toque y contraste sutil */
.mdet-close{
  position: absolute;            /* antes flotaba; ahora fijo arriba a la derecha */
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e9f2ff;
  color: #003d7a;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: transform .08s ease, filter .15s ease, background-color .15s ease;
  z-index: 1;                    /* por encima del contenido del modal */
}

.mdet-close:hover{
  transform: translateY(-1px);
  filter: brightness(.97);
  background: #dfeafc;
}

.mdet-close:focus{
  outline: 3px solid rgba(0,86,179,.35);
  outline-offset: 2px;
}

/* En móvil, un poquito más grande */
@media (max-width: 768px){
  .mdet-close{
    top: 6px;
    right: 8px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 24px;
  }
}

/* =========================
   FLYER INICIO (Portada)
========================= */
.flyer-inicio {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem auto;
  width: 100%;
  max-width: 1000px;
}

.flyer-inicio img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flyer-inicio img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.45);
}
/* Ajustes generales móviles para que nada se desborde */
@media (max-width: 768px) {
  /* Títulos y textos grandes */
  .seccion h2 {
    font-size: 1.4rem;      /* antes 2rem */
    margin-bottom: 1rem;
  }
  .quienes-somos h2 { font-size: 1.35rem; }
  .quienes-somos p {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  /* Flyer (portada) */
  .flyer-inicio { 
    margin: 1rem auto; 
    max-width: 100%;
    padding: 0 .5rem;        /* pequeño respiro lateral */
  }
  .flyer-inicio img {
    border-radius: 12px;
    max-height: 48vh;        /* evita que tape todo el scroll */
    object-fit: contain;     /* no se deforma */
  }

  /* Promos de inicio (tarjetas) */
  .promociones-vigentes { padding: 1rem; }
  .promos-container { gap: 1rem; }
  .promo-card { width: 100%; max-width: 320px; margin: 0 auto; }
  .promo-card img { height: 120px; object-fit: cover; }

  /* Banners grandes de inicio */
  .promo img { max-height: 200px; }

  /* Productos más compactos ya lo tienes,
     pero aseguramos que nunca se desborden */
  .producto img { max-height: 120px; }
  /* Mensajes debajo del input de cupón */
#cupon-msg{
  margin-top: .25rem;
  font-size: .92rem;
  font-weight: 600;
}
#cupon-msg.success{ color:#0f766e; }   /* verde */
#cupon-msg.error{   color:#b91c1c; }   /* rojo  */

/* Borde rojo si hay error en el input */
#input-cupon.input-error{
  border-color:#dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}

/* Pill “Cupón aplicado” (opcional, bonito) */
.badge-cupon{
  display:inline-block;
  margin-top:.4rem;
  background:#e6fffa;
  color:#065f46;
  border:1px solid #99f6e4;
  padding:.25rem .5rem;
  border-radius:9999px;
  font-weight:800;
  font-size:.8rem;
}

/* Botón estilo contorno (por si lo usas en promos/admin) */
.btn-outline{
  background:#fff;
  color:#0056b3;
  border:2px solid #0056b3;
}
.btn-outline:hover{ background:#f0f6ff; }

}
#cupon-msg {
  display: block;
  font-size: 0.85rem;
  margin-top: 4px;
  text-align: center;
}
#cupon-msg.success {
  color: #16a34a; /* verde */
}
#cupon-msg.error {
  color: #dc2626; /* rojo */
}


/* =========================================================
   CUPONES (ADMIN) – estilos del formulario y el <select>
   Pegar al final del archivo
========================================================= */
#cupon-admin {
  background: var(--adm-card-bg);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
}

#cupon-admin h3 {
  color: var(--adm-primary-2);
  margin-bottom: .8rem;
}

#cupon-admin #form-cupon {
  display: block;           /* ya usas grid con <div> interno; mantenemos simple */
}

#cupon-admin #form-cupon label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-weight: 600;
  color: var(--adm-muted);
}

/* inputs y select del form de cupón (incluye #cup-plataforma) */
#cupon-admin #form-cupon input[type="text"],
#cupon-admin #form-cupon input[type="number"],
#cupon-admin #form-cupon input[type="datetime-local"],
#cupon-admin #form-cupon select {
  width: 100%;
  padding: .7rem .9rem;
  border: 2px solid var(--adm-border);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  font: inherit;
  color: var(--adm-text);
  background: #fff;
}

/* foco consistente */
#cupon-admin #form-cupon input:focus,
#cupon-admin #form-cupon select:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 4px rgba(0,86,179,.10);
}

/* botón crear cupón */
#cupon-admin #form-cupon button[type="submit"],
#cupon-admin #form-cupon button {
  background: var(--adm-primary);
  color: #fff;
  border: 0;
  padding: .75rem 1.1rem;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,86,179,.18);
  transition: transform .08s ease, filter .15s ease, box-shadow .2s ease;
}
#cupon-admin #form-cupon button:hover {
  filter: brightness(.97);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,86,179,.22);
}

/* Mensaje de respuesta del cupón */
#cupon-admin #cup-resp {
  font-weight: 700;
  margin-top: .25rem;
  display: inline-block;
}

/* select con carita limpia (opcional) */
#cup-plataforma {
  appearance: none;
  background-color: #fff;
  background-image: none; /* puedes poner un ícono de caret si quieres */
}

/* estado de error reutilizable para cualquier input/select del admin */
#admin .input-error,
#admin .input-error:focus,
#admin #form-cupon .input-error,
#admin #form-cupon .input-error:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 4px rgba(220,38,38,.12) !important;
}

/* responsive: que no se pegue a los bordes en móvil */
@media (max-width: 768px){
  #cupon-admin {
    margin-left: .5rem;
    margin-right: .5rem;
  }
}

/* ===== POPUP SORTEO ===== */

.popup-sorteo {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.popup-sorteo-content {
  position: relative;            /* 👈 IMPORTANTE para posicionar la X */
  background: #ffffff;
  padding: 1.8rem 1.5rem 1.4rem;
  border-radius: 14px;
  max-width: 420px;
  width: 92%;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
  animation: popupZoom .28s ease;
}

@keyframes popupZoom {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.popup-img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 1rem;
  object-fit: cover;
}

.popup-btn {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.7rem 1.5rem;
  background: #0a4cbc;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.popup-btn:hover {
  background: #073a8f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

/* 🔴 BOTÓN X – bien visible arriba a la derecha */
.popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background .15s ease, transform .1s ease;
}

.popup-close:hover {
  background: #d1d5db;
  transform: scale(1.05);
}

.popup-close:active {
  transform: scale(0.96);
}
