body {
    margin: 0;
    padding: 0;
}

main, .main {
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.5;
    margin: 10px 10px 10px 10px;
}

/* Contenedor: evitar reordenado, permitir que las tarjetas se encojan/expandan */
.reloj-container {
  display: flex;
  flex-wrap: wrap; /* permitir que bajen en varias filas si hace falta */
  gap: 80px 15px;
  justify-content: center;
  padding: 20px;
  align-items: stretch;
}

/* Tarjetas: se adaptan al espacio (cambian de tamaño) y mantienen forma cuadrada */
.reloj-card {
  flex: 1 1 160px;
  min-width: 100px;
  max-width: 230px;
  aspect-ratio: 4 / 3;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.18s ease;
  box-sizing: border-box;
}

/* efecto leve al pasar */
.reloj-card:hover { transform: translateY(-4px); }

/* imágenes: base y hover superpuestas para crossfade suave */
.reloj-card .reloj-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px 8px 0 0;
  position: relative;
  z-index: 1;
  transition: opacity 360ms cubic-bezier(.22,.9,.36,1);
  opacity: 1;
}

/* imagen hover superpuesta (creada por script) */
.reloj-card .reloj-img-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px 8px 0 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 360ms cubic-bezier(.22,.9,.36,1);
  pointer-events: none;
}

/* cuando se activa el hover hacemos crossfade */
.reloj-card.show-hover .reloj-img-hover { opacity: 1; }
.reloj-card.show-hover .reloj-img { opacity: 0; }

/* tarjeta informativa que aparece debajo al hover:
   se estira exactamente al ancho del padre usando left:0 + right:0,
   se solapa 1px hacia arriba para eliminar la línea entre elementos,
   las esquinas superiores quedan planas (0) para continuidad */
