/* Catalog Page Styles */
.p-catalog-page {
    padding-top: 20px;
    min-height: 100vh;
    background-color: var(--white);
}

.p-catalog-page .catalog-header {
    margin-bottom: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.p-catalog-page .catalog-title {
    font-family: var(--font-primary);
    font-size: 2rem;
    color: var(--secondary-color);
    margin: 0;
    line-height: 1.2;
}

/* Layout Grid */
.p-catalog-page .catalog-content {
    display: flex;
    gap: 3rem;
    position: relative;
    padding-bottom: 4rem;
}

/* Sidebar Filters */
.p-catalog-page .catalog-sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    height: fit-content;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    border-right: 1px solid #EDEDED;
    padding-right: 1.5rem;
}

/* Sidebar Loading Overlay */
.p-catalog-page .sidebar-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 3rem;
    backdrop-filter: blur(1px);
    cursor: not-allowed;
}

.p-catalog-page .sidebar-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #eee;
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: sidebar-spin 0.7s linear infinite;
}

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

.p-catalog-page .filter-group {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #EDEDED;
    padding-bottom: 1.5rem;
}

.p-catalog-page .filter-group:last-child {
    border-bottom: none;
}

.p-catalog-page .filter-title {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--secondary-color);
}

.p-catalog-page .filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Custom Checkbox/Option Styling */
.p-catalog-page .filter-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #666;
    transition: color 0.2s ease;
    user-select: none;
}

.p-catalog-page .filter-option:hover {
    color: var(--secondary-color);
}

.p-catalog-page .hidden-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.p-catalog-page .custom-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid #d1d1d1;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background-color: transparent;
}

.p-catalog-page .filter-option:hover .custom-checkbox {
    border-color: var(--secondary-color);
}

.p-catalog-page .filter-option.active .custom-checkbox {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.p-catalog-page .custom-checkbox i {
    color: white;
    font-size: 10px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.p-catalog-page .filter-option.active .custom-checkbox i {
    opacity: 1;
    transform: scale(1);
}

.p-catalog-page .option-label {
    flex-grow: 1;
}

.p-catalog-page .option-count {
    font-size: 0.8rem;
    color: #999;
}

/* Color Filters - Improved */
.p-catalog-page .color-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.p-catalog-page .color-option-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    gap: 0.3rem;
}

.p-catalog-page .color-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.p-catalog-page .color-circle i {
    color: white;
    font-size: 12px;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.3));
}

.p-catalog-page .color-circle.is-white i {
    color: var(--secondary-color);
}

.p-catalog-page .color-option-wrapper:hover .color-circle {
    transform: scale(1.1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.p-catalog-page .color-circle.active {
    border-color: var(--secondary-color);
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--secondary-color);
}

.p-catalog-page .color-name {
    font-size: 0.75rem;
    color: #666;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-top: -5px;
    position: absolute;
    transform: translateY(35px);
    background: #333;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.p-catalog-page .color-option-wrapper:hover .color-name {
    opacity: 1;
}

/* Size Grid - Improved */
.p-catalog-page .size-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.p-catalog-page .size-option {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border: 1px solid #e0e0e0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.p-catalog-page .size-option:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.p-catalog-page .size-option.active {
    background-color: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

/* Mobile Filters Button */
.p-catalog-page .mobile-filter-toggle {
    display: none;
    width: 100%;
    padding: 1rem;
    background: white;
    border: 1px solid #EDEDED;
    margin-bottom: 1.5rem;
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

.p-catalog-page .mobile-actions {
    display: none;
}

/* Products Grid Area */
.p-catalog-page .catalog-products {
    flex-grow: 1;
}

.p-catalog-page .catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #EDEDED;
}

.p-catalog-page .results-count {
    color: #666;
    font-size: 0.9rem;
}

.p-catalog-page .sort-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.p-catalog-page .sort-label {
    font-size: 0.9rem;
    color: #666;
}

.p-catalog-page .sort-select {
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    border: none;
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    background-color: transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--secondary-color);
}

.p-catalog-page .filter-toggle-simple {
    display: none;
}

/* Active Filters Tags */
.p-catalog-page .active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
    align-items: center;
}

