/* ============================================================================
   VARIABLES Y RESET
   ============================================================================ */

:root {
    --primary-color: #ff9ec4;
    --primary-dark: #ff7ba8;
    --secondary-color: #ffc0d9;
    --accent-color: #ffb3d1;
    --text-primary: #1b2430;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* ============================================================================
   UTILIDADES
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    overflow-x: hidden;
    overflow-y: visible !important;
}

/* Asegurar que el contenedor dentro de category-menu-section no limite el dropdown */
.category-menu-section .container {
    overflow: visible !important;
}

/* ============================================================================
   BANNER PROMOCIONAL
   ============================================================================ */

.promotional-banner-section {
    width: 100vw;
    max-width: 100vw;
    background: var(--bg-primary);
    padding: 0.75rem 0;
    margin: 0;
    overflow: hidden;
    display: block;
    min-height: 50px;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    box-sizing: border-box;
    z-index: 1;
}

.promotional-banner-section .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 1rem !important;
    margin: 0 auto !important;
}

.promotional-banner-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: visible;
    border-radius: 0;
    /* Mostrar un borde sutil cuando no hay imagen para indicar el área */
    border: 2px dashed var(--border-color);
    min-height: 80px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: var(--bg-secondary);
    position: relative;
}

.promotional-banner-wrapper.has-image {
    border: none;
    background: transparent;
    min-height: auto;
    overflow: visible;
}

.promotional-banner-image {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: top center;
    display: none;
    margin: 0 auto;
    border-radius: 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.promotional-banner-image[src]:not([src=""]) {
    display: block;
}

.promotional-banner-image:hover {
    opacity: 0.95;
}

/* Botón de administrador en el banner */
.banner-admin-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 158, 196, 0.95);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.banner-admin-btn:hover {
    background: rgba(255, 123, 168, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.banner-admin-btn svg {
    width: 18px;
    height: 18px;
}

/* Modal para subir banner */
.banner-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.banner-upload-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.banner-upload-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.banner-upload-modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: var(--text-primary);
}

.banner-upload-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.banner-upload-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.banner-upload-modal-body {
    padding: 24px;
}

.banner-upload-option {
    margin-bottom: 24px;
}

.banner-upload-option h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.btn-upload-file {
    width: 100%;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.3s;
}

.btn-upload-file:hover {
    background: var(--bg-primary);
    border-color: #ff9ec4;
    color: #ff9ec4;
}

.banner-upload-file-name {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.banner-upload-divider {
    text-align: center;
    margin: 24px 0;
    color: var(--text-secondary);
    font-weight: 600;
    position: relative;
}

.banner-upload-divider::before,
.banner-upload-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--border-color);
}

.banner-upload-divider::before {
    left: 0;
}

.banner-upload-divider::after {
    right: 0;
}

.banner-upload-url-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.banner-upload-url-input:focus {
    outline: none;
    border-color: #ff9ec4;
    box-shadow: 0 0 0 3px rgba(255, 158, 196, 0.1);
}

.banner-upload-option small {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.banner-upload-preview {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.banner-upload-preview h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.banner-upload-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.banner-upload-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.btn-banner-primary {
    padding: 12px 24px;
    background: #ff9ec4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-banner-primary:hover {
    background: #ff7ba8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 158, 196, 0.3);
}

.btn-banner-secondary {
    padding: 12px 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-banner-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--text-secondary);
}

@media (max-width: 768px) {
    .promotional-banner-image {
        max-height: none;
        object-fit: contain;
    }

    .banner-admin-btn {
        top: 5px;
        right: 5px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .banner-upload-modal-content {
        max-width: 95%;
    }
}

/* Placeholder cuando no hay imagen */
.promotional-banner-wrapper:not(.has-image)::before {
    content: "Área para banner promocional - El administrador puede configurar una imagen aquí";
    display: block;
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
}

/* Responsive para el banner */
@media (max-width: 768px) {
    .promotional-banner-section {
        padding: 0.5rem 0;
    }

    .promotional-banner-image {
        max-height: none;
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .promotional-banner-image {
        max-height: none;
        object-fit: contain;
    }
}

/* ============================================================================
   HEADER
   ============================================================================ */

.header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
    width: 100%;
    max-width: 100%;
    min-height: auto;
    height: auto;
    overflow: visible;
    margin-bottom: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    position: relative;
    flex-wrap: wrap;
    min-height: auto;
    height: auto;
    overflow: visible;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.logo-img {
    height: auto;
    max-height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: visible;
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    font-size: 1.25rem;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* Menú desplegable de categorías en el header */
.categories-dropdown-wrapper {
    /* El wrapper solo contiene el botón, NO el modal */
    position: relative;
    display: inline-block;
    z-index: 1002;
    overflow: visible !important;
    /* NO permitir que el wrapper cambie de tamaño */
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    vertical-align: top;
    /* Asegurar que el wrapper NO afecte el layout del header */
    width: auto !important;
}

.categories-dropdown-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer !important;
    font-family: inherit;
    font-size: inherit;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    pointer-events: auto !important;
    z-index: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.categories-dropdown-btn:hover {
    color: var(--primary-color);
}

.categories-dropdown-btn::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.categories-dropdown-btn:hover::after {
    width: 100%;
}

.categories-dropdown-btn svg {
    transition: transform 0.3s ease;
}

.categories-dropdown-wrapper:hover .categories-dropdown-btn svg,
.categories-dropdown-wrapper.active .categories-dropdown-btn svg {
    transform: rotate(180deg);
}

/* Modal overlay para el menú de categorías */
.categories-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 9998 !important;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.categories-modal-overlay.active {
    display: block;
    opacity: 1;
}

.categories-dropdown-menu {
    /* CRÍTICO: position: fixed para que NO afecte el layout del header */
    position: fixed !important;
    background: white !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 750px !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    overflow: hidden !important;
    z-index: 10000 !important;
    border: 1px solid var(--border-color) !important;
    padding: 0 !important;
    /* CRÍTICO: Cuando está oculto, NO debe ocupar espacio ni afectar el layout */
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate(-50%, -50%) scale(0.95) !important;
    /* CRÍTICO: display: none cuando está oculto para que NO ocupe espacio */
    display: none !important;
    box-sizing: border-box;
    margin: 0 !important;
    /* NO tener height fijo que afecte el flujo */
    height: auto !important;
    min-height: 200px !important;
    /* Transición suave */
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    /* Centrado en la pantalla */
    top: 50% !important;
    left: 50% !important;
}

.categories-dropdown-menu.active {
    /* CRÍTICO: Solo mostrar cuando está activo */
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.categories-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 1.25rem 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.categories-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.categories-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    line-height: 1;
}

.categories-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.categories-dropdown-content {
    padding: 1rem !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* Ajustar max-height para que no se corte considerando el header (90vh - 120px para el header) */
    max-height: calc(90vh - 120px) !important;
    min-height: 200px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    /* Asegurar que el scroll funcione correctamente */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    /* Asegurar que el contenido no se corte */
    flex: 1 1 auto !important;
}

.categories-dropdown-content::-webkit-scrollbar {
    width: 8px;
}

.categories-dropdown-content::-webkit-scrollbar-track {
    background: transparent;
}

.categories-dropdown-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.categories-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive para el modal de categorías */
@media (max-width: 768px) {
    .categories-dropdown-menu {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 85vh !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0.95) !important;
    }

    .categories-dropdown-menu.active {
        transform: translate(-50%, -50%) scale(1) !important;
    }

    .categories-modal-header {
        padding: 1rem 1.25rem;
        padding-bottom: 0.875rem;
    }

    .categories-modal-title {
        font-size: 1rem;
    }

    .categories-modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }

    .categories-dropdown-content {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.625rem !important;
        padding: 0.875rem !important;
        max-height: calc(85vh - 100px) !important;
    }
}

@media (max-width: 480px) {
    .categories-dropdown-menu {
        width: 98vw !important;
        max-width: 98vw !important;
        max-height: 90vh !important;
        border-radius: var(--radius-md);
    }

    .categories-modal-header {
        padding: 0.875rem 1rem;
        padding-bottom: 0.75rem;
    }

    .categories-modal-title {
        font-size: 0.9375rem;
    }

    .categories-modal-close {
        width: 28px;
        height: 28px;
        font-size: 1.125rem;
    }

    .categories-dropdown-content {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
        max-height: calc(90vh - 90px) !important;
    }
}

.categories-dropdown-content .categories-loading {
    grid-column: 1 / -1;
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.categories-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.categories-dropdown-item {
    display: block;
    width: 100%;
    padding: 1rem 1.25rem;
    text-align: left;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.categories-dropdown-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.categories-dropdown-item:first-child {
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.categories-dropdown-item:last-child {
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Cerrar dropdown al hacer clic fuera */
.categories-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: transparent;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    min-width: 0;
}

/* Cuando user-menu-header está dentro del nav */
.nav .user-menu-header {
    margin-left: 1rem;
}

.cart-icon-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Cuando cart-icon-wrapper está dentro del nav */
.nav .cart-icon-wrapper {
    margin-left: 1rem;
}

.cart-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.cart-icon-btn:hover {
    background: var(--bg-secondary);
}

.cart-icon-btn svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0 4px;
    box-sizing: border-box;
}

.user-name-header {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

/* Botones de iconos (Cerrar Sesión) */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Botón de cerrar sesión (icono) */
.btn-logout-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.btn-logout-icon:hover {
    background: var(--bg-secondary);
    color: #dc3545;
    transform: translateY(-2px);
}

/* Mantener compatibilidad con clases antiguas */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
    height: fit-content;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 158, 196, 0.3);
}

.btn-logout-header {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: inherit;
}

.btn-logout-header:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-admin {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-admin:hover {
    background: var(--primary-dark);
}

/* Botón de administrador solo icono */
.btn-admin-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-admin-icon:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 158, 196, 0.3);
}

.btn-admin-icon svg {
    width: 20px;
    height: 20px;
}

/* Buscador en el header */
.header-search-container {
    position: relative;
    width: 200px;
    margin-left: 1rem;
}

/* Buscador móvil (oculto por defecto en desktop) */
.mobile-search-container {
    display: none;
}

.header-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.header-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 158, 196, 0.15);
}

