﻿/* Catalog Page Styles - Premium Design */
.catalog-main {
    padding-top: 100px;
    min-height: 100vh;
    /* Igual que index: usar las variables globales (dark-luxury-theme / styles) */
    background: var(--bg-primary, var(--dark-bg));
    position: relative;
    overflow-x: hidden;
}

/* Premium Background Effects (alineado al fondo del index: oro + azul) */
.catalog-main::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 45%, rgba(255, 215, 0, 0.08) 0%, transparent 55%),
        radial-gradient(circle at 75% 80%, rgba(0, 71, 171, 0.10) 0%, transparent 55%),
        radial-gradient(circle at 80% 15%, rgba(255, 184, 0, 0.06) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.catalog-main::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 215, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 215, 0, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.catalog-container {
    position: relative;
    z-index: 1;
}


.catalog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2.5rem;
}

/* FIX: Tamaño EXACTO del logo (igual que index.html: 60x60px) */
.nav-logo .logo-img {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    object-fit: contain;
}


/* Premium Sidebar */
.catalog-sidebar {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.clear-filters {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.clear-filters:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-1px);
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: linear-gradient(180deg, #ffd700 0%, #ffb800 100%);
    border-radius: 2px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Premium Checkbox Styling */
.filter-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 184, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-option:hover {
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateX(4px);
}

.filter-option:hover::before {
    opacity: 1;
}

.filter-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.filter-option input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    border-color: transparent;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.filter-option input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.filter-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.filter-option:hover .filter-label {
    color: #fff;
}

.filter-option input[type="checkbox"]:checked+.filter-label {
    color: #fff;
    font-weight: 600;
}

/* Premium Price Range */
.price-range {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.price-range input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.price-range input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.price-range input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.price-range span {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.apply-price-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apply-price-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* Catalog Content */
.catalog-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-filter-btn {
    display: none;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.results-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    font-weight: 500;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#sort-select {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: all 0.3s ease;
}

#sort-select:focus {
    outline: none;
    border-color: #ffd700;
}

#sort-select option {
    background: #1a1a2e;
    color: #fff;
}

/* Active Filters Tags */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.active-filter-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 184, 0, 0.2) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.active-filter-tag button {
    background: none;
    border: none;
    color: #ffd700;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.2s;
}

.active-filter-tag button:hover {
    color: #ffd700;
}

/* Products Grid */
#products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Loading & Empty States */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.no-results {
    text-align: center;
    padding: 4rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.no-results h3 {
    color: #fff;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.btn-clear-search {
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.btn-clear-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    border-color: transparent;
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: 0.5rem;
}

.page-number {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-number:hover,
.page-number.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    border-color: transparent;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
}

#search-input {
    flex: 1;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: all 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-close {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Responsive */
@media (max-width: 1024px) {
    .catalog-container {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        border-radius: 0;
        overflow-y: auto;
        padding-top: 100px;
    }

    .catalog-sidebar.active {
        display: block;
    }

    .mobile-filter-btn {
        display: flex;
    }
}

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

    #products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .catalog-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        justify-content: space-between;
    }
}