/* ===================================================
   VARIABLES Y BASE
   =================================================== */
:root {
  --accent: #0d9488;
  --accent-dark: #0a6f63;
  --bg: #eef2f5;
  --card: #ffffff;
  --muted: #6b7280;
  --radius: 16px;
  --shadow: 0 8px 20px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Inter, system-ui, sans-serif; background: var(--bg); color: #1e293b; line-height: 1.5; }

/* ===================================================
   HEADER Y PROMO (VERSION FINAL CORREGIDA)
   =================================================== */
header {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  padding: 25px 16px; 
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  width: 100%;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-top {
  height: 200px;
  width: auto;
  background: transparent;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

header h1 { 
  font-size: 2rem; 
  font-weight: 700; 
  margin: 0; 
}

.promo-bar {
  background: #10b981;
  color: #fff;
  text-align: center;
  padding: 14px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .3px;
  width: 100%;
  display: block;
}

.container { 
   max-width: 1280px; 
   margin: 32px auto;
   padding: 0 20px; 
}

/* ===================================================
   GRID Y TARJETAS (ESTRUCTURA)
   =================================================== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; }

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  height: 100%;
  min-height: 420px;
  box-sizing: border-box;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

/* ===================================================
   IMAGEN, CARRUSEL Y ZOOM
   =================================================== */
.card-image {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  background: #f8fafc;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-image img, .carousel-img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  transition: transform 0.3s ease-out, transform-origin 0.3s ease-out;
  cursor: zoom-in;
  display: none;
}

.carousel-img.active, .card-image img:not(.carousel-img) {
  display: block;
  margin: 0 auto;
}

/* El scale se controla por JS para evitar saltos */
.card-image.zoom-active img.active,
.card-image.zoom-active img:not(.carousel-img) {
  z-index: 5;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.carousel-btn:hover { background: rgba(0, 0, 0, 0.75); }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }

/* ===================================================
   TEXTOS Y PRECIOS
   =================================================== */
.card-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  padding: 8px 0;
}

.card-info h3 { 
  margin: 8px 0; 
  font-size: 1.1rem; 
  line-height: 1.3; 
  font-weight: 600; 
}

.price { 
  color: var(--accent); 
  font-weight: 700; 
  font-size: 1.2rem; 
  margin-bottom: 4px; 
}

.mayoreo {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.9;
}

/* Clases de ofertas adicionales */
.deal { font-size: .88rem; color: #d97706; font-weight: 600; margin-bottom: 4px; }
.deal2 { font-size: .82rem; color: #7c3aed; font-weight: 600; margin-bottom: 10px; }

/* ===================================================
   ACCIONES (BOTÓN Y SELECTOR)
   =================================================== */
.card-actions {
  width: 100%;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 90px;
  justify-content: flex-end;
}

.color-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e6eef0;
  background: #fff;
  font-weight: 600;
  color: #111827;
  height: 38px;
  
  text-align: center;
  text-align-last: center; /* Para navegadores como Chrome y Safari */
  appearance: none;       /* Quitamos la flecha por defecto si quieres un look más limpio */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.card .btn {
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background .2s;
  width: 100%;
}
.card .btn:hover { background: var(--accent-dark); }

/* ===================================================
   BUSCADOR Y FILTROS
   =================================================== */
.search-bar { max-width: 720px; margin: 18px auto; padding: 0 12px; }
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 6px 18px rgba(16,24,40,0.06);
  border: 1px solid rgba(16,24,40,0.04);
  transition: all .18s ease;
}
.search-input-wrap:focus-within {
  box-shadow: 0 10px 30px rgba(16,24,40,0.10);
  border-color: rgba(13,148,136,0.18);
  transform: translateY(-1px);
}
#search { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 18px auto; }
.filter-btn {
  padding: 10px 18px; border-radius: 999px; border: 1px solid #d1d5db;
  background: #fff; cursor: pointer; font-weight: 600; transition: .2s;
}
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/***********************
  Icono carrito flotante
***********************/
#cart-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--accent);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s;
  z-index: 999; /* Asegura que siempre esté visible */
}

#cart-btn:hover {
  transform: scale(1.07);
}

#cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

/***********************
  Panel lateral carrito
***********************/
.cart-panel {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 420px;
  max-width: 95vw;
  background: var(--card);
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.15);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.2, 1);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.cart-panel.open {
  transform: translateX(0);
}

.cart-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
}

.cart-body {
  padding: 18px;
  flex: 1;
  overflow-y: auto;
}

.cart-item {
  background: #f9fafb;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  align-items: center;
}


.cart-item img {
  width: 70px !important;
  height: 70px !important;
  min-width: 70px;
  border-radius: 10px;
  object-fit: cover !important;
  display: block !important;
  transform: none !important; /* Evita el zoom de la tienda */
}

.qty {
  width: 60px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  text-align: center;
}

.small-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  margin-top: 6px;
  font-size: 13px;
}

/***********************
  Overlay y Footer
***********************/
.overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s;
  z-index: 900;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
}

.checkout-form input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  margin-bottom: 12px;
  font-size: 1rem;
}

.checkout-btn {
  background: var(--accent);
  color: #fff;
  padding: 14px;
  border-radius: 12px;
  border: none;
  width: 100%;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}

.checkout-btn:hover {
  background: var(--accent-dark);
}

/* Responsive */
@media (max-width: 640px) {
  .cart-panel {
    width: 100vw;
  }
}
/* ===================================================
   BOTÓN WHATSAPP MINIMALISTA
   =================================================== */
.whatsapp-btn {
  position: fixed;
  left: 24px; /* Lado izquierdo para equilibrar con el carrito a la derecha */
  bottom: 24px;
  background-color: #25d366;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-btn:hover {
  transform: scale(1.08);
  background-color: #128c7e;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.wa-icon {
  font-size: 20px;
}

/* Ajuste para pantallas pequeñas */
@media (max-width: 480px) {
  .wa-text { display: none; } /* En celular solo queda el círculo con el icono */
  .whatsapp-btn { 
    padding: 15px; 
    border-radius: 50%;
    left: 20px;
    bottom: 20px;
  }
}
/* ===================================================
   RESPONSIVE Y UTILIDADES
   =================================================== */
@media(max-width: 640px) {
  .cart-panel { width: 100vw; }
  header h1 { font-size: 1.4rem; }
  .card h3 { font-size: 1rem; }
  .card { min-height: 380px; }
}

@media (hover: none) {
  .card-image.zoom-active img { transform: none !important; }
}

.visually-hidden { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; }


@media(max-width: 640px) {
  .header-container {
    flex-direction: column; /* Logo arriba, texto abajo */
    gap: 10px;
  }
  .logo-top {
    height: 65px; /* Un poco más pequeño en cel */
  }
  header h1 { font-size: 1.4rem; }

}