.header-search-icon {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* Menú Desplegable de Redes Sociales */
.social-media-dropdown {
    position: relative;
    margin-left: 0.5rem;
    display: flex;
    align-items: center;
    height: 100%;
}

.social-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.social-dropdown-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 158, 196, 0.3);
}

.social-dropdown-btn svg {
    width: 24px;
    height: 24px;
}

.social-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.social-media-dropdown.active .social-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.social-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.social-dropdown-item:last-child {
    border-bottom: none;
}

.social-dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.social-dropdown-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.social-dropdown-item span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================================================
   CATEGORY MENU SECTION
   ============================================================================ */

.category-menu-section {
    padding: 1.5rem 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: visible !important;
}

.category-menu-header {
    text-align: center;
    margin-bottom: 1rem;
}

.category-menu-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.category-menu-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.category-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    position: relative;
    overflow: visible !important;
}

.category-menu {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.category-menu::-webkit-scrollbar {
    height: 6px;
}

.category-menu::-webkit-scrollbar-track {
    background: transparent;
}

.category-menu::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.category-menu::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Dropdown de categorías */
.category-dropdown-wrapper {
    position: relative;
    flex-shrink: 0;
    overflow: visible !important;
    z-index: 10001 !important;
}

.category-dropdown-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: #ffffff;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.813rem;
    font-family: inherit;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 36px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.category-dropdown-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.category-dropdown-btn:hover::before {
    left: 100%;
}

.category-dropdown-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-dark);
    background: linear-gradient(135deg, #fff5f9, #ffeef5);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 158, 196, 0.3);
}

.category-dropdown-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-dark);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 123, 168, 0.4), 0 0 0 3px rgba(255, 158, 196, 0.2);
    font-weight: 700;
    transform: translateY(-2px) scale(1.05);
}

.category-dropdown-btn svg {
    transition: transform 0.3s ease;
}

.category-dropdown-btn.active svg {
    transform: rotate(180deg);
}

.category-dropdown-menu {
    display: none;
    position: fixed !important;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10001 !important;
    padding: 0.5rem;
    gap: 0.25rem;
    flex-direction: column;
    margin: 0 !important;
    transform: none !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
}

.category-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.category-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.category-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.category-dropdown-item {
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-family: inherit;
    text-align: left;
    width: 100%;
}

.category-dropdown-item:hover {
    background: rgba(42, 116, 255, 0.1);
    color: var(--primary-color);
}

.category-dropdown-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 600;
}

.category-menu-item {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: #ffffff;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.813rem;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.category-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.category-menu-item:hover::before {
    left: 100%;
}

.category-menu-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-dark);
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-menu-item.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 6px rgba(255, 123, 168, 0.3);
    font-weight: 600;
}

.category-menu-item.active:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 6px rgba(255, 123, 168, 0.3);
}

/* ============================================================================
   HERO SECTION - PRODUCTS DISPLAY
   ============================================================================ */

.hero-products {
    position: relative;
    min-height: 600px;
    padding: 4rem 0;
    overflow: hidden;
    background: linear-gradient(135deg, #ffd6e8 0%, #ffb3d1 100%);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(42, 116, 255, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    opacity: 0.5;
}

.hero-products-header {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

.hero-products-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.8s ease-out;
}

.hero-products-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    margin-bottom: 1.5rem;
}

/* Filtro de Ordenamiento */
.product-sort-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.product-sort-label {
    color: white;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

.product-sort-select {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    min-width: 220px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ff6fae' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.product-sort-select:hover {
    background-color: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-md);
}

.product-sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 158, 196, 0.2);
}

.product-sort-select option {
    background: white;
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Buscador en la sección rosada */
.hero-search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hero-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.hero-search-input::placeholder {
    color: var(--text-light);
}

.hero-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.hero-products-grid {
    position: relative;
    z-index: 1;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
    gap: 1.2rem;
    margin-top: 2rem;
    width: 100%;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
}

.hero-products-grid .product-card {
    max-width: 100%;
    width: 100%;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product cards en el hero tienen fondo blanco para contraste */
.hero-products-grid .product-card {
    background: white;
    box-shadow: var(--shadow-xl);
}

.hero-products-grid .product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.hero-products-grid .empty-state {
    color: white;
    grid-column: 1 / -1;
}

.hero-products-grid .empty-state svg {
    color: white;
}

.hero-products-grid .empty-state h3,
.hero-products-grid .empty-state p {
    color: white;
}

/* ============================================================================
   TOP PRODUCTS SECTION - PRODUCTOS MÁS VENDIDOS
   ============================================================================ */

.top-products-section {
    padding: 4rem 0;
    background: #ffffff;
    display: block;
}

.top-products-header {
    text-align: center;
    margin-bottom: 3rem;
}

.top-products-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.top-products-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Contenedor del carrusel de productos top */
.top-products-carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.top-products-carousel {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
    align-items: flex-start;
    animation: scrollCarousel 30s linear infinite;
    will-change: transform;
}

.top-products-carousel .product-card-link.modern-card {
    flex-shrink: 0;
    margin: 0;
    width: 252px !important;
    min-width: 252px !important;
    max-width: 252px !important;
}

.top-products-carousel:hover {
    animation-play-state: paused;
}

@keyframes scrollCarousel {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 1rem));
    }
}

/* Estilos para la sección "Más vendidos" en index.html */
.mas-vendidos-carousel {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    animation: scrollMasVendidos 40s linear infinite;
    will-change: transform;
}

.mas-vendidos-carousel:hover {
    animation-play-state: paused;
}

@keyframes scrollMasVendidos {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 10px));
    }
}

/* ============================================================================
   SECCIÓN DE VALORACIONES Y COMENTARIOS
   ============================================================================ */

