* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: #f2f2f2; color: #111; }
p { font-size: 16px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
.encabezado { background: #111; color: white; padding: 24px 40px; display: flex; justify-content: space-between; align-items: center; gap: 30px; box-shadow: 0 5px 15px #0007; }
.logo h1 { margin: 0; font-size: 28px; white-space: nowrap; text-shadow: 0 2px 6px #0004; }
.menu { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.menu a { color: white; text-decoration: none; font-size: 16px; padding: 10px 14px; border-radius: 8px; transition: .25s; }
.menu a:hover { background: #333; color: #00bfff; }
#contador-carrito { display: inline-block; min-width: 20px; padding: 2px 6px; background: #00bfff; color: #111; border-radius: 20px; font-size: 13px; font-weight: 700; text-align: center; }
h2 { text-align: center; font-size: 30px; margin: 35px 0 25px; }
main { padding-top: 1px; animation: aparecer .6s ease-out; }
#buscador, #filtro-categoria { display: block; width: 90%; margin: 0 auto 18px; padding: 12px 16px; font-size: 16px; border: 1px solid #ccc; border-radius: 10px; background: white; outline: none; box-shadow: 0 3px 10px #0000000d; }
#buscador { max-width: 500px; }
#filtro-categoria { max-width: 300px; margin-bottom: 25px; }
#buscador:focus, #filtro-categoria:focus, #nombre-cliente:focus, #telefono-cliente:focus, #direccion-cliente:focus { border-color: #00bfff; box-shadow: 0 0 0 3px #00bfff26; }
#sin-resultados { text-align: center; font-size: 16px; color: #666; }
.productos { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 230px)); gap: 20px; justify-content: center; padding: 10px 20px 30px; }
.productos article { min-width: 0; background: white; border: 1px solid #e5e5e5; padding: 16px; border-radius: 14px; box-shadow: 0 4px 12px #0000001f; text-align: center; transition: transform .25s, box-shadow .25s; }
.productos article:hover { transform: translateY(-3px); box-shadow: 0 8px 20px #0000002e; }
.productos article h3 { margin: 0 0 12px; font-size: 20px; line-height: 1.3; }
.productos img { display: block; width: 100%; height: 180px; object-fit: cover; border: 1px solid #ddd; border-radius: 12px; }
.productos article p { margin: 10px 0; }
.categoria { font-size: 14px; color: #666; }
.descripcion-producto { color: #555; min-height: 38px; }
.precio { display: inline-block; padding: 6px 10px; border-radius: 8px; background: #f2f2f2; font-size: 20px; font-weight: 700; }
.stock { padding-top: 8px; border-top: 1px solid #eee; font-size: 14px; color: #777; }
.acciones-producto { display: grid; gap: 8px; margin-top: 12px; }
.productos button, #comprar, #enviar-whatsapp, #vaciar-carrito, #seguir-comprando, .modal-acciones button { border: 0; border-radius: 8px; padding: 11px 12px; font-size: 14px; font-weight: 700; transition: .2s; }
.productos button { width: 100%; background: #111; color: white; }
.productos button:hover, #comprar:hover, .boton-principal:hover { background: #00bfff; color: #111; transform: translateY(-1px); }
.productos .comprar-directo, .boton-secundario { background: #e8f8ff; color: #111; border: 1px solid #00a9e0; }
.productos .comprar-directo:hover, .boton-secundario:hover { background: #c9f0ff; }
.linea-1 { width: 90%; max-width: 900px; margin: 30px auto; border-top: 1px solid #ddd; font-size: 0; }
#carrito { padding: 20px; margin-top: 20px; }
#carrito h2 { margin: 20px 0 30px; }
.producto-carrito { background: white; border: 1px solid #e5e5e5; padding: 18px; border-radius: 14px; margin: 15px auto; width: 100%; max-width: 320px; text-align: center; box-shadow: 0 4px 12px #0000001f; }
.producto-carrito img { width: 100px; height: 100px; object-fit: cover; border-radius: 10px; margin: 10px 0; }
.producto-carrito h3 { font-size: 19px; margin: 0 0 12px; }
.producto-carrito p { font-size: 16px; color: #555; margin: 8px 0; }
.producto-carrito button { background: #111; color: white; border: 0; border-radius: 8px; padding: 9px 12px; margin: 4px; }
.producto-carrito .eliminar-producto { background: #dc3545; width: 100%; margin-top: 8px; }
#total-carrito { width: 90%; max-width: 450px; margin: 25px auto; padding: 15px; background: white; border: 1px solid #e5e5e5; border-radius: 10px; text-align: center; font-size: 24px; font-weight: 700; }
#nombre-cliente, #telefono-cliente, #direccion-cliente { display: block; width: 90%; max-width: 450px; margin: 8px auto 18px; padding: 12px 14px; font-size: 16px; border: 1px solid #e5e5e5; border-radius: 10px; outline: none; box-shadow: 0 2px 8px #0000000d; }
#carrito label { display: block; width: 90%; max-width: 450px; margin: 12px auto 6px; font-size: 15px; font-weight: 600; color: #333; }
#comprar, #enviar-whatsapp, #vaciar-carrito, #seguir-comprando { display: block; width: 90%; max-width: 450px; margin: 10px auto; padding: 13px; }
#comprar { background: #111; color: white; font-size: 17px; }
#enviar-whatsapp { background: #25d366; color: white; }
#enviar-whatsapp:hover:not(:disabled) { background: #1ebe5d; }
#vaciar-carrito { background: #eee; color: #333; border: 1px solid #ccc; }
#vaciar-carrito:hover { background: #dc3545; color: white; }
#seguir-comprando { background: white; color: #111; border: 2px solid #111; }
#seguir-comprando:hover { background: #111; color: white; }
.nota-pago { width: 90%; max-width: 450px; margin: 10px auto 18px; font-size: 13px; line-height: 1.5; color: #666; }
.resumen-compra { width: 90%; max-width: 450px; margin: 20px auto; padding: 18px; background: white; border: 1px solid #e5e5e5; border-radius: 12px; line-height: 1.6; color: #333; white-space: pre-wrap; overflow-wrap: anywhere; }
footer { background: #111; color: white; text-align: center; padding: 25px 20px; margin-top: 70px; box-shadow: 0 -4px 12px #0000001f; }
footer p { margin: 0; font-size: 14px; color: #ccc; }
.modal-producto { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; padding: 18px; background: #0009; overflow-y: auto; }
.modal-producto.abierto { display: flex; }
.modal-contenido { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; width: 100%; max-width: 850px; max-height: min(90vh, 760px); overflow-y: auto; padding: 28px; background: white; border-radius: 18px; box-shadow: 0 15px 50px #0005; animation: modalEntrar .2s ease-out; }
.cerrar-modal { position: absolute; top: 10px; right: 12px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #eee; color: #111; font-size: 28px; line-height: 1; }
.cerrar-modal:hover { background: #ddd; }
.modal-galeria { min-width: 0; padding-top: 20px; }
#modal-imagen-principal { display: block; width: 100%; height: 330px; object-fit: contain; background: #f7f7f7; border-radius: 12px; border: 1px solid #eee; }
.modal-miniaturas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.modal-miniatura { width: 62px; height: 62px; padding: 3px; border: 1px solid #ddd; border-radius: 8px; background: white; }
.modal-miniatura.activa { border: 2px solid #00a9e0; }
.modal-miniatura img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.modal-informacion { padding-top: 28px; min-width: 0; }
.modal-categoria { color: #666; font-size: 14px; }
.modal-informacion h2 { text-align: left; font-size: 28px; margin: 10px 0 16px; overflow-wrap: anywhere; }
.modal-descripcion { line-height: 1.6; color: #555; }
.modal-precio { display: inline-block; padding: 8px 12px; border-radius: 8px; background: #f2f2f2; font-size: 25px; font-weight: 700; }
.modal-stock { font-size: 14px; color: #666; }
.modal-acciones { display: grid; gap: 10px; margin-top: 22px; }
.boton-principal { background: #111; color: white; }
.boton-secundario { font-size: 15px !important; }
body.modal-abierto { overflow: hidden; }
@keyframes aparecer { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalEntrar { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 650px) {
  .encabezado { flex-direction: column; padding: 20px 10px; gap: 14px; }
  .logo h1 { font-size: 23px; white-space: normal; text-align: center; }
  .menu { justify-content: center; gap: 4px; }
  .menu a { font-size: 14px; padding: 8px; }
  .productos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 10px 12px 25px; }
  .productos article { padding: 9px; }
  .productos article h3 { font-size: 16px; }
  .productos img { height: 115px; }
  .productos .precio { font-size: 17px; padding: 5px 7px; }
  .productos button { padding: 10px 5px; font-size: 12px; }
  .productos article p { font-size: 13px; }
  .productos .stock { font-size: 12px; }
  .modal-producto { padding: 10px; align-items: flex-start; }
  .modal-contenido { grid-template-columns: 1fr; gap: 12px; padding: 18px; margin: auto 0; max-height: 94vh; }
  .modal-galeria { padding-top: 28px; }
  #modal-imagen-principal { height: 230px; }
  .modal-informacion { padding-top: 0; }
  .modal-informacion h2 { font-size: 23px; margin-top: 6px; }
  .modal-precio { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ======================
   PORTADA DE OFERTA
====================== */
.portada-oferta { width: 100%; min-height: 70vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; padding: 35px 7%; overflow: hidden; background: linear-gradient(180deg, #a8eaff 0%, #d9f5ff 45%, #ffffff 100%); }
.portada-contenido { min-width: 0; }
.etiqueta-oferta { display: inline-block; padding: 8px 13px; border-radius: 30px; background: #ffffff; color: #0077a8; font-size: 13px; font-weight: 700; }
.portada-contenido h2 { margin: 20px 0 12px; text-align: left; font-size: clamp(25px, 4vw, 42px); line-height: 1.15; }
.portada-contenido h3 { margin: 0 0 12px; font-size: clamp(23px, 3vw, 34px); }
.portada-descripcion { color: #444; line-height: 1.5; }
.portada-precios { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 12px 0; }
.precio-anterior { color: #666; text-decoration: line-through; font-size: 17px; }
.precio-oferta { color: #0077a8; font-size: 29px; font-weight: 800; }
.portada-descuento { padding: 6px 9px; border-radius: 7px; background: #111; color: white; font-size: 13px; font-weight: 700; }
.portada-botones { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; margin-top: 12px; }
.portada-botones button { min-height: 46px; padding: 12px 22px; border: 0; border-radius: 10px; background: #008fc7; color: white; font-size: 15px; font-weight: 700; }
.portada-botones button:hover { background: #006b99; }
.portada-botones #portada-ver-tienda { border: 2px solid #008fc7; background: white; color: #0077a8; }
.portada-imagen-contenedor { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; width: 100%; gap: 12px; }
#portada-imagen { display: block; width: 100%; max-width: 440px; height: 360px; object-fit: contain; filter: drop-shadow(0 12px 14px #00000018); }
@media (max-width: 650px) {
  .portada-oferta { min-height: 70vh; grid-template-columns: 1fr; gap: 12px; padding: 24px 20px 28px; text-align: center; background: linear-gradient(180deg, #a8eaff 0%, #d9f5ff 38%, #ffffff 100%); }
  .portada-contenido h2 { margin: 12px 0 8px; text-align: center; font-size: 27px; }
  .portada-contenido h3 { font-size: 25px; }
  .portada-descripcion { margin: 8px 0; }
  .precio-oferta { font-size: 26px; }
  .portada-imagen-contenedor { grid-row: 2; width: 100%; }
  #portada-imagen { height: clamp(150px, 25vh, 210px); max-width: 100%; }
  .portada-botones { justify-content: center; margin-top: 12px; }
  .portada-botones button { flex: 1; padding: 12px 10px; }
}

/* ======================
   MENSAJE DE ESTADO DEL PAGO
====================== */
#mensaje-pago {
  width: 90%;
  max-width: 600px;
  margin: 20px auto 0;
  padding: 16px 20px;
  border-radius: 14px;
  background: #ffffff;
  border-left: 6px solid #00bfff;
  box-shadow: 0 6px 18px #00000018;
  font-size: 17px;
  font-weight: 600;
  color: #123044;
  text-align: center;
  animation: aparecerMensaje .5s ease-out;
}

#mensaje-pago[hidden] {
  display: none;
}

@keyframes aparecerMensaje {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  #mensaje-pago { animation: none; }
}
