/* ============================================
   ESTILOS PRINCIPALES - AURA'S VAULT
   Versión completa y corregida
   ============================================ */

/* Variables de colores - Estética "Lujo Silencioso" */
:root {
    --champagne-gold: #D4AF37;
    --deep-charcoal: #1A1A1A;
    --soft-nude: #F5F0E6;
    --cream: #FAF7F0;
    --white: #FFFFFF;
    --gray-light: #E8E8E8;
    --gray-medium: #7A7A7A;
    --black: #000000;
    --red-accent: #C62828;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--cream);
    color: var(--deep-charcoal);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

/* Header */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    padding-bottom: 0.5rem;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.brand-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.brand-top {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--champagne-gold);
    letter-spacing: 1px;
    margin: 0;
}

.brand-bottom {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: var( --deep-charcoal);
    letter-spacing: 5px;
    text-transform: uppercase;
    margin: 0;
    margin-top: -12px;
}

/* Buscador desktop */
.desktop-search {
    display: none;
}

.desktop-search .search-form {
    display: flex;
    align-items: center;
    background: var(--soft-nude);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-light);
}

.desktop-search .search-input {
    border: none;
    background: transparent;
    padding: 0.5rem;
    font-size: 0.9rem;
    min-width: 200px;
    outline: none;
    color: var(--deep-charcoal);
}

.desktop-search .search-btn {
    background: none;
    border: none;
    color: var(--champagne-gold);
    cursor: pointer;
    padding: 0.3rem;
    font-size: 1rem;
}

/* Buscador móvil */
.mobile-search .search-form {
    background: var(--white);
    border-radius: 30px;
    padding: 0.5rem 1rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 1px solid var(--gray-light);
    display: flex;
}

.mobile-search .search-input {
    border: none;
    background: transparent;
    padding: 0.8rem 0;
    font-size: 1rem;
    width: 100%;
    outline: none;
    color: var(--deep-charcoal);
}

.mobile-search .search-btn {
    background: var(--champagne-gold);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-search .search-btn:hover {
    background: #b8860b;
}

/* Acciones de usuario y buscador */

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ============================================
   MENÚ MÓVIL - ESTILOS COMPLETOS
   ============================================ */

/* Botón hamburguesa */
.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--champagne-gold);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 8px;
}

.mobile-menu-btn:hover {
    background-color: var(--soft-nude);
    color: var(--deep-charcoal);
}

/* Menú móvil - Oculto por defecto */
.main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--white);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.4s ease;
    z-index: 1000;
    padding: 4rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.main-nav.active {
    right: 0;
}

/* Botón cerrar dentro del menú */
.mobile-menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--deep-charcoal);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1002;
}

.mobile-menu-close:hover {
    background-color: var(--soft-nude);
    color: var(--champagne-gold);
}

/* Overlay para fondo oscuro */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Lista del menú */
.main-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    padding: 0;
    margin-top: 1rem;
}

.main-nav li {
    width: 100%;
    border-bottom: 1px solid var(--gray-light);
}

.main-nav li:last-child {
    border-bottom: none;
}

.main-nav a {
    display: block;
    padding: 1rem 0.5rem;
    color: var(--deep-charcoal);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 6px;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: var(--soft-nude);
    color: var(--champagne-gold);
    padding-left: 1rem;
}

/* Bloquear scroll cuando el menú está abierto */
body.menu-open {
    overflow: hidden;
}

/* Desktop: ocultar botón hamburguesa y mostrar navegación normal */
@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
    
    .mobile-menu-close {
        display: none;
    }
    
    .mobile-menu-overlay {
        display: none;
    }
    
    .main-nav {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        box-shadow: none;
        padding: 0;
        display: block;
        max-height: none;
        overflow: visible;
        right: 0;
    }
    
    .main-nav ul {
        flex-direction: row;
        gap: 1.5rem;
        margin-top: 0;
    }
    
    .main-nav li {
        border-bottom: none;
        width: auto;
    }
    
    .main-nav a {
        padding: 0.5rem 0;
        background: transparent !important;
        font-size: 0.95rem;
    }
    
    .main-nav a:hover,
    .main-nav a.active {
        padding-left: 0.5rem;
        background: transparent !important;
    }
    
    .main-nav a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background-color: var(--champagne-gold);
        transition: width 0.3s ease;
    }
    
    .main-nav a:hover::after,
    .main-nav a.active::after {
        width: 100%;
    }
    
    .desktop-search {
        display: block;
    }
    
    .mobile-search {
        display: none;
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 359px) {
    .main-nav {
        width: 100%;
        right: -100%;
    }
    
    .main-nav.active {
        right: 0;
    }
}