.reviews-section {
    background: linear-gradient(135deg, #fff5f8 0%, #ffffff 100%);
    padding: 60px 0;
    margin: 40px 0;
}

.reviews-header {
    text-align: center;
    margin-bottom: 40px;
}

.reviews-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.reviews-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.average-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.rating-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stars-display {
    display: flex;
    gap: 4px;
    font-size: 1.5rem;
}

.stars-display .star {
    color: #ffd700;
}

.stars-display .star.empty {
    color: #e2e8f0;
}

.total-reviews {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Formulario de valoración */
.review-form-container {
    max-width: 600px;
    margin: 0 auto 40px;
    background: white;
    padding: 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.review-form-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rating-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rating-input-container label {
    font-weight: 500;
    color: var(--text-primary);
}

.star-rating {
    display: flex;
    gap: 8px;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
}

.star-rating .star {
    color: #e2e8f0;
    transition: var(--transition);
    cursor: pointer;
}

.star-rating .star:hover,
.star-rating .star.active {
    color: #ffd700;
    transform: scale(1.1);
}

.rating-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.comment-input-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-input-container label {
    font-weight: 500;
    color: var(--text-primary);
}

.comment-input-container textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: var(--transition);
}

.comment-input-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 158, 196, 0.1);
}

.char-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

.submit-review-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    align-self: flex-start;
}

.submit-review-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-review-btn:active {
    transform: translateY(0);
}

.submit-review-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mensaje para usuarios no autenticados */
.review-login-prompt {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 40px;
}

.review-login-prompt p {
    color: var(--text-secondary);
    margin: 0;
}

.review-login-prompt a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.review-login-prompt a:hover {
    text-decoration: underline;
}

/* Lista de comentarios */
.reviews-list-container {
    max-width: 900px;
    margin: 0 auto;
}

.reviews-list-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.review-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.review-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.review-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.review-rating-display {
    display: flex;
    gap: 4px;
    font-size: 1.2rem;
}

.review-rating-display .star {
    color: #ffd700;
}

.review-rating-display .star.empty {
    color: #e2e8f0;
}

.review-comment {
    color: var(--text-primary);
    line-height: 1.6;
    margin-top: 12px;
}

.loading-reviews,
.empty-reviews {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .reviews-section {
        padding: 40px 0;
    }

    .reviews-title {
        font-size: 1.5rem;
    }

    .rating-value {
        font-size: 2.5rem;
    }

    .review-form-container {
        padding: 20px;
    }

    .review-card {
        padding: 20px;
    }

    .review-header {
        flex-direction: column;
    }
}

/* Estilos para la sección "Productos Recomendados" en index.html */
.recomendados-carousel {
    display: flex !important;
    gap: 16px !important;
    flex-wrap: nowrap !important;
    animation: scrollRecomendados 40s linear infinite;
    will-change: transform;
    position: relative;
    overflow: visible;
    align-items: flex-start;
    width: auto;
}

.recomendados-carousel .product-card-link.modern-card {
    flex-shrink: 0;
    margin: 0;
    width: 252px !important;
    min-width: 252px !important;
    max-width: 252px !important;
}

.recomendados-carousel:hover {
    animation-play-state: paused;
}

/* Asegurar que las tarjetas de productos recomendados sean clickeables */
.recommended-product-card {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.recommended-product-card button {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

@keyframes scrollRecomendados {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 10px));
    }
}

.top-product-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-width: 224px;
    max-width: 224px;
}

.top-product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.top-product-image-container {
    width: 100%;
    height: 160px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.top-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.top-product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
}