.reloj-card .info-card {
    position: absolute;
    left: 0;
    right: 0;
    background: #ffffff;
    color: #000;
    border: 1px solid rgba(0,0,0,0.12);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    padding: 8px 12px;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Estado por defecto: mostrar info con nombre y precio */
.reloj-card .info-default {
    top: calc(100% - 1px);
    border-top: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.reloj-card .product-name {
    flex: 1;
    text-align: left;
    font-weight: 400;
    font-family: 'Open Sans', sans-serif;
}

.reloj-card .product-price {
    font-weight: 600;
    white-space: nowrap;
    color: #000000;
    font-family: 'Open Sans', sans-serif;
}

/* Estado hover: ocultar info por defecto y mostrar botón debajo */
.reloj-card .info-hover {
    top: calc(100% + 40px - 1px);
    border-top: 1px solid rgba(0,0,0,0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.reloj-card .btn-add-cart {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    width: 100%;
    transition: background-color 0.2s ease;
}

.reloj-card .btn-add-cart:hover {
    background-color: #003d66;
}

/* Mostrar estado hover */
.reloj-card.show-info .info-default {
  /* Mantener visible la tarjeta con nombre y precio cuando se activa el estado hover. */
  opacity: 1;
  pointer-events: auto;
  transform: translateY(1);
}

.reloj-card.show-info .info-hover {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(1);
}

/* Para la zona de listados: organizar en filas de 4 */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 100px 16px;
    padding: 0 20px 30px;
    justify-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

/* Asegurar que las tarjetas llenen la celda del grid con ancho controlado */
  .productos-grid .reloj-card {
  flex: none;
  max-width: 320px;
  margin: 0;
  aspect-ratio: 4 / 3;
  transform-origin: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
  justify-self: center;
}

/* hover mantiene efecto ligero */
.productos-grid .reloj-card:hover {
  transform: translateY(-6px) scale(1.02);
}

/* Responsive: mantener 4 columnas hasta 600px */
/* A <= 600px pasar a 2 columnas y reducir tamaño de tarjeta progresivamente */
@media (max-width: 600px) {
  .productos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    max-width: 720px;
  }
  .productos-grid .reloj-card {
    width: 150px;
  }
}

/* móviles muy pequeños: 1 por fila y tarjeta al 90% del contenedor */
@media (max-width: 420px) {
  .productos-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    padding: 0 12px;
  }
  .productos-grid .reloj-card {
    width: 90%;
    max-width: 320px;
  }
}

/* ========================================
   FILTROS DE PRODUCTOS
   ======================================== */

.filtros-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  max-width: 1100px;
  margin: 0 auto 20px;
}

.filtro-btn {
  padding: 8px 18px;
  border: 1px solid #999;
  background-color: #f0f0f0;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  text-transform: capitalize;
  color: #333;
}

.filtro-btn:hover {
  background-color: #e0e0e0;
  border-color: #666;
}

.filtro-btn.filtro-active {
  background-color: #000000;
  color: white;
  border-color: #001a32;
}

.filtro-grupo{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:0 8px; }
.filtro-grupo small{ color: #444; font-weight:600; }

/* Responsive: filtros en mobile */
@media (max-width: 600px) {
  .filtros-container {
    padding: 15px;
    gap: 8px;
  }

  .filtro-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}

/* Títulos centrados con línea fina que cruza por el centro vertical del h2 */
.Productos-destacados h2,
.productos h2 {
  position: relative;
  text-align: center;
  margin: 50px 0px 20px 0px;
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1;
  font-family: 'Open Sans', sans-serif;
  letter-spacing: 0.5px;
}

/* línea fina que atraviesa la sección en la mitad vertical del h2 */
.Productos-destacados h2::before,
.productos h2::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.02rem;
  background: #000;
  transform: translateY(-50%);
  z-index: 0;
  opacity: 1;
}

/* el <span> alrededor del texto tapa la línea para que el título quede legible */
.Productos-destacados h2 > span,
.productos h2 > span {
  position: relative;
  display: inline-block;
  background: #fff;
  padding: 0 12px;
  z-index: 1;
}

/* ========================================
   CARRITO DESPLEGABLE (SIDEBAR)
   ======================================== */

/* Cart styles moved to header.css */

.cart-products::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Tarjeta de producto en el carrito */
.cart-product-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.cart-product-item:hover {
  background-color: #f0f0f0;
}

.cart-product-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-product-name {
  font-weight: 400;
  color: #333;
  font-size: 13px;
  font-family: 'Open Sans', sans-serif;
}

.cart-product-price {
  color: #001a32;
  font-weight: bold;
  font-size: 13px;
  font-family: 'Open Sans', sans-serif;
}

.cart-product-quantity {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.cart-product-qty-input {
  width: 40px;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  font-family: 'Open Sans', sans-serif;
}

.cart-product-qty-input:focus {
  outline: none;
  border-color: #001a32;
  box-shadow: 0 0 3px rgba(0, 26, 50, 0.3);
}

.cart-product-subtotal {
  font-size: 12px;
  font-weight: 600;
  color: #001a32;
  margin-top: 4px;
}

/* Dropdown estético para filtros (Género / Marca) */
.dropdown{ position: relative; display: inline-block; }
.dropdown-toggle{ display: inline-flex; align-items: center; gap:8px; background: linear-gradient(180deg,#fff,#f6f8fb); border:1px solid rgba(0,0,0,0.08); padding:8px 14px; border-radius:20px; box-shadow: 0 6px 18px rgba(2,16,30,0.04); }
.dropdown-toggle .dropdown-icon{ font-size:0.8rem; transition: transform 160ms ease; color: #334155; }
.dropdown-toggle[aria-expanded="true"] .dropdown-icon{ transform: rotate(180deg); }
.dropdown-options{ position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); min-width: 180px; max-width: min(360px, 90vw); width: auto; background: #fff; border-radius: 10px; padding: 8px; box-shadow: 0 10px 30px rgba(2,16,30,0.12); border: 1px solid rgba(0,0,0,0.06); list-style: none; margin: 0; z-index: 60; white-space: normal; word-break: break-word; }
.dropdown-options li{ margin: 4px 0; }
.dropdown-options button{ width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; background: transparent; border: none; cursor: pointer; font-family: 'Open Sans', sans-serif; color: #1f2937; }
.dropdown-options button:hover{ background: linear-gradient(90deg, rgba(0,26,50,0.04), rgba(0,26,50,0.02)); }
.dropdown .dropdown-options[hidden]{ display: none; }

/* Ajustes estéticos para filtros: mantener equilibrio y separación */
.filtro-grupo{ display:flex; gap:8px; align-items:center; flex-wrap:nowrap; margin:0 8px; }
.filtros-container .dropdown{ margin-left:6px; }

@media (max-width:600px){
  .dropdown-options{ min-width: 140px; }
}

.cart-product-remove {
  background: none;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  transition: color 0.2s ease;
}

.cart-product-remove:hover {
  color: #b71c1c;
}

/* Total (fijo al final) */
/* Cart & whatsapp moved to header.css */

/* ========================================
   OPCIONES SELECCIONABLES EN TARJETAS
   ======================================== */
.product-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  width: 100%;
}

.option-select {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Open Sans', sans-serif;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.option-select:hover {
  border-color: #999;
}

.option-select:focus {
  outline: none;
  border-color: #001a32;
  box-shadow: 0 0 4px rgba(0, 26, 50, 0.2);
}

/* ========================================
   ANIMACIÓN DE PARPADEO DEL ICONO
   ======================================== */
@keyframes carrito-parpadeo {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

#carrito-icono.carrito-notificacion {
  animation: carrito-parpadeo 1s ease-in-out;
}

/* ========================================
   BOTONES: diseño inline para Añadir + Ojo
   ======================================== */
.actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-add-cart {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #001a32;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-add-cart:focus { outline: 2px solid rgba(0,26,50,0.2); }

.btn-view-product {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 25px;
  background: #000000; /* fondo negro */
  border-radius: 6px;
  color: #ffffff;
  text-decoration: none;
  border: none;
}

.btn-view-product i { font-size: 16px; }

.btn-view-product:focus { outline: 2px solid rgba(0,26,50,0.08); }

/* ========================================
   FORMULARIO SIDEBAR (DATOS DE ENVÍO)
   ======================================== */
.shipping-form-container {
  flex: 1; /* Ocupa el mismo espacio flexible que cart-products */
  overflow-y: auto; /* Scroll si el contenido es largo */
  padding: 10px 5px;
  display: none;
  flex-direction: column;
  gap: 15px;
}

.form-header-sidebar h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: #001a32;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
}
.form-header-sidebar p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.sidebar-form-group {
    margin-bottom: 12px;
}

.sidebar-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.sidebar-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Open Sans', sans-serif;
    box-sizing: border-box;
}

.sidebar-form-group input:focus {
    border-color: #001a32;
    outline: none;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background-color: #000000;
    color: #ffffff;
    padding: 20px 0;
    text-align: center;
    margin: 0;
    width: 100%;
}

footer p {
    margin: 0;
    color: #ffffff;
}

/* ========================================
   MODAL DE ÉXITO
   ======================================== */
.modal-overlay {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: 10px;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-family: 'Open Sans', sans-serif;
}

.btn-whatsapp-modal {
    background-color: #25D366;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s;
}

.btn-whatsapp-modal:hover {
    background-color: #128C7E;
}