/* ============================================================================
   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;
}

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;
}

/* ============================================================================
   UTILIDADES
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================================
   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);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 70px;
    width: auto;
    object-fit: contain;
    max-width: 300px;
}

.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: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.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%;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
}

.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;
}

.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: 220px;
    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);
}

.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%;
}

.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;
}

.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: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    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;
    z-index: 1000;
    padding: 0.5rem;
    gap: 0.25rem;
    flex-direction: column;
}

.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;
}

/* 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;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.6rem;
    margin-top: 2rem;
}

@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);
}

.top-products-carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.top-products-carousel {
    display: flex;
    gap: 2rem;
    animation: scrollCarousel 30s linear infinite;
    will-change: transform;
}

.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 {
    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 {
    animation: scrollRecomendados 40s linear infinite;
    will-change: transform;
    position: relative;
}

.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: 280px;
    max-width: 280px;
}

.top-product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.top-product-image-container {
    width: 100%;
    height: 200px;
    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.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.top-product-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.top-product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.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: 250px;
        max-width: 250px;
    }
    
    .top-product-image-container {
        height: 180px;
    }
}

/* ============================================================================
   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;
    grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
    gap: 1.6rem;
    margin-top: 2rem;
}

.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;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-image-container {
    width: 100%;
    height: 70px;
    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.84rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.525rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.product-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.product-description {
    font-size: 0.656rem;
    color: var(--text-secondary);
    margin-bottom: 0.7rem;
    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.7rem;
    border-top: 1px solid var(--border-color);
}

.product-prices {
    display: flex;
    flex-direction: column;
    gap: 0.175rem;
}

.product-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-wholesale-price {
    font-size: 0.613rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.product-stock {
    font-size: 0.613rem;
    padding: 0.263rem 0.525rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.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;
}

/* Indicador de Estado del Local */
.store-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    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);
}

.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: 40px;
    height: 40px;
    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: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .footer-social-icons {
        gap: 1rem;
    }
    
    .footer-social-icon {
        width: 36px;
        height: 36px;
    }
    
    .footer-social-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .footer-social-label {
        font-size: 0.8rem;
    }
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
    .header-content {
        flex-wrap: wrap;
    }

    .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;
    }

    .logo-img {
        height: 50px;
    }

    .hero-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.2rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .header-content {
        flex-wrap: nowrap;
        padding: 0.75rem 0;
        gap: 0.5rem;
    }

    .logo {
        flex-shrink: 0;
    }

    .logo-img {
        height: 45px;
    }

    .nav {
        order: 0;
        width: auto;
        margin-top: 0;
        gap: 0.5rem;
        flex: 1;
        justify-content: flex-end;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        font-size: 0.8125rem;
        white-space: nowrap;
        padding: 0.375rem 0.625rem;
    }

    .header-search-container {
        display: 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;
    }

    .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(128px, 1fr));
        gap: 0.8rem;
    }

    .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(128px, 1fr));
        gap: 0.8rem;
    }

    .product-card {
        border-radius: var(--radius-lg);
    }

    .product-image-container {
        height: 84px;
    }

    .product-info {
        padding: 0.56rem;
    }

    .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) {
    .container {
        padding: 0 0.75rem;
    }

    .header-content {
        padding: 0.625rem 0;
    }

    .logo-img {
        height: 40px;
    }

    .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;
    }

    .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;
    }

    .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: 100px;
    }

    .product-info {
        padding: 0.56rem;
    }

    .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;
    }
}

