/*==============================
        MODAL CELULAR
===============================*/

@media (max-width:768px){

.modalProducto{
    padding:0;
    align-items:flex-end;
}

.modalContenido{
    width:100%;
    height:100vh;
    max-width:none;
    max-height:none;
    border-radius:20px 20px 0 0;
    display:flex;
    flex-direction:column;
    overflow-y:auto;
}

.modalImagen{
    padding:20px;
}

.modalImagen img{
    width:100%;
    height:280px;
    object-fit:contain;
}

.miniaturas{
    margin-top:15px;
}

.modalInfo{
    padding:25px;
}

.modalInfo h2{
    font-size:28px;
}

.btnWhatsapp{
    width:100%;
    justify-content:center;
    margin-top:20px;
}

.cerrarModal{
    position:fixed;
    top:15px;
    right:15px;
    background:white;
    box-shadow:0 5px 15px rgba(0,0,0,.2);
}

}

@media (max-width:768px){

.topHeader{
    flex-direction:column;
    gap:8px;
    padding:10px 15px;
}

.logo img{
    height:55px;
}

.searchBox{
    width:100%;
}

/* OCULTAR CORAZÓN / FAVORITOS EN MÓVIL */
.headerIcons,
.fa-heart,
.bi-heart,
.wishlist-icon,
.icon-heart {
    display: none !important;
}

/* MENÚ DE NAVEGACIÓN EN UNA SOLA LÍNEA HORIZONTAL */
.menu{
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    justify-content: flex-start !important;
    gap: 15px !important;
    padding: 8px 15px !important;
    align-items: center !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.menu::-webkit-scrollbar{
    display:none;
}

.menu a,
.menu li {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

}

/* ==========================================
   AJUSTE SIN FRANJAS NEGRAS EN CELULARES
   ========================================== */

@media (max-width:768px){

.slider {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3.12 / 1 !important;
    overflow: hidden !important;
    position: relative !important;
    background: transparent !important;
}

.sliderTrack {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
}

.slide {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    flex: 0 0 100% !important;
    box-sizing: border-box !important;
}

.slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.caption {
    left: 10px !important;
    right: 10px !important;
    max-width: none !important;
    bottom: 8px !important;
    top: auto !important;
    transform: none !important;
}

.caption h2 {
    font-size: 15px !important;
    margin-bottom: 2px !important;
}

.caption p {
    font-size: 11px !important;
    margin-bottom: 6px !important;
}

.btnSlider {
    padding: 5px 12px !important;
    font-size: 10px !important;
}

/* OCULTAR FLECHAS EN MÓVIL */
.btnNavSlider {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Banner AliExpress */
.bannerAliExpress {
    width: 95% !important;
    margin: 10px auto 0 auto !important;
    padding: 0 !important;
}

.bannerAliImagen {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

}

/* ==========================================
   CATEGORÍAS ESTILO CÍRCULOS Y REDUCCIÓN DE ESPACIOS
   ========================================== */

@media (max-width: 767px) {

  /* Reducción radical de márgenes de las secciones completas */
  section, 
  div[class*="categoria"], 
  div[class*="Category"],
  .seccionCategorias {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }

  /* Título "Explora por categorías" */
  h2, .seccionTitulo, .tituloCategorias {
    margin-top: 5px !important;
    margin-bottom: 5px !important;
    padding: 0 !important;
  }

  .catGrid {
    display: flex !important;
    overflow-x: auto !important;
    gap: 16px !important;
    padding: 0px 10px !important;
    margin: 0 !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .catGrid::-webkit-scrollbar {
    display: none !important;
  }

  .categoria {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex: 0 0 72px !important;
    width: 72px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-decoration: none !important;
    scroll-snap-align: start;
  }

  /* Icono circular compacto */
  .categoria i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    font-size: 20px !important;
    color: #2563eb !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 4px !important;
    border: 1px solid #f1f5f9 !important;
  }

  .categoria span {
    font-size: 11px !important;
    line-height: 1.2 !important;
    color: #475569 !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    font-weight: 500 !important;
  }

  /* Estado seleccionado/activo */
  .categoria.activa i,
  .categoria:active i {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
  }

  .categoria.activa span,
  .categoria:active span {
    color: #1e293b !important;
    font-weight: 700 !important;
  }

  /* RECOGER BOTÓN "MOSTRAR TODOS LOS PRODUCTOS" */
  div:has(> .btnMostrarTodos),
  div:has(> a[href*="tienda"]),
  .contenedorBoton,
  .btnContainer {
    margin-top: 5px !important;
    margin-bottom: 5px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Estilos directos del botón para apretar el bloque */
  button, 
  a.btn, 
  .btnMostrarTodos,
  .btn-todos-productos,
  a[href*="catalogo"],
  a[href*="tienda"],
  .btnVerTodo {
    margin-top: 5px !important;
    margin-bottom: 10px !important;
    padding: 10px 20px !important;
  }

}

/* 2. Tablets (768px a 1024px): Cuadrícula compacta de 4 columnas */
@media (min-width: 768px) and (max-width: 1024px) {

  .catGrid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    padding: 15px !important;
  }

  .categoria {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .categoria i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    font-size: 26px !important;
    color: #2563eb !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 8px !important;
    border: 1px solid #f1f5f9 !important;
  }

  .categoria span {
    font-size: 12px !important;
    color: #475569 !important;
    text-align: center !important;
    font-weight: 500 !important;
  }
}

@media (max-width:768px){

.flashTitulo{
    flex-direction:column;
    gap:20px;
    text-align:center;
}

#contadorFlash{
    justify-content:center;
    flex-wrap:wrap;
}

#contadorFlash span{
    font-size:28px;
    padding:10px 15px;
}

}

/* ==========================================
   2 COLUMNAS / HILERAS EN MÓVIL (CATÁLOGO)
   ========================================== */

* {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

@media (max-width: 768px) {

  .paginaCatalogo {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .card {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }

  .cardTop img {
    width: 100% !important;
    height: auto !important;
    max-height: 130px !important;
    object-fit: contain !important;
  }

  .card .info h3 {
    font-size: 13px !important;
    line-height: 1.2 !important;
    min-height: 32px !important;
    margin: 4px 0 !important;
  }

  .card .info .price {
    font-size: 15px !important;
    margin: 4px 0 !important;
  }

  .card .info p {
    display: none !important;
  }

  .card .buttons {
    display: flex !important;
    gap: 5px !important;
    flex-direction: column !important;
  }

  .card .buttons a {
    font-size: 11px !important;
    padding: 6px 8px !important;
    text-align: center !important;
  }
}