/* ========================================
   Shop Page Styles
   ======================================== */

.shop-main {
    padding-top: 140px;
    min-height: 100vh;
}

/* Shop Header */
.shop-header {
    padding: 24px 0 32px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.shop-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.shop-header p {
    color: var(--text-muted);
    margin: 0;
}

/* Shop Layout */
.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    padding-bottom: 80px;
}

/* Sidebar */
.shop-sidebar {
    position: sticky;
    top: 130px;
    height: fit-content;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

/* Sidebar Header */
.sidebar-close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-close h2 {
    font-size: 1.25rem;
    margin: 0;
}

.sidebar-close button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-close button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sidebar-close button svg {
    width: 18px;
    height: 18px;
}

.filter-section {
    margin-bottom: 32px;
}

.filter-section h3 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-white);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Filter Select */
.filter-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238899a6' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.filter-select:focus {
    border-color: var(--primary);
    outline: none;
}

/* Filter Checkboxes */
.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.filter-checkbox:hover {
    color: var(--primary);
}

.filter-checkbox input {
    display: none;
}

.filter-checkbox .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.filter-checkbox .checkmark svg {
    width: 12px;
    height: 12px;
    color: var(--bg-dark);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.filter-checkbox input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.filter-checkbox input:checked + .checkmark svg {
    opacity: 1;
}

/* Price Range Slider */
.price-range {
    padding: 8px 0;
}

.price-range-slider {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    appearance: none;
    cursor: pointer;
}

.price-range-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.price-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.price-range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.price-range-values span {
    font-family: var(--font-mono);
}

/* Format Pills */
.format-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.format-pill {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.format-pill:hover,
.format-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

/* Clear Filters Button */
.clear-filters {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 24px;
}

.clear-filters:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Shop Content */
.shop-content {
    min-width: 0;
}

/* Toolbar */
.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.shop-result-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.shop-result-count strong {
    color: var(--text-white);
}

.shop-sort {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shop-sort label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.shop-sort select {
    padding: 8px 36px 8px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238899a6' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 4px;
}

.view-toggle button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-toggle button:hover,
.view-toggle button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

.view-toggle button svg {
    width: 18px;
    height: 18px;
}

/* Product Grid */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.shop-grid.list-view {
    grid-template-columns: 1fr;
}

/* Product Card - Shop specific overrides */
.shop-grid .product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.shop-grid .product-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.shop-grid .product-image {
    position: relative;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a222d 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-grid .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.shop-grid .product-card:hover .product-image img {
    transform: scale(1.05);
}

.shop-grid .product-image .placeholder-icon {
    font-size: 3rem;
    color: var(--border-color);
}

.shop-grid .product-image .badge {
    position: absolute;
    top: 12px;
    left: 12px;
}

.shop-grid .quick-view-btn {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.shop-grid .product-card:hover .quick-view-btn {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.shop-grid .quick-view-btn:hover {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
}

.shop-grid .product-info {
    padding: 20px;
}

.shop-grid .product-category {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.shop-grid .product-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-white);
}

.shop-grid .product-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.shop-grid .product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.shop-grid .product-pages {
    color: var(--text-muted);
}

.shop-grid .rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shop-grid .rating .star {
    color: #ffc107;
}

.shop-grid .rating-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 4px;
}

.shop-grid .product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.shop-grid .product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.shop-grid .price-original {
    font-size: 0.9rem;
    color: var(--text-dim);
    text-decoration: line-through;
}

.shop-grid .price {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* List View Styles */
.shop-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 200px 1fr;
}

.shop-grid.list-view .product-image {
    aspect-ratio: auto;
    height: 100%;
}

.shop-grid.list-view .product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Pagination */
.shop-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty State */
.shop-empty {
    text-align: center;
    padding: 80px 20px;
}

.shop-empty svg {
    width: 80px;
    height: 80px;
    color: var(--border-color);
    margin-bottom: 24px;
}

.shop-empty h3 {
    margin-bottom: 8px;
}

.shop-empty p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Mobile Filter Toggle */
.filter-toggle-mobile {
    display: none;
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 24px;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.filter-toggle-mobile svg {
    width: 18px;
    height: 18px;
}

/* Responsive */
@media (max-width: 1200px) {
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: none;
        background: var(--bg-dark);
        padding: 24px;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        overflow-y: auto;
    }

    .shop-sidebar.active {
        transform: translateX(0);
    }

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

    .sidebar-close {
        padding-bottom: 0;
        border-bottom: none;
    }

    .sidebar-close button {
        width: 40px;
        height: 40px;
    }

    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .shop-main {
        padding-top: 120px;
    }

    .shop-toolbar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .shop-sort {
        justify-content: space-between;
    }

    .shop-grid {
        grid-template-columns: 1fr;
    }

    .shop-grid.list-view .product-card {
        grid-template-columns: 1fr;
    }

    .shop-grid.list-view .product-image {
        aspect-ratio: 4/3;
    }
}