.top-product-info {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.top-product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.top-product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.top-product-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.top-product-actions .btn-view,
.top-product-actions .btn-add-cart {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.top-product-actions .btn-view {
    background: #f1f5f9;
    color: var(--text-primary);
}

.top-product-actions .btn-view:hover {
    background: #e2e8f0;
}

.top-product-actions .btn-add-cart {
    background: var(--primary-color);
    color: white;
}

.top-product-actions .btn-add-cart:hover {
    background: var(--primary-dark);
}

/* Responsive para móvil */
@media (max-width: 768px) {
    .top-products-title {
        font-size: 2rem;
    }

    .top-products-subtitle {
        font-size: 1rem;
    }

    .top-product-card {
        min-width: 180px;
        max-width: 180px;
    }

    .top-product-image-container {
        height: 140px;
    }

    /* Hacer que las tarjetas de carruseles tengan el mismo tamaño que las tarjetas normales en móvil */
    /* Sobrescribir cualquier estilo inline basándose en el viewport real */
    .mas-vendidos-carousel .product-card,
    .recomendados-carousel .product-card,
    .top-products-carousel .product-card {
        min-width: 0 !important;
        max-width: 140px !important;
        width: 140px !important;
        flex-shrink: 0 !important;
    }

    /* Sobrescribir estilos inline cuando el viewport es móvil */
    .mas-vendidos-carousel .product-card[style*="width"],
    .recomendados-carousel .product-card[style*="width"],
    .top-products-carousel .product-card[style*="width"] {
        width: 140px !important;
        min-width: 140px !important;
        max-width: 140px !important;
    }

    .mas-vendidos-carousel .product-card>div:first-child,
    .recomendados-carousel .product-card>div:first-child,
    .top-products-carousel .product-card>div:first-child {
        height: 100px !important;
    }

    .mas-vendidos-carousel .product-card img,
    .recomendados-carousel .product-card img,
    .top-products-carousel .product-card img {
        height: 100px !important;
        max-height: 100px !important;
    }

    .mas-vendidos-carousel .product-card h3,
    .recomendados-carousel .product-card h3,
    .top-products-carousel .product-card h3 {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
    }

    .mas-vendidos-carousel .product-card .product-stock,
    .recomendados-carousel .product-card .product-stock,
    .top-products-carousel .product-card .product-stock {
        font-size: 0.65rem !important;
    }

    .mas-vendidos-carousel .product-card button,
    .recomendados-carousel .product-card button,
    .top-products-carousel .product-card button {
        font-size: 0.65rem !important;
        padding: 4px 8px !important;
        min-height: 28px !important;
    }

    .mas-vendidos-carousel .product-card .product-info,
    .recomendados-carousel .product-card .product-info,
    .top-products-carousel .product-card .product-info {
        padding: 8px !important;
    }
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    font-family: inherit;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ============================================================================
   PRODUCTS SECTION
   ============================================================================ */

.products-section {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ============================================================================
   CATEGORY FILTERS
   ============================================================================ */

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.625rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9375rem;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* ============================================================================
   SEARCH BAR
   ============================================================================ */

.search-section {
    padding: 1rem 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.search-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 158, 196, 0.15);
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* ============================================================================
   PRODUCTS GRID
   ============================================================================ */

.products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
    gap: 1.28rem;
    margin-top: 2rem;
    width: 100%;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Tarjeta de producto como enlace completo */
.product-card-link {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: rgba(255, 111, 174, 0.2);
}

.product-card-link:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    text-decoration: none;
    color: inherit;
}

.product-card-link:active {
    opacity: 0.9;
}

.product-card-link:visited {
    color: inherit;
}

/* Compatibilidad: mantener .product-card para estilos existentes */
.product-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-out;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* Asegurar que los botones dentro de las tarjetas sean clicables y no propaguen el clic */
.product-card-link button,
.product-card button {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-image-container {
    width: 100%;
    height: 56px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.product-image-placeholder {
    width: 42px;
    height: 42px;
    opacity: 0.3;
}

.product-image-placeholder svg {
    width: 42px;
    height: 42px;
}

.product-info {
    padding: 0.672rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.42rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.28rem;
}

.product-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.28rem;
    line-height: 1.4;
}

.product-description {
    font-size: 0.525rem;
    color: var(--text-secondary);
    margin-bottom: 0.56rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.56rem;
    border-top: 1px solid var(--border-color);
}

.product-prices {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
}

.product-price {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-wholesale-price {
    font-size: 0.49rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.product-stock {
    font-size: 0.75rem;
    padding: 0.21rem 0.42rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.product-stock.in-stock {
    background: #dcfce7;
    color: #166534;
}

.product-stock.low-stock {
    background: #fef3c7;
    color: #92400e;
}

.product-stock.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.loading {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p {
    opacity: 0.8;
    line-height: 1.6;
}

.store-status-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Indicador de Estado del Local */
.store-status-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-hours {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 400;
    margin-left: 1.5rem;
}

.store-status-indicator.store-open {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.store-status-indicator.store-closed {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.status-badge {
    font-size: 0.75rem;
    line-height: 1;
    display: inline-block;
}

.status-text {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.store-status-indicator.store-open .status-text {
    color: rgba(255, 255, 255, 0.95);
}

.store-status-indicator.store-closed .status-text {
    color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 768px) {
    .store-status-indicator {
        font-size: 0.8125rem;
        padding: 0.4375rem 0.75rem;
    }

    .status-badge {
        font-size: 0.6875rem;
    }
}

/* Direcciones en Footer */
.footer-locations {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-location-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-location-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.footer-location-item .location-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--primary-color);
    opacity: 0.9;
}

.footer-location-item:hover .location-icon {
    color: var(--primary-color);
    opacity: 1;
}

.location-content {
    flex: 1;
}

.location-content strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: rgba(255, 255, 255, 0.95);
}

.location-content p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.85;
    color: rgba(255, 255, 255, 0.85);
}

.footer-location-item:hover .location-content strong,
.footer-location-item:hover .location-content p {
    opacity: 1;
}

@media (max-width: 768px) {
    .footer-location-item {
        padding: 0.625rem;
    }

    .location-content strong {
        font-size: 0.875rem;
    }

    .location-content p {
        font-size: 0.8125rem;
    }

    .footer-location-item .location-icon {
        width: 18px;
        height: 18px;
    }
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* Redes Sociales en Footer - Minimalista */
.footer-social {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem 0 0;
}

.footer-social-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    font-weight: 500;
}

.footer-social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-social-icon:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 158, 196, 0.3);
    border-color: var(--primary-color);
}

.footer-social-icon svg {
    width: 30px;
    height: 30px;
}

@media (max-width: 768px) {
    .footer-social-icons {
        gap: 1rem;
    }

    .footer-social-icon {
        width: 54px;
        height: 54px;
    }

    .footer-social-icon svg {
        width: 27px;
        height: 27px;
    }

    .footer-social-icon svg {
        width: 18px;
        height: 18px;
    }

    .footer-social-label {
        font-size: 0.8rem;
    }
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
    .header {
        overflow-x: hidden;
    }

    .header-content {
        flex-wrap: wrap;
        padding: 1rem;
        gap: 0.75rem;
        box-sizing: border-box;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .header-search-container {
        width: 150px;
        margin-left: 0.5rem;
    }

    .user-menu-header {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .logo-img {
        height: 60px;
        max-width: 100%;
        width: auto;
        object-fit: contain;
    }

    .logo {
        max-width: calc(50% - 0.375rem);
    }

    .user-menu-header {
        max-width: calc(50% - 0.375rem);
    }

    .hero-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 1.2rem !important;
        width: 100% !important;
        box-sizing: border-box;
        display: grid !important;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 1.2rem !important;
        width: 100% !important;
        box-sizing: border-box;
        display: grid !important;
    }

    .product-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Asegurar que las tarjetas modernas se ajusten en tablet */
    .product-card-link.modern-card,
    .product-card-link {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex-shrink: 1;
    }

    /* Asegurar que las tarjetas de carruseles también se ajusten en tablet */
    .mas-vendidos-carousel .product-card,
    .recomendados-carousel .product-card,
    .top-products-carousel .product-card {
        width: 160px !important;
        min-width: 160px !important;
        max-width: 160px !important;
    }

    /* Sobrescribir estilos inline en tablet */
    .mas-vendidos-carousel .product-card[style*="width"],
    .recomendados-carousel .product-card[style*="width"],
    .top-products-carousel .product-card[style*="width"] {
        width: 160px !important;
        min-width: 160px !important;
        max-width: 160px !important;
    }
}

@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    .container {
        padding: 0 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .header {
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        box-sizing: border-box;
        min-height: auto;
        height: auto;
    }

    .header-content {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
        min-height: auto;
        height: auto;
        overflow: visible;
    }

    .logo {
        flex-shrink: 0;
        order: 1;
        min-width: 0;
        max-width: calc(50% - 0.375rem);
        overflow: visible;
        width: auto;
    }

    .logo-img {
        height: auto;
        max-height: 50px;
        max-width: 100%;
        width: auto;
        object-fit: contain;
        display: block;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
        gap: 0.5rem;
        flex: 1 1 100%;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: 0.5rem 0;
        box-sizing: border-box;
        flex-wrap: nowrap;
        align-items: center;
        min-height: auto;
        height: auto;
    }

    .nav::-webkit-scrollbar {
        height: 4px;
    }

    .nav::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 2px;
    }

    .nav-link {
        font-size: 1rem;
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        flex-shrink: 0;
        min-width: fit-content;
    }

    .categories-dropdown-btn {
        font-size: 1rem;
    }

    /* En móvil, ocultar user-menu-header cuando está dentro del nav */
    .nav .user-menu-header {
        display: none !important;
    }

    /* En móvil, el carrito dentro del nav debe estar visible pero fuera del scroll */
    .nav .cart-icon-wrapper {
        display: flex !important;
        order: 999;
        margin-left: auto;
        flex-shrink: 0;
    }

    /* Asegurar que solo los nav-links y categorías se muestren en el scroll horizontal */
    .nav>.nav-link,
    .nav>.categories-dropdown-wrapper {
        flex-shrink: 0;
        min-width: fit-content;
    }

    .user-menu-header {
        order: 2;
        flex-shrink: 0;
        gap: 0.5rem;
        display: flex;
        align-items: center;
        max-width: calc(50% - 0.375rem);
        flex-wrap: wrap;
        justify-content: flex-end;
        box-sizing: border-box;
    }

    .user-menu-header .btn-login,
    .user-menu-header .btn-icon,
    .user-menu-header .btn-logout-icon,
    .user-menu-header .btn-admin-icon {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .user-name-header {
        font-size: 0.875rem;
        display: none;
    }

    .cart-icon-wrapper {
        order: 2;
        flex-shrink: 0;
        margin-left: 0.5rem;
        display: flex !important;
    }

    .cart-icon-btn {
        width: 48px;
        height: 48px;
    }

    .cart-icon-btn svg {
        width: 24px;
        height: 24px;
    }

    .cart-badge {
        min-width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }

    .header-search-container {
        display: none;
    }

    /* Buscador móvil alternativo */
    .mobile-search-container {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .mobile-search-container>div {
        position: relative;
        max-width: 100%;
    }

    .mobile-search-input {
        width: 100%;
        padding: 0.75rem 1rem 0.75rem 2.75rem;
        border: 2px solid var(--border-color);
        border-radius: var(--radius-lg);
        font-size: 1rem;
        transition: var(--transition);
        background: var(--bg-primary);
        color: var(--text-primary);
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }

    .mobile-search-input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(255, 158, 196, 0.15);
    }

    .mobile-search-icon {
        position: absolute;
        left: 1.25rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-light);
        pointer-events: none;
    }

    .user-menu-header {
        flex-shrink: 0;
        gap: 0.375rem;
    }

    .btn-login {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .btn-icon,
    .btn-admin-icon,
    .btn-logout-icon {
        width: 36px;
        height: 36px;
    }

    .social-dropdown-btn {
        width: 36px;
        height: 36px;
    }

    .category-menu-section {
        padding: 1rem 0;
        position: sticky;
        top: 60px;
        z-index: 999;
    }

    .category-menu-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .category-menu-subtitle {
        font-size: 0.75rem;
    }

    .category-menu-wrapper {
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .category-menu-wrapper::-webkit-scrollbar {
        height: 4px;
    }

    .category-menu-item {
        padding: 0.4rem 0.875rem;
        font-size: 0.75rem;
        min-height: 32px;
    }

    .category-dropdown-btn {
        padding: 0.4rem 0.875rem;
        font-size: 0.75rem;
        min-height: 32px;
    }

    .category-dropdown-menu {
        max-width: 250px;
        max-height: 300px;
        position: fixed !important;
        z-index: 10001 !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
    }

    .hero-products {
        min-height: 400px;
        padding: 2rem 0;
    }

    .hero-products-title {
        font-size: 1.75rem;
    }

    .hero-products-subtitle {
        font-size: 0.9375rem;
    }

    .hero-search-container {
        max-width: 100%;
        margin: 0 auto 1rem;
    }

    .hero-search-input {
        padding: 0.875rem 1rem 0.875rem 2.75rem;
        font-size: 0.9375rem;
    }

    .hero-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
        gap: 0.64rem;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
        gap: 0.64rem;
    }

    .product-card {
        border-radius: var(--radius-lg);
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 auto;
    }

    .hero-products-grid .product-card,
    .products-grid .product-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .product-image-container {
        height: 67px;
    }

    .product-info {
        padding: 0.448rem;
    }

    .product-name {
        font-size: 0.7rem;
    }

    .product-price {
        font-size: 0.875rem;
    }

    .category-filters {
        gap: 0.5rem;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: 0.5rem 0;
    }

    .category-filters::-webkit-scrollbar {
        height: 4px;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {

    html,
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    .container {
        padding: 0 0.75rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .header {
        min-height: auto;
        height: auto;
        overflow: visible;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .header-content {
        padding: 0.75rem 0.5rem;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        height: auto;
        overflow: visible;
    }

    .logo {
        max-width: calc(50% - 0.25rem);
        flex-shrink: 0;
        min-width: 0;
        overflow: visible;
        width: auto;
    }

    .logo-img {
        height: auto;
        max-height: 45px;
        max-width: 100%;
        width: auto;
        object-fit: contain;
        display: block;
    }

    .user-menu-header {
        max-width: calc(50% - 0.25rem);
        gap: 0.375rem;
        flex-shrink: 0;
        order: 2;
        flex-wrap: wrap;
    }

    .user-menu-header .btn-login,
    .user-menu-header .btn-icon,
    .user-menu-header .btn-logout-icon,
    .user-menu-header .btn-admin-icon {
        font-size: 0.8125rem;
        padding: 0.4rem 0.6rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .user-menu-header .btn-icon,
    .user-menu-header .btn-logout-icon,
    .user-menu-header .btn-admin-icon {
        width: 40px;
        height: 40px;
        padding: 0;
    }

    .user-name-header {
        display: none;
    }

    .cart-icon-wrapper {
        order: 2;
        margin-left: 0.5rem;
        flex-shrink: 0;
        display: flex !important;
    }

    .cart-icon-btn {
        width: 44px;
        height: 44px;
    }

    .cart-icon-btn svg {
        width: 22px;
        height: 22px;
    }

    .cart-badge {
        min-width: 18px;
        height: 18px;
        font-size: 0.7rem;
        top: -2px;
        right: -2px;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
        gap: 0.5rem;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: 0.5rem 0;
        flex-wrap: nowrap;
        align-items: center;
        min-height: auto;
        height: auto;
    }

    .nav::-webkit-scrollbar {
        height: 3px;
    }

    .nav::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 2px;
    }

    .nav-link {
        font-size: 0.9375rem;
        padding: 0.5rem 0.75rem;
        min-width: fit-content;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .categories-dropdown-btn {
        font-size: 0.9375rem;
    }

    /* En móvil pequeño, ocultar user-menu-header cuando está dentro del nav */
    .nav .user-menu-header {
        display: none !important;
    }

    /* En móvil pequeño, el carrito dentro del nav debe estar visible pero fuera del scroll */
    .nav .cart-icon-wrapper {
        display: flex !important;
        order: 999;
        margin-left: auto;
        flex-shrink: 0;
    }

    /* Asegurar que las tarjetas no se monten en móvil */
    .hero-products-grid,
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        gap: 0.8rem !important;
    }

    .product-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    /* Asegurar que los contenedores de productos no tengan overflow */
    .hero-products-grid,
    .products-grid {
        width: 100%;
        overflow-x: visible;
    }

    /* Hacer que las tarjetas de carruseles tengan el mismo tamaño que las tarjetas normales en móvil pequeño */
    /* Sobrescribir cualquier estilo inline basándose en el viewport real */
    .mas-vendidos-carousel .product-card,
    .recomendados-carousel .product-card,
    .top-products-carousel .product-card {
        min-width: 0 !important;
        max-width: 140px !important;
        width: 140px !important;
        flex-shrink: 0 !important;
    }

    /* Sobrescribir estilos inline cuando el viewport es móvil pequeño */
    .mas-vendidos-carousel .product-card[style*="width"],
    .recomendados-carousel .product-card[style*="width"],
    .top-products-carousel .product-card[style*="width"] {
        width: 140px !important;
        min-width: 140px !important;
        max-width: 140px !important;
    }

    .mas-vendidos-carousel .product-card>div:first-child,
    .recomendados-carousel .product-card>div:first-child,
    .top-products-carousel .product-card>div:first-child {
        height: 100px !important;
    }

    .mas-vendidos-carousel .product-card img,
    .recomendados-carousel .product-card img,
    .top-products-carousel .product-card img {
        height: 100px !important;
        max-height: 100px !important;
    }

    .mas-vendidos-carousel .product-card h3,
    .recomendados-carousel .product-card h3,
    .top-products-carousel .product-card h3 {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
    }

    .mas-vendidos-carousel .product-card .product-stock,
    .recomendados-carousel .product-card .product-stock,
    .top-products-carousel .product-card .product-stock {
        font-size: 0.65rem !important;
    }

    .mas-vendidos-carousel .product-card button,
    .recomendados-carousel .product-card button,
    .top-products-carousel .product-card button {
        font-size: 0.65rem !important;
        padding: 4px 8px !important;
        min-height: 28px !important;
    }

    .mas-vendidos-carousel .product-card .product-info,
    .recomendados-carousel .product-card .product-info,
    .top-products-carousel .product-card .product-info {
        padding: 8px !important;
    }

    .nav {
        gap: 0.375rem;
    }

    .nav-link {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }

    .user-menu-header {
        gap: 0.25rem;
    }

    .btn-login {
        padding: 0.4375rem 0.875rem;
        font-size: 0.75rem;
    }

    .btn-icon,
    .btn-admin-icon,
    .btn-logout-icon,
    .social-dropdown-btn {
        width: 32px;
        height: 32px;
    }

    .category-menu-section {
        padding: 0.75rem 0;
        top: 56px;
    }

    .category-menu-title {
        font-size: 1.125rem;
        margin-bottom: 0.375rem;
    }

    .category-menu-subtitle {
        font-size: 0.6875rem;
    }

    .category-menu-item {
        padding: 0.375rem 0.625rem;
        font-size: 0.6875rem;
        min-height: 28px;
    }

    .category-dropdown-btn {
        padding: 0.375rem 0.625rem;
        font-size: 0.6875rem;
        min-height: 28px;
    }

    .category-dropdown-menu {
        max-width: 180px;
        max-height: 250px;
        position: fixed !important;
        z-index: 10001 !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
    }

    .hero-products {
        min-height: 350px;
        padding: 1.5rem 0;
    }

    .hero-products-header {
        margin-bottom: 2rem;
    }

    .hero-products-title {
        font-size: 1.5rem;
        margin-bottom: 0.375rem;
    }

    .hero-products-subtitle {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }

    .product-sort-container {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .product-sort-label {
        font-size: 0.875rem;
    }

    .product-sort-select {
        min-width: 100%;
        max-width: 280px;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        padding-right: 2.25rem;
    }

    .hero-search-input {
        padding: 0.75rem 0.875rem 0.75rem 2.5rem;
        font-size: 0.875rem;
    }

    .hero-search-icon {
        left: 0.875rem;
        width: 16px;
        height: 16px;
    }

    .hero-products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .section-header {
        margin-bottom: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9375rem;
    }

    .products-section {
        padding: 2rem 0;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-card {
        border-radius: var(--radius-md);
    }

    .product-image-container {
        height: 80px;
    }

    .product-info {
        padding: 0.448rem;
    }

    .product-name {
        font-size: 0.788rem;
    }

    .product-description {
        font-size: 0.613rem;
    }

    .product-price {
        font-size: 0.963rem;
    }

    .category-filters {
        gap: 0.375rem;
        padding: 0.375rem 0;
    }

    .filter-btn {
        padding: 0.4375rem 0.875rem;
        font-size: 0.75rem;
    }

    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-content {
        gap: 1.5rem;
    }

    .footer-section h3,
    .footer-section h4 {
        font-size: 1.125rem;
    }

    .footer-section p {
        font-size: 0.875rem;
    }

    .search-section {
        padding: 0.75rem 0;
    }

    .search-container {
        max-width: 100%;
    }

    .search-input {
        padding: 0.625rem 0.75rem 0.625rem 2.25rem;
        font-size: 0.875rem;
    }

    .search-icon {
        left: 0.75rem;
        width: 16px;
        height: 16px;
    }
}

/* ============================================================================
   CARRUSEL DE MARCAS
   ============================================================================ */

/* Sección contenedora del carrusel */
.brands-carousel-section {
    background: var(--bg-secondary);
    padding: 60px 0;
    overflow: hidden;
    position: relative;
}

/* Contenedor wrapper con overflow oculto */
.brands-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Track del carrusel que se desplaza */
.brands-carousel-track {
    display: flex;
    align-items: center;
    gap: 60px;
    width: fit-content;
    animation: scroll-brands 30s linear infinite;
    will-change: transform;
}

/* Variable CSS para velocidad del carrusel (fácil de modificar) */
:root {
    --carousel-speed: 30s;
    /* Cambiar este valor para ajustar velocidad */
}

/* Animación del desplazamiento infinito */
@keyframes scroll-brands {
    0% {
        transform: translateX(0);
    }

    100% {
        /* Se desplaza exactamente la mitad del ancho (donde empieza la segunda copia) */
        transform: translateX(-50%);
    }
}

/* Item individual de cada logo */
.brand-logo-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 120px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

/* Imagen del logo */
.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
    /* Mantener logos a color */
    transition: transform 0.3s ease;
    /* Optimización de renderizado */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    will-change: transform;
    /* Mejorar carga progresiva */
    background-color: #ffffff;
}

/* Efecto hover: zoom suave sin cambiar colores */
.brand-logo-item:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.brand-logo-item:hover .brand-logo-img {
    transform: scale(1.05);
}

/* Pausar animación al hacer hover (opcional) */
.brands-carousel-wrapper:hover .brands-carousel-track {
    animation-play-state: paused;
}

/* Responsive: tablets */
@media (max-width: 768px) {
    .brands-carousel-section {
        padding: 40px 0;
    }

    .brands-carousel-track {
        gap: 40px;
    }

    .brand-logo-item {
        width: 140px;
        height: 100px;
        padding: 15px;
    }

    /* Ajustar velocidad en móviles si es necesario */
    .brands-carousel-track {
        animation-duration: 25s;
    }
}

/* Responsive: móviles */
@media (max-width: 480px) {
    .brands-carousel-section {
        padding: 30px 0;
    }

    .brands-carousel-track {
        gap: 30px;
    }

    .brand-logo-item {
        width: 120px;
        height: 80px;
        padding: 12px;
    }

    /* Velocidad más rápida en móviles pequeños */
    .brands-carousel-track {
        animation-duration: 20s;
    }
}

/* ============================================================================
   PRODUCT CARD VIEW BUTTON (Botón "Ver" en tarjetas de productos)
   Mismo estilo que los botones del carrusel del modal
   ============================================================================ */
/* Estilos para botones "Ver" en todas las tarjetas de productos */
.product-card button.product-card-view-btn,
.product-card .product-card-view-btn,
button.product-card-view-btn {
    width: 100% !important;
    min-width: 42px !important;
    min-height: 42px !important;
    height: 42px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 14px !important;
    color: #ff6fae !important;
    font-weight: bold !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    position: static !important;
    z-index: auto !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.product-card-view-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25) !important;
    background: rgba(255, 255, 255, 1) !important;
}

/* Ajuste para que el botón se adapte al contenedor flex pero mantenga forma circular */
.product-card .product-footer,
.product-card>div:last-child {
    display: flex;
    gap: 6.4px;
    margin-top: auto;
}

.product-card .product-footer button.product-card-view-btn,
.product-card>div:last-child button.product-card-view-btn {
    flex: 1;
    max-width: 50%;
}

/* ============================================================================
   BUSCADOR DE PRODUCTOS
   ============================================================================ */

.product-search-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

.product-search-container {
    width: 100%;
    margin: 0 auto;
}

.product-search-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.product-search-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 158, 196, 0.1);
}

.product-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: transparent;
}

.product-search-input::placeholder {
    color: var(--text-light);
}

.product-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.product-search-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.product-search-btn:active {
    transform: scale(0.95);
}

/* Contenedor de Resultados de Búsqueda (debajo del buscador) */
.product-search-results-container {
    width: 100%;
    margin-top: 2rem;
    padding: 2rem 1.5rem 0;
    border-top: 2px solid var(--border-color);
    box-sizing: border-box;
}

.product-search-results-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.product-search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Asegurar que las tarjetas en el grid de búsqueda se ajusten correctamente */
.product-search-results-grid .product-card-link,
.product-search-results-grid .product-card-link.modern-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex-shrink: 1;
}

.product-search-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.product-search-empty svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.product-search-empty h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-search-empty p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Correcciones adicionales para header en móvil modo escritorio */
/* Estilos específicos para desktop (solo PC, no tablet) */
@media (min-width: 1025px) {
    .header {
        min-height: auto;
        max-height: none;
        overflow: visible;
        height: auto;
    }

    .header-content {
        min-height: auto;
        max-height: none;
        overflow: visible;
        height: auto;
        align-items: center;
        padding: 1.5rem 0;
        flex-wrap: nowrap;
        gap: 2rem;
    }

    .container {
        overflow: visible;
    }

    .logo {
        overflow: visible;
        max-width: none;
        max-height: none;
        min-height: auto;
        height: auto;
        margin-right: 3rem;
        flex-shrink: 0;
    }

    .logo-img {
        height: auto;
        max-height: 90px;
        max-width: 100%;
        object-fit: contain;
        overflow: visible;
    }

    .nav {
        overflow: visible;
        max-height: none;
        min-height: auto;
        height: auto;
        margin-left: 0;
        flex: 1 1 auto;
        gap: 2rem;
        flex-wrap: nowrap;
    }

    .nav-link {
        font-size: 1.375rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .categories-dropdown-btn {
        font-size: 1.375rem;
    }

    .user-menu-header {
        margin-left: 1rem;
        overflow: visible;
        max-height: none;
        min-height: auto;
        height: auto;
        flex-shrink: 0;
        gap: 1rem;
    }

    .user-name-header {
        font-size: 1.25rem;
        overflow: visible;
    }

    .btn-login {
        font-size: 1.25rem;
        padding: 0.625rem 1.25rem;
        overflow: visible;
    }

    .cart-icon-wrapper {
        margin-left: 1rem;
        overflow: visible;
        max-height: none;
        min-height: auto;
        height: auto;
        flex-shrink: 0;
    }

    .cart-icon-btn {
        width: 56px;
        height: 56px;
    }

    .cart-icon-btn svg {
        width: 28px;
        height: 28px;
    }

    .cart-badge {
        font-size: 0.875rem;
        min-width: 22px;
        height: 22px;
        line-height: 22px;
    }

    /* Asegurar que los elementos dentro del nav se alineen correctamente */
    .nav .user-menu-header {
        margin-left: 1rem;
        overflow: visible;
    }

    .nav .cart-icon-wrapper {
        margin-left: 1rem;
        overflow: visible;
    }
}

@media (min-width: 481px) and (max-width: 1024px) {
    .header {
        overflow: visible;
        min-height: auto;
        height: auto;
    }

    .header-content {
        padding: 1rem 1.5rem;
        gap: 1rem;
        flex-wrap: wrap;
        align-items: center;
        overflow: visible;
        min-height: auto;
        height: auto;
    }

    .logo {
        overflow: visible;
        flex-shrink: 0;
        min-width: 0;
    }

    .logo-img {
        height: auto;
        max-height: 70px;
        max-width: 100%;
        width: auto;
        object-fit: contain;
    }

    .nav {
        gap: 1.25rem;
        flex-wrap: wrap;
        overflow: visible;
        flex: 1 1 auto;
        min-width: 0;
    }

    .nav-link {
        font-size: 1.375rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .categories-dropdown-btn {
        font-size: 1.375rem;
    }

    .user-menu-header {
        gap: 0.75rem;
        flex-shrink: 0;
        min-width: 0;
        overflow: visible;
    }

    .user-name-header {
        font-size: 1.25rem;
    }

    .btn-login {
        font-size: 1.25rem;
        padding: 0.625rem 1.25rem;
    }

    .user-menu-header .btn-icon,
    .user-menu-header .btn-logout-icon,
    .user-menu-header .btn-admin-icon {
        width: 44px;
        height: 44px;
    }

    .user-menu-header .btn-icon svg,
    .user-menu-header .btn-logout-icon svg,
    .user-menu-header .btn-admin-icon svg {
        width: 22px;
        height: 22px;
    }

    .cart-icon-wrapper {
        flex-shrink: 0;
        overflow: visible;
        display: flex !important;
    }

    .cart-icon-btn {
        width: 52px;
        height: 52px;
    }

    .cart-icon-btn svg {
        width: 26px;
        height: 26px;
    }

    .cart-badge {
        min-width: 20px;
        height: 20px;
        font-size: 0.875rem;
    }

    /* Asegurar que el carrito sea visible en tablet */
    .nav .cart-icon-wrapper {
        display: flex !important;
        overflow: visible;
    }
}


/* Responsive para buscador */
@media (max-width: 768px) {
    #product-search-section {
        padding: 30px 20px 40px !important;
    }

    #product-search-section h2,
    .product-search-title {
        font-size: 20px !important;
        margin-bottom: 15px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .product-search-wrapper {
        padding: 0.4rem;
    }

    .product-search-input {
        font-size: 0.9375rem;
        padding: 0.75rem 0.875rem;
    }

    .product-search-btn {
        width: 44px;
        height: 44px;
    }

    .product-search-results-container {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .product-search-results-title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .product-search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }

    .product-search-results-grid .product-card-link,
    .product-search-results-grid .product-card-link.modern-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex-shrink: 1;
    }
}

@media (max-width: 480px) {
    .product-search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .product-search-results-grid .product-card-link,
    .product-search-results-grid .product-card-link.modern-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex-shrink: 1;
    }

    .product-search-results-container {
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .product-search-results-title {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
}

/* ============================================================================
   ESTILOS MODERNOS PARA TARJETAS DE PRODUCTOS (RECOMMENDED & TOP-WEEK)
   ============================================================================ */

/* TARJETA - Tamaño fijo, diseño e-commerce profesional - APLICADO A TODAS LAS TARJETAS */
.product-card-link.modern-card,
.product-card-link {
    width: 252px;
    min-width: 252px;
    max-width: 252px;
    height: 556px;
    flex-shrink: 0;

    display: flex;
    flex-direction: column;

    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Asegurar que las tarjetas no se superpongan cuando el contenedor es pequeño (modo escritorio en móvil) */
@media (min-width: 769px) and (max-width: 1024px) {

    .hero-products-grid,
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 1rem !important;
        width: 100% !important;
        box-sizing: border-box;
        display: grid !important;
    }

    .product-card-link.modern-card,
    .product-card-link {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex-shrink: 1;
    }
}

/* Asegurar que en pantallas medianas las tarjetas no se superpongan */
@media (min-width: 1025px) and (max-width: 1200px) {

    .hero-products-grid,
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)) !important;
        gap: 1.2rem !important;
    }

    .product-card-link.modern-card,
    .product-card-link {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
}

.product-card-link.modern-card:hover,
.product-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* CONTENEDOR DE IMAGEN - Altura fija - APLICADO A TODAS LAS TARJETAS - Aumentada para ocupar más espacio */
.product-card-link.modern-card .product-card-image-container,
.product-card-link .product-card-image-container {
    width: 100%;
    height: 360px;
    position: relative;
    overflow: hidden;
    background: #f6f6f6;
    flex-shrink: 0;
    flex-grow: 0;
}

.product-card-link.modern-card .product-card-image-container .product-card-main-image,
.product-card-link.modern-card .product-card-image-container img,
.product-card-link .product-card-image-container .product-card-main-image,
.product-card-link .product-card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* OVERLAY HOVER - Position absolute dentro del contenedor de imagen - APLICADO A TODAS LAS TARJETAS */
.product-card-link.modern-card .product-card-overlay,
.product-card-link .product-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.product-card-link.modern-card:hover .product-card-overlay,
.product-card-link:hover .product-card-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* BOTONES DEL OVERLAY - APLICADO A TODAS LAS TARJETAS */
.product-card-link.modern-card .product-card-overlay button,
.product-card-link.modern-card .product-card-overlay .overlay-btn,
.product-card-link .product-card-overlay button,
.product-card-link .product-card-overlay .overlay-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.product-card-link.modern-card .product-card-overlay .btn-view,
.product-card-link.modern-card .product-card-overlay .overlay-btn:first-child,
.product-card-link .product-card-overlay .btn-view,
.product-card-link .product-card-overlay .overlay-btn:first-child {
    background: #ffffff;
    border: 1px solid #ccc;
    color: #333;
}

.product-card-link.modern-card .product-card-overlay .btn-add,
.product-card-link.modern-card .product-card-overlay .overlay-btn:last-child,
.product-card-link .product-card-overlay .btn-add,
.product-card-link .product-card-overlay .overlay-btn:last-child {
    background: #ff7aa2;
    color: white;
    border: none;
}

.product-card-link.modern-card .product-card-overlay button:hover,
.product-card-link.modern-card .product-card-overlay .overlay-btn:hover,
.product-card-link .product-card-overlay button:hover,
.product-card-link .product-card-overlay .overlay-btn:hover {
    transform: scale(1.05);
}

/* INFO PRODUCTO - Flujo normal, sin position - Solo nombre y precio - APLICADO A TODAS LAS TARJETAS */
.product-card-link.modern-card .product-card-info,
.product-card-link .product-card-info {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

/* Ocultar categoría, stock y variantes en TODAS las tarjetas - PERO NO EL PRECIO */
.product-card-link.modern-card .product-card-info>div:first-child,
.product-card-link.modern-card .product-card-info .product-variants,
.product-card-link.modern-card .product-card-info .product-stock,
.product-card-link .product-card-info>div:first-child,
.product-card-link .product-card-info .product-variants,
.product-card-link .product-card-info .product-stock {
    display: none !important;
}

/* Asegurar que el precio sea visible */
.product-card-link.modern-card .product-card-info>div:nth-child(2),
.product-card-link .product-card-info>div:nth-child(2) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ocultar botones originales en todas las tarjetas (solo overlay) */
.product-card-link.modern-card>div:last-child>div:last-child,
.product-card-link>div:last-child>div:last-child {
    display: none !important;
}

/* Ocultar botones móviles en desktop - solo overlay funciona */
.product-card-link.modern-card .product-card-mobile-buttons,
.product-card-link .product-card-mobile-buttons {
    display: none;
}

/* Estilos para botones móviles */
.product-card-link.modern-card .product-card-mobile-buttons button,
.product-card-link .product-card-mobile-buttons button {
    font-family: inherit;
    white-space: nowrap;
}

.product-card-link.modern-card .product-card-mobile-buttons .mobile-btn-view:hover,
.product-card-link .product-card-mobile-buttons .mobile-btn-view:hover {
    background: #f5f5f5;
    border-color: #999;
}

.product-card-link.modern-card .product-card-mobile-buttons .mobile-btn-add:hover:not(:disabled),
.product-card-link .product-card-mobile-buttons .mobile-btn-add:hover:not(:disabled) {
    background: #ff6a95;
    transform: scale(1.02);
}

/* Asegurar que solo se muestre nombre y precio */
.product-card-link.modern-card .product-card-info h3,
.product-card-link .product-card-info h3 {
    margin: 0 0 8px 0 !important;
    text-align: center !important;
}

/* Asegurar que el precio tenga el estilo correcto */
.product-card-link.modern-card .product-card-info .product-card-price,
.product-card-link .product-card-info .product-card-price,
.product-card-link.modern-card .product-card-info>div.product-card-price,
.product-card-link .product-card-info>div.product-card-price {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #ff9ec4 !important;
    margin: 0 0 8px 0 !important;
    text-align: center !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ocultar botones originales en tarjetas modernas */
.product-card-link.modern-card>div:last-child>div:last-child {
    display: none !important;
}

/* Responsive para móviles - Mayor especificidad para sobrescribir otros media queries */
@media (max-width: 768px) {

    /* Asegurar que los grids tengan gap suficiente y siempre se muestren */
    .hero-products-grid,
    .products-grid {
        gap: 1rem !important;
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        width: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Los carruseles mantienen su display flex pero con gap */
    .mas-vendidos-carousel,
    .recomendados-carousel,
    .top-products-carousel {
        gap: 1rem !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .product-card-link.modern-card,
    .product-card-link {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto;
        min-height: 420px;
        margin: 0 !important;
        flex-shrink: 0;
    }

    .product-card-link.modern-card .product-card-image-container,
    .product-card-link .product-card-image-container {
        height: 224px;
    }

    /* Ocultar overlay en móvil - no funciona con touch */
    .product-card-link.modern-card .product-card-overlay,
    .product-card-link .product-card-overlay {
        display: none !important;
    }

    /* Mostrar botones móviles */
    .product-card-link.modern-card .product-card-mobile-buttons,
    .product-card-link .product-card-mobile-buttons {
        display: flex !important;
    }

    /* Ajustar info para móvil */
    .product-card-link.modern-card .product-card-info,
    .product-card-link .product-card-info {
        padding: 8px;
    }

    .product-card-link.modern-card .product-card-info h3,
    .product-card-link .product-card-info h3 {
        font-size: 12px;
        min-height: 32px;
        margin-bottom: 6px;
    }

    .product-card-link.modern-card .product-card-info>div:last-of-type,
    .product-card-link .product-card-info>div:last-of-type {
        font-size: 14px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {

    /* Asegurar que los grids tengan gap suficiente en móvil pequeño */
    .hero-products-grid,
    .products-grid {
        gap: 0.75rem !important;
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        width: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Los carruseles mantienen su display flex pero con gap */
    .mas-vendidos-carousel,
    .recomendados-carousel,
    .top-products-carousel {
        gap: 0.75rem !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .product-card-link.modern-card,
    .product-card-link {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 392px;
        margin: 0 !important;
        flex-shrink: 0;
    }

    .product-card-link.modern-card .product-card-image-container,
    .product-card-link .product-card-image-container {
        height: 196px;
    }

    .product-card-link.modern-card .product-card-mobile-buttons button,
    .product-card-link .product-card-mobile-buttons button {
        padding: 5px 8px;
        font-size: 10px;
    }

    .product-card-link.modern-card .product-card-info h3,
    .product-card-link .product-card-info h3 {
        font-size: 11px;
        min-height: 28px;
    }

    .product-card-link.modern-card .product-card-info>div:last-of-type,
    .product-card-link .product-card-info>div:last-of-type {
        font-size: 13px;
    }
}

/* ============================================================================
   MODAL DE PRODUCTO MODERNO - Estilo como segunda imagen
   ============================================================================ */

.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-modal .modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.product-modal #modalProductContent {
    width: 100%;
    height: 100%;
}

.product-modal .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #333;
}

.product-modal .modal-close:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.modal-product-container {
    display: flex !important;
    flex-direction: row !important;
    height: 100%;
    max-height: 90vh;
    overflow: hidden !important;
    width: 100% !important;
    flex: 1;
    box-sizing: border-box;
    position: relative;
    gap: 0 !important;
}

.product-modal #modalProductContent {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden !important;
    position: relative;
    gap: 0 !important;
}

.modal-product-image-section {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
    min-width: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    padding: 40px;
    position: relative;
    overflow: hidden !important;
    border-radius: 12px 0 0 12px;
    box-sizing: border-box;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

.modal-product-image-wrapper {
    width: 90%;
    height: 100%;
    max-width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 auto;
}

.modal-product-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

.modal-product-image img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 8px;
    box-sizing: border-box;
}

.modal-product-info-section {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
    min-width: 50% !important;
    padding: 30px 20px;
    overflow-y: auto;
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 90vh;
    background: #e8e3f5;
    border-radius: 0 12px 12px 0;
    box-sizing: border-box;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    position: relative;
    z-index: 1;
}

.modal-product-category {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.modal-product-name {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.modal-product-price {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.modal-product-price .price-original {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
}

.modal-product-price .price-current {
    font-size: 28px;
    font-weight: 700;
    color: #ff7aa2;
}

.modal-product-price .price-label {
    font-size: 14px;
    color: #666;
}

.modal-product-stock {
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 20px;
}

.modal-product-stock.in-stock {
    background: #e3f2fd;
    color: #1976d2;
}

.modal-product-stock.out-of-stock {
    background: #ffebee;
    color: #d32f2f;
}

.modal-product-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.modal-product-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-detail-item {
    display: flex;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.modal-detail-item .detail-label {
    font-weight: 600;
    color: #333;
    min-width: 100px;
}

.modal-detail-item .detail-value {
    color: #666;
}

.modal-product-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: #ffffff;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.quantity-input {
    width: 80px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.btn-add-to-cart {
    width: 100%;
    padding: 16px 24px;
    background: #ff9ec4;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-to-cart:hover:not(:disabled) {
    background: #ff7ba8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 158, 196, 0.4);
}

.btn-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.modal-product-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.category-tag {
    display: inline-block;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
}

/* Responsive para modal */
@media (max-width: 768px) {
    .product-modal .modal-content {
        flex-direction: column;
        max-height: 95vh;
    }

    .modal-product-container {
        flex-direction: column;
        max-height: 95vh;
    }

    .modal-product-image-section {
        flex: 0 0 50%;
        min-width: 100%;
        padding: 20px;
    }

    .modal-product-info-section {
        flex: 1;
        min-width: 100%;
        padding: 20px;
        max-height: 50vh;
    }

    .modal-product-name {
        font-size: 22px;
    }

    .modal-product-price .price-current {
        font-size: 24px;
    }
}

/* ============================================================================
   BANNER DE PUBLICIDAD (ADSTERRA)
   ============================================================================ */
.ad-banner-section {
    padding: 25px 0 35px 0;
    background: linear-gradient(135deg, #ffffff 0%, #fff5f8 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.ad-banner-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.ad-banner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 320px;
    min-height: 50px;
    margin: 0 auto;
    padding: 8px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(255, 111, 174, 0.1);
    border: 1px solid rgba(255, 182, 207, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: content-box;
}

.ad-banner-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 111, 174, 0.18);
}

.ad-banner-container iframe {
    border: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: block !important;
    max-width: 100% !important;
}

.ad-banner-label {
    font-size: 0.7rem;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}