/* ============================================
   ESTILOS PARA CATEGORÍAS - SCROLL HORIZONTAL
   ============================================ */

.categorias-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
    overflow: hidden; /* Ocultar scrollbar por defecto */
}

.categorias-grid {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    overflow-x: auto; /* Scroll horizontal */
    padding-bottom: 1rem; /* Espacio para scrollbar */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--champagne-gold) var(--gray-light); /* Firefox */
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
}

/* Estilos para la barra de scroll en Webkit (Chrome, Safari, Edge) */
.categorias-grid::-webkit-scrollbar {
    height: 8px;
}

.categorias-grid::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

.categorias-grid::-webkit-scrollbar-thumb {
    background-color: var(--champagne-gold);
    border-radius: 4px;
}

/* Evitar que se encojan las tarjetas */
.categorias-grid > * {
    flex: 0 0 auto; /* No permitir que se encojan */
}

.categoria-link {
    text-decoration: none;
    color: inherit;
    display: block;
    min-width: 150px; /* Ancho mínimo para cada categoría */
}

.categoria-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-light);
    height: 180px; /* Altura fija */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; /* Ocupar todo el ancho disponible */
}

.categoria-card:hover {
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.15);
    border-color: var(--champagne-gold);
    transform: translateY(-5px); /* Efecto de elevación al hover */
}

.categoria-icon {
    width: 60px;
    height: 60px;
    background-color: var(--soft-nude);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--champagne-gold);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.categoria-link:hover .categoria-icon {
    background-color: var(--champagne-gold);
    color: var(--white);
    transform: scale(1.1); /* Efecto de aumento al hover */
}

.categoria-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--deep-charcoal);
    margin-bottom: 0.5rem;
    white-space: nowrap; /* Evitar saltos de línea */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Controles de vista y filtro */
.controles-vista {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    padding: 0 1rem;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.controles-izquierda {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.select-orden {
    background: var(--white);
    border: 1px solid var(--gray-light);
    color: var(--deep-charcoal);
    padding: 0.6rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    min-width: 180px;
    cursor: pointer;
    outline: none;
}

.select-orden:focus {
    border-color: var(--champagne-gold);
}

.vista-botones {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-vista {
    background: var(--white);
    border: 1px solid var(--gray-light);
    color: var(--gray-medium);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-vista:hover {
    border-color: var(--champagne-gold);
    color: var(--champagne-gold);
}

.btn-vista.active {
    background: var(--champagne-gold);
    border-color: var(--champagne-gold);
    color: white;
}

/* Contenido principal */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
    width: 100%;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--deep-charcoal);
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background-color: var(--champagne-gold);
}

/* Productos Grid - BASE RESPONSIVE */
.productos-grid.grid-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Estilos para vista de lista */
.productos-grid.lista-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Tarjetas de producto MÓVIL */
.producto-card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: auto;
    cursor: pointer;
    width: 100%; /* Responsive por defecto */
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Imagen del producto */
.producto-imagen {
    position: relative;
    overflow: hidden;
    height: 180px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--soft-nude);
}

.producto-imagen img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    transition: transform 0.5s ease;
}

.producto-card:hover .producto-imagen img {
    transform: scale(1.05);
}

/* Overlay para botón */
.producto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.producto-card:hover .producto-overlay {
    opacity: 1;
}

.btn-ver-detalle {
    background-color: var(--champagne-gold);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-ver-detalle:hover {
    background-color: #b8860b;
    transform: scale(1.05);
}

/* Información del producto */
.producto-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--gray-light);
}

/* Nombre de producto */
.producto-nombre {
    font-size: 1rem !important;
    line-height: 1.3;
    min-height: 2.2rem;
    margin-bottom: 0.3rem;
    display: block;
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    font-weight: 600;
    color: var(--deep-charcoal);
}

