/* Estilos específicos para la página de productos */

.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active::after {
    width: 100%;
}

/* Breadcrumb */
.breadcrumb {
    background: var(--background-light);
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 105, 180, 0.1);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.breadcrumb-nav a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-nav a:hover {
    color: var(--primary-color);
}

.breadcrumb-nav .separator {
    color: var(--text-light);
}

.breadcrumb-nav .current {
    color: var(--primary-color);
    font-weight: 500;
}

/* Products Section */
.products-section {
    padding: 60px 0 100px;
    background: white;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.products-title h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.products-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.products-filters {
    display: flex;
    gap: 2rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

.filter-group select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    color: var(--text-dark);
    font-size: 0.9rem;
    transition: var(--transition);
    min-width: 180px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Products Content */
.products-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
}

/* Sidebar */
.products-sidebar {
    background: var(--background-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: block;
    padding: 8px 12px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
}

.category-list a:hover,
.category-list a.active {
    background: var(--primary-color);
    color: white;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

.price-range {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.price-range input[type="range"] {
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.price-range input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.price-range input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}

.product-badge.new {
    background: var(--success-color);
    color: white;
}

.product-badge.sale {
    background: var(--danger-color);
    color: white;
}

.product-badge.featured {
    background: var(--warning-color);
    color: white;
}

/* Product Actions */
.product-actions {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.product-card:hover .product-actions {
    opacity: 1;
}

.product-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-action:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.product-action.active {
    background: var(--danger-color);
    color: white;
}

/* Product Image */
.product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--background-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.placeholder-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    background: linear-gradient(135deg, var(--background-light), white);
}

.placeholder-image i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
    color: var(--primary-color);
}

.placeholder-image span {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Product Info */
.product-info {
    padding: 1.5rem;
}

.product-category {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-description {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.price-current {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-original {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.add-to-cart {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.add-to-cart:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 4rem;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.page-link:hover,
.page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.page-link.prev,
.page-link.next {
    border-radius: var(--border-radius);
    width: 55px;
}

/* No Products */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    font-size: 1.2rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
}

.no-products p {
    margin-bottom: 2rem;
}

/* Fade In Animation */
.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .products-content {
        grid-template-columns: 1fr;
    }
    
    .products-sidebar {
        position: static;
        order: 2;
        margin-top: 2rem;
    }
    
    .products-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-group select {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .products-section {
        padding: 40px 0 60px;
    }
    
    .products-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 1.5rem;
    }
    
    .products-title h1 {
        font-size: 2rem;
    }
    
    .products-sidebar {
        padding: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.25rem;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: 1.25rem;
    }
    
    .pagination {
       gap: 0.5rem;
       margin-top: 3rem;
   }
   
   .page-link {
       width: 40px;
       height: 40px;
       font-size: 0.9rem;
   }
   
   .page-link.prev,
   .page-link.next {
       width: 50px;
   }
}

@media (max-width: 480px) {
   .products-section {
       padding: 30px 0 40px;
   }
   
   .products-title h1 {
       font-size: 1.75rem;
   }
   
   .products-sidebar {
       padding: 1rem;
   }
   
   .sidebar-section h3 {
       font-size: 1.1rem;
   }
   
   .products-grid {
       grid-template-columns: 1fr;
       gap: 1rem;
   }
   
   .product-card {
       max-width: 350px;
       margin: 0 auto;
   }
   
   .product-image {
       height: 180px;
   }
   
   .product-info {
       padding: 1rem;
   }
   
   .product-title {
       font-size: 1rem;
   }
   
   .product-description {
       font-size: 0.85rem;
   }
   
   .price-current {
       font-size: 1.2rem;
   }
   
   .add-to-cart {
       padding: 0.75rem;
       font-size: 0.9rem;
   }
   
   .product-actions {
       top: 10px;
       left: 10px;
   }
   
   .product-action {
       width: 35px;
       height: 35px;
       font-size: 0.9rem;
   }
   
   .product-badge {
       top: 10px;
       right: 10px;
       padding: 4px 8px;
       font-size: 0.7rem;
   }
   
   .filter-group {
       margin-bottom: 1rem;
   }
   
   .filter-group select {
       padding: 8px 12px;
       font-size: 0.9rem;
   }
}

/* Mejoras adicionales para la experiencia de usuario */
.product-card {
   will-change: transform;
}

.product-card::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: linear-gradient(135deg, transparent 0%, rgba(255, 105, 180, 0.05) 100%);
   opacity: 0;
   transition: var(--transition);
   pointer-events: none;
}

.product-card:hover::before {
   opacity: 1;
}

/* Estilos para el estado de carga */
.products-grid.loading {
   opacity: 0.7;
   pointer-events: none;
}

.products-grid.loading .product-card {
   animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
   0%, 100% {
       opacity: 1;
   }
   50% {
       opacity: 0.5;
   }
}

/* Estilos para filtros activos */
.filter-active {
   background: var(--primary-color) !important;
   color: white !important;
}

/* Estilos mejorados para el rango de precios */
.price-range {
   position: relative;
   padding: 1rem 0;
}

.price-range input[type="range"] {
   position: relative;
   z-index: 1;
}

.price-range input[type="range"]:focus {
   outline: none;
}

.price-range input[type="range"]:focus::-webkit-slider-thumb {
   box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.3);
}

/* Tooltip para productos */
.product-card[title] {
   position: relative;
}

.product-card:hover::after {
   content: attr(title);
   position: absolute;
   bottom: -30px;
   left: 50%;
   transform: translateX(-50%);
   background: rgba(0, 0, 0, 0.8);
   color: white;
   padding: 5px 10px;
   border-radius: 4px;
   font-size: 0.8rem;
   white-space: nowrap;
   z-index: 1000;
   opacity: 0;
   animation: tooltipFadeIn 0.3s ease forwards;
}

@keyframes tooltipFadeIn {
   to {
       opacity: 1;
   }
}

/* Estilos para indicadores de stock */
.stock-indicator {
   position: absolute;
   bottom: 10px;
   left: 10px;
   padding: 2px 8px;
   border-radius: 12px;
   font-size: 0.7rem;
   font-weight: 600;
   text-transform: uppercase;
}

.stock-indicator.in-stock {
   background: rgba(40, 167, 69, 0.1);
   color: var(--success-color);
}

.stock-indicator.low-stock {
   background: rgba(255, 193, 7, 0.1);
   color: var(--warning-color);
}

.stock-indicator.out-of-stock {
   background: rgba(220, 53, 69, 0.1);
   color: var(--danger-color);
}

/* Mejoras para accesibilidad */
.product-action:focus,
.add-to-cart:focus,
.page-link:focus {
   outline: 2px solid var(--primary-color);
   outline-offset: 2px;
}

/* Estilos para modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
   .products-sidebar {
       background: rgba(0, 0, 0, 0.05);
   }
   
   .product-card {
       box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1);
   }
   
   .placeholder-image {
       background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1));
   }
}