.p-catalog-page .active-filter-tag {
    background-color: #f5f5f5;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}

.p-catalog-page .active-filter-tag:hover {
    background-color: #e0e0e0;
}

.p-catalog-page .active-filter-tag i {
    cursor: pointer;
    font-size: 0.8rem;
    color: #777;
    transition: color 0.2s ease;
}

.p-catalog-page .active-filter-tag i:hover {
    color: var(--color-error, #ff4444);
}

.p-catalog-page .clear-all-btn {
    background: none;
    border: none;
    font-size: 0.85rem;
    text-decoration: underline;
    color: #666;
    cursor: pointer;
    padding: 0 0.5rem;
}

.p-catalog-page .clear-all-btn:hover {
    color: var(--secondary-color);
}

.p-catalog-page .products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Loading Skeleton */
.p-catalog-page .skeleton-card {
    display: flex;
    flex-direction: column;
}

.p-catalog-page .skeleton-image {
    width: 100%;
    aspect-ratio: 9/16;
    background: linear-gradient(110deg, #f0f0f0 8%, #e8e8e8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

.p-catalog-page .skeleton-info {
    padding: 1rem 4px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.p-catalog-page .skeleton-line {
    background: linear-gradient(110deg, #f0f0f0 8%, #e8e8e8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    height: 14px;
}

.p-catalog-page .skeleton-title { width: 80%; height: 16px; }
.p-catalog-page .skeleton-price { width: 50%; }
.p-catalog-page .skeleton-installment { width: 65%; height: 12px; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State */
.p-catalog-page .no-results {
    text-align: center;
    padding: 4rem 0;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.p-catalog-page .no-results-icon {
    width: 80px;
    height: 80px;
    background: #f9f9f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.p-catalog-page .no-results i {
    font-size: 2.5rem;
    color: #ccc;
}

.p-catalog-page .no-results h3 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

/* Pagination */
.p-catalog-page .catalog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 3rem;
    padding: 1.5rem 0;
}

.p-catalog-page .pagination-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: var(--secondary-color);
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 0.3rem;
}

.p-catalog-page .pagination-btn:hover:not(:disabled):not(.active) {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: rgba(0,0,0,0.02);
}

.p-catalog-page .pagination-btn.active {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
    font-weight: 600;
}

.p-catalog-page .pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.p-catalog-page .pagination-prev,
.p-catalog-page .pagination-next {
    font-size: 0.8rem;
}

.p-catalog-page .pagination-dots {
    min-width: 32px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1rem;
    user-select: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .p-catalog-page .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .p-catalog-page .catalog-content {
        flex-direction: column;
        gap: 0;
    }

    .p-catalog-page .catalog-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        background: white;
        z-index: 1000;
        padding: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        border-right: none;
    }

    .p-catalog-page .catalog-sidebar.open {
        transform: translateX(0);
    }

    .p-catalog-page .sidebar-title {
        font-family: var(--font-primary);
        font-size: 1.2rem;
        font-weight: 600;
    }

    .p-catalog-page .close-filters {
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        line-height: 1;
        padding: 0;
    }

    .p-catalog-page .filter-group {
        padding: 1.5rem;
        margin: 0;
    }

    .p-catalog-page .mobile-actions {
        margin-top: auto;
        padding: 1.5rem;
        border-top: 1px solid #EDEDED;
        display: flex;
        gap: 1rem;
        background: white;
        position: sticky;
        bottom: 0;
    }

    .p-catalog-page .btn-apply {
        background-color: var(--secondary-color);
        color: white;
        border: none;
        padding: 1rem;
        flex-grow: 1;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 1px;
    }

    .p-catalog-page .btn-clear {
        background: none;
        border: 1px solid #EDEDED;
        padding: 1rem;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 1px;
    }

    .p-catalog-page .mobile-filter-toggle {
        display: flex;
    }
    
    .p-catalog-page .products-grid {
        gap: 1rem;
    }

    /* Catalog Controls Mobile Layout: Row with space between */
    .p-catalog-page .catalog-controls {
        flex-direction: row; 
        align-items: center;
        justify-content: space-between;
        gap: 0;
        margin-bottom: 2rem;
    }

    /* Hide desktop results count on mobile if not already handled by utility classes */
    .p-catalog-page .results-count {
        display: none;
    }

    /* Simple Filter Button Style */
    .p-catalog-page .filter-toggle-simple {
        background: none;
        border: none;
        font-family: var(--font-secondary);
        font-size: 0.9rem; 
        font-weight: 600;
        color: var(--secondary-color);
        text-transform: uppercase; 
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0;
    }

    .p-catalog-page .filter-toggle-simple i {
        font-size: 1rem;
    }

    .p-catalog-page .sort-wrapper {
        width: auto;
    }

    .p-catalog-page .sort-select {
        padding-right: 0;
        text-align: right;
        direction: rtl; /* Align text to right if needed, or simply text-align */
    }
}