/* Descripción con puntos suspensivos */
/* ELIMINADO EL TRUNCADO */
.producto-descripcion {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
    margin-bottom: 0.8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1; /* Limitar a 3 líneas */      
    -webkit-box-orient: vertical;
}

.producto-card.lista-view .producto-descripcion {
    -webkit-line-clamp: 2; /* En vista lista, 2 líneas */
}

.producto-card:not(.lista-view) .producto-descripcion {
    -webkit-line-clamp: 10; /* En vista grid, 3 líneas */
}

.producto-precio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid var(--gray-light);
}

.precio-actual {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--red-accent);
}

.producto-categoria {
    font-size: 0.7rem;
    color: var(--gray-medium);
    background-color: var(--soft-nude);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

/* Sin productos */
.no-productos-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin: 1rem 0;
}

.no-productos-icon {
    font-size: 2.5rem;
    color: var(--champagne-gold);
    margin-bottom: 1rem;
}

.btn-volver {
    display: inline-block;
    background: var(--champagne-gold);
    color: white;
    padding: 10px 25px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-volver:hover {
    background: #b8860b;
    transform: translateY(-2px);
}

/* ============================================
   PRODUCTOS RELACIONADOS - CORREGIDO
   ============================================ */

/* Grid para productos relacionados - ANCHO FIJO 350px */
.relacionados-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)) !important;
    gap: 2rem !important;
    margin-top: 2rem !important;
    justify-items: center !important;
}

/* Tarjetas de productos relacionados con ancho fijo 350px */
.relacionados-grid .producto-card {
    width: 350px !important;
    max-width: 350px !important;
    min-width: 350px !important;
    height: auto !important;
    margin: 0 !important;
}

.relacionados-grid .producto-imagen {
    height: 240px !important;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background-color: var(--deep-charcoal);
    color: var(--cream);
    padding: 2rem 0 1rem;
    margin-top: 3rem;
    width: 100%;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    justify-content: center;
}

.footer-logo .footer-logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
    margin-right: 10px;
}

.footer-logo .brand-top {
    font-size: 1rem;
    color: var(--champagne-gold);
}

.footer-logo .brand-bottom {
    font-size: 1.3rem;
    color: var(--cream);
}

.footer-description {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--gray-light);
    text-align: center;
}

.footer-links,
.footer-contact,
.footer-social {
    text-align: center;
}

.footer-links h4,
.footer-contact h4,
.footer-social h4 {
    color: var(--champagne-gold);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: 'Cinzel', serif;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--cream);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--champagne-gold);
}

.footer-contact p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
}

.footer-contact i {
    color: var(--champagne-gold);
    width: 20px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--cream);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--champagne-gold);
    transform: translateY(-3px);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--gray-medium);
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    grid-column: 1 / -1;
}

/* ============================================
   MEDIA QUERIES PARA DISPOSITIVOS MÁS GRANDES
   ============================================ */

/* Tablets (768px y más) */
@media (min-width: 768px) {
    .header-container {
        padding: 1rem 2rem;
    }
    
    .desktop-search {
        display: block;
    }
    
    .mobile-search {
        display: none;
    }
    
    .categorias-container {
        padding: 0 2rem;
    }
    
    /* Categorías en tablet - scroll horizontal con tarjetas más grandes */
    .categoria-link {
        min-width: 180px; /* Ancho mínimo mayor en tablet */
    }
    
    .categoria-card {
        padding: 2rem 1.5rem;
        height: 200px; /* Altura mayor en tablet */
    }
    
    .categoria-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .categoria-card h3 {
        font-size: 1.2rem;
    }
    
    .main-content {
        padding: 0 2rem 4rem;
    }
    
    .section-title {
        font-size: 2rem;
        margin: 2rem 0;
        padding-bottom: 15px;
    }
    
    /* Productos Grid DESKTOP - 350px ANCHO FIJO */
    .productos-grid.grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        justify-items: center;
    }
    
    /* Tarjetas de producto DESKTOP - 350px ANCHO FIJO */
    .main-content .productos-grid.grid-view .producto-card {
        width: 350px !important;
        max-width: 350px !important;
        min-width: 350px !important;
        height: 500px !important;
        margin: 0 !important;
    }
    
    .main-content .productos-grid.grid-view .producto-imagen {
        height: 220px !important;
    }
    
    /* Botones de control DESKTOP */
    .vista-botones {
        display: none;
    }
    
    .controles-vista {
        padding: 0;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 1rem;
    }
    
    .controles-izquierda {
        flex-wrap: nowrap;
        gap: 1rem;
        margin-right: auto;
    }
    
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 2rem;
        gap: 3rem;
    }
    
    .footer-brand {
        text-align: left;
        align-items: flex-start;
    }
    
    .footer-logo {
        justify-content: flex-start;
    }
    
    .footer-description {
        text-align: left;
    }
    
    .footer-links,
    .footer-contact,
    .footer-social {
        text-align: left;
    }
    
    .footer-contact p {
        justify-content: flex-start;
    }
    
    .social-icons {
        justify-content: flex-start;
    }
}

/* Desktop (1024px y más) */
@media (min-width: 1024px) {
    .productos-grid.grid-view {
        grid-template-columns: repeat(4, 1fr) !important; 
        gap: 0.5rem !important;
    }
    
    .main-content .productos-grid.grid-view .producto-card {
        width: 350px !important;
        max-width: 350px !important;
        min-width: 350px !important;
        height: 500px !important;
    }
    
    .main-content .productos-grid.grid-view .producto-imagen {
        height: 250px !important;
    }
    
    /* Categorías en desktop - scroll horizontal con tarjetas más anchas */
    .categoria-link {
        min-width: 200px; /* Ancho mínimo mayor en desktop */
    }
    
    /* Productos relacionados en desktop */
    .relacionados-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .relacionados-grid .producto-imagen {
        height: 200px !important;
    }
    
    .footer-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop grande (1200px y más) */
@media (min-width: 1200px) {
    .productos-grid.grid-view {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .main-content .productos-grid.grid-view .producto-card {
        width: 350px !important;
        max-width: 350px !important;
        min-width: 350px !important;
        height: 500px !important;
    }
    
    /* Categorías en desktop grande */
    .categoria-link {
        min-width: 220px; /* Ancho mínimo aún mayor en pantallas grandes */
    }
    
    .categoria-card {
        height: 220px; /* Altura mayor en pantallas grandes */
    }
    
    /* Productos relacionados en pantallas grandes */
    .relacionados-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Desktop extra grande (1400px y más) */
@media (min-width: 1400px) {
    .productos-grid.grid-view {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .main-content .productos-grid.grid-view .producto-card {
        width: 350px !important;
        max-width: 350px !important;
        min-width: 350px !important;
        height: 500px !important;
    }
    
    /* Productos relacionados en pantallas extra grandes */
    .relacionados-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Para pantallas muy pequeñas (menos de 360px) */
@media (max-width: 359px) {
    .productos-grid.grid-view {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    
    .brand-bottom {
        font-size: 1.2rem;
    }
    
    .producto-card.lista-view {
    display: grid;
    grid-template-columns: 120px 1fr;
    height: auto;
    min-height: 140px; /* Puedes ajustar esto si es necesario */
}
    
    .producto-card.lista-view .producto-imagen {
    height: 140px; /* Cambiado de 219px a 140px */
    border-radius: 10px 0 0 10px;
}
    
    /* Categorías en pantallas muy pequeñas */
    .categoria-link {
        min-width: 140px; /* Ancho mínimo menor en pantallas muy pequeñas */
    }
    
    .categoria-card {
        height: 160px; /* Altura menor en pantallas muy pequeñas */
        padding: 1rem 0.8rem;
    }
    
    .categoria-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    .categoria-card h3 {
        font-size: 0.9rem;
    }
    
    /* Productos relacionados en móvil */
    .relacionados-grid {
        grid-template-columns: 1fr !important;
    }
    
    .relacionados-grid .producto-card {
        width: 100% !important;
        max-width: 300px !important;
        min-width: 0 !important;
    }
}

/* Para dispositivos móviles específicos */
@media (max-width: 767px) {
    .select-orden {
        min-width: 140px;
    }
    
    .productos-grid.grid-view {
        grid-template-columns: repeat(2, 1fr);
        justify-items: center;
    }
    
    /* Productos relacionados en tablet */
    .relacionados-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .relacionados-grid .producto-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Nombre de producto */
.producto-nombre {
    font-size: 0.82rem !important;
    
}

/* Descripción con puntos suspensivos */
.producto-descripcion {
    font-size: 0.65rem;
   
}
.precio-actual {
    font-size: 0.9rem;
   
}

}

/* ============================================
   CLASES UTILITARIAS
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* Mensajes de error/éxito */
.mensaje {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.mensaje-success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
    color: #2e7d32;
}

.mensaje-error {
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid #f44336;
    color: #d32f2f;
}

.mensaje-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #ff8f00;
}

/* Animaciones */
@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: slideIn 0.5s ease;
}

/* Bloquear scroll cuando el menú está abierto */
body.menu-open {
    overflow: hidden;
}

/* Ajustes de descripción para diferentes vistas */
.producto-card.grid-view .producto-descripcion {
    -webkit-line-clamp: 2;
}



/* NOTIFICACIONES - compatibles con JS */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2196F3;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideInRight 0.3s ease;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}





/* ============================================
   ESTILOS PARA FILTROS POR TIPO (PESTAÑAS)
   ============================================ */
.tipo-filtros {
    margin: 2rem auto;
    max-width: 1400px;
    padding: 0 1rem;
    width: 100%;
}

.tipo-filtros-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--champagne-gold) var(--gray-light);
}

.tipo-filtros-container::-webkit-scrollbar {
    height: 4px;
}

.tipo-filtros-container::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 2px;
}

.tipo-filtros-container::-webkit-scrollbar-thumb {
    background-color: var(--champagne-gold);
    border-radius: 2px;
}

.tipo-btn {
    background: var(--white);
    border: 1px solid var(--gray-light);
    color: var(--deep-charcoal);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

.tipo-btn:hover {
    background: var(--soft-nude);
    border-color: var(--champagne-gold);
    color: var(--champagne-gold);
}

.tipo-btn.active {
    background: var(--champagne-gold);
    color: white;
    border-color: var(--champagne-gold);
    font-weight: 600;
}

.tipo-btn.active:hover {
    background: #b8860b;
    border-color: #b8860b;
}

/* ============================================
   GRID DE PRODUCTOS - CONTROL DE FILAS
   ============================================ */

/* LIMITAR A 4 FILAS VISIBLES POR PÁGINA */
/* Contenedor principal para limitar altura */
.productos-grid-container {
    max-height: calc(4 * (auto-fit según contenido)); /* 4 filas máximo */
    overflow: hidden;
    position: relative;
}

/* O mejor, ajustar el grid para mostrar exactamente 16 productos por página */
/* Esto se controla desde PHP (16 productos por página) */

/* Grid básico */
.productos-grid.grid-view {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* MÓVIL: 2 columnas × 4 filas = 8 productos visibles */
@media (max-width: 767px) {
    .productos-grid.grid-view {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: minmax(300px, auto); /* Altura mínima para cada fila */
    }
    
    /* Ocultar productos más allá del 8vo (si hay más de 8 en la página) */
    .productos-grid.grid-view .producto-card:nth-child(n+17) {
        display: none;
    }
}

/* TABLET: 2 columnas × 4 filas = 8 productos (igual que móvil por ahora) */
@media (min-width: 768px) and (max-width: 1023px) {
    .productos-grid.grid-view {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: minmax(320px, auto);
    }
    
    /* Ocultar productos más allá del 8vo */
    .productos-grid.grid-view .producto-card:nth-child(n+17) {
        display: none;
    }
}

/* DESKTOP: 4 columnas × 4 filas = 16 productos visibles */
@media (min-width: 1024px) {
    .productos-grid.grid-view {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: minmax(350px, auto);
        gap: 0.5rem;
    }
    
    /* Mostrar todos los 16 productos (que es lo que PHP envía por página) */
    .productos-grid.grid-view .producto-card {
        display: block;
    }
}

/* Desktop grande (1200px+) */
@media (min-width: 1200px) {
    .productos-grid.grid-view {
        gap: 2rem;
        grid-auto-rows: minmax(380px, auto);
    }
}

/* Desktop extra grande (1400px+) */
@media (min-width: 1400px) {
    .productos-grid.grid-view {
        gap: 2.5rem;
        grid-auto-rows: minmax(400px, auto);
    }
}

/* ============================================
   PAGINACIÓN
   ============================================ */
.paginacion-container {
    margin: 3rem auto 2rem;
    max-width: 1400px;
    padding: 0 1rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.paginacion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagina-btn {
    background: var(--white);
    border: 1px solid var(--gray-light);
    color: var(--deep-charcoal);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
}

.pagina-btn:hover:not(.active):not(.disabled) {
    border-color: var(--champagne-gold);
    color: var(--champagne-gold);
    transform: translateY(-2px);
}

.pagina-btn.active {
    background: var(--champagne-gold);
    color: white;
    border-color: var(--champagne-gold);
    font-weight: 600;
}

.pagina-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagina-btn.dots {
    background: transparent;
    border: none;
    cursor: default;
    width: auto;
    min-width: 40px;
}

.pagina-btn.dots:hover {
    transform: none;
    background: transparent;
}

.pagina-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--gray-medium);
    text-align: center;
    width: 100%;
    justify-content: center;
}

/* Para pantallas pequeñas */
@media (max-width: 767px) {
    .paginacion {
        gap: 0.3rem;
    }
    
    .pagina-btn {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
    
    .pagina-info {
        font-size: 0.8rem;
    }
}

/* ============================================
   AJUSTES DE TARJETAS PARA EL NUEVO GRID
   ============================================ */
/* Eliminar ancho fijo para permitir grid responsive */
.main-content .productos-grid.grid-view .producto-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100%; /* Ocupar toda la altura de la celda del grid */
    display: flex;
    flex-direction: column;
}

/* Ajustar altura de imagen para mantener proporciones */
.main-content .productos-grid.grid-view .producto-imagen {
    height: 180px !important; /* Reducir un poco para móvil */
    flex-shrink: 0; /* No permitir que la imagen se encoja */
}

@media (min-width: 768px) {
    .main-content .productos-grid.grid-view .producto-imagen {
        height: 200px !important;
    }
}

@media (min-width: 1024px) {
    .main-content .productos-grid.grid-view .producto-imagen {
        height: 220px !important;
    }
}

@media (min-width: 1200px) {
    .main-content .productos-grid.grid-view .producto-imagen {
        height: 240px !important;
    }
}

@media (min-width: 1400px) {
    .main-content .productos-grid.grid-view .producto-imagen {
        height: 260px !important;
    }
}

/* Mejorar la distribución del contenido */
.producto-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 150px; /* Altura mínima para el contenido */
}

.producto-descripcion {
    flex: 1;
    overflow: hidden;
}

/* Asegurar que todas las tarjetas tengan la misma altura */
.productos-grid.grid-view {
    align-items: stretch; /* Hace que todas las tarjetas tengan la misma altura */
}

/* ============================================
   ESTILOS PARA FILTRO DE TIPO ACTIVO
   ============================================ */
.tipo-activo-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--soft-nude);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--deep-charcoal);
}

.tipo-activo-indicator .btn-eliminar-filtro {
    background: none;
    border: none;
    color: var(--red-accent);
    cursor: pointer;
    padding: 0.2rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.tipo-activo-indicator .btn-eliminar-filtro:hover {
    background: rgba(198, 40, 40, 0.1);
}

/* ============================================
   ESTILO PARA INDICAR QUE HAY MÁS PÁGINAS
   ============================================ */
.paginacion-nota {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-medium);
    margin-top: 1rem;
    font-style: italic;
}

/* Si en móvil/tablet quieres mostrar solo 8 productos (2x4), 
   pero en PHP estás obteniendo 16, puedes ocultar los extras con CSS */
@media (max-width: 1023px) {
    /* Mostrar solo los primeros 8 productos */
    .productos-grid.grid-view .producto-card:nth-child(n+17) {
        display: none !important;
    }
    
    /* Añadir un mensaje si hay más productos */
    .productos-grid.grid-view.has-more-products::after {
        content: '... y ' attr(data-more-count) ' productos más';
        display: block;
        grid-column: 1 / -1;
        text-align: center;
        padding: 1.5rem;
        color: var(--champagne-gold);
        font-weight: 600;
        font-size: 0.9rem;
        background: var(--soft-nude);
        border-radius: 10px;
        margin-top: 1rem;
    }
}

/* En desktop mostrar todos los 16 */
@media (min-width: 1024px) {
    .productos-grid.grid-view .producto-card {
        display: block !important;
    }
    
    .productos-grid.grid-view.has-more-products::after {
        display: none;
    }
}