/* Subcategory Page Styles - Premium Responsive Grid Layout */

:root {
    --pg-bg: #ffffff;
    --pg-primary: #1a1a1a;
    --pg-secondary: #f1f1f1;
    --pg-text: #1a1a1a;
    --pg-text-muted: #999999;
    --pg-border: #f0f0f0;
    --pg-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.pg-shop-container {
    padding: 0 10px; /* Reduced from 20px */
    max-width: 100% !important;
    margin-top: 20px;
}

.pg-shop-layout {
    display: flex;
    gap: 15px; /* Reduced from 30px */
}

.pg-main-content {
    flex-grow: 1;
}

/* Top Bar Styling */
.pg-collection-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px 0;
    border-bottom: 1px solid var(--pg-border);
}

.pg-filter-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--pg-primary);
}

.pg-sort-by {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.pg-sort-by .label { font-weight: 700; color: var(--pg-primary); }

.pg-sort-by select {
    border: none;
    background: var(--pg-secondary);
    padding: 8px 35px 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23333' d='M0 2l4 4 4-4H0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
    min-width: 140px;
}

/* Sidebar Styling - Matching Image */
div[part="body"] {
    display: flex;
    flex-direction: column;
    gap: 0; /* Removed gap for tightest layout */
    padding: 10px 5px;
}

.pg-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pg-border);
}

.pg-sidebar-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.pg-widget {
    border-bottom: 1px solid var(--pg-border);
    padding-bottom: 0;
    padding-top: 5px; /* Minimal padding */
}

.pg-widget-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    padding: 15px 0; /* Add padding here for better click area and spacing */
    margin-bottom: 0; /* Important: removes gap when collapsed */
    cursor: pointer;
}

.pg-widget-content {
    padding-bottom: 20px;
}

.pg-widget-icon {
    background: transparent;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.pg-widget-title.collapsed .pg-widget-icon {
    transform: rotate(180deg);
}

.pg-widget-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* Custom Checkbox Style */
.pg-checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.pg-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fff;
    position: relative;
    transition: all 0.2s;
}

input[type="checkbox"]:checked + .pg-checkbox,
input[type="radio"]:checked + .pg-checkbox {
    background: var(--pg-primary);
    border-color: var(--pg-primary);
}

input[type="checkbox"]:checked + .pg-checkbox::after,
input[type="radio"]:checked + .pg-checkbox::after {
    content: "✓";
    color: #fff;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Color Swatch Filter */
.pg-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pg-color-swatch {
    position: relative;
    cursor: pointer;
}

.pg-color-swatch input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.pg-color-swatch .swatch-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.pg-color-swatch:hover .swatch-circle {
    transform: scale(1.15);
}

.pg-color-swatch input:checked + .swatch-circle {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pg-primary);
    transform: scale(1.1);
}

/* Price Slider & Inputs */

/* Price Slider & Inputs */
.pg-price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pg-price-field {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
}

.pg-price-field span { font-size: 14px; color: #777; margin-right: 5px; }

.pg-price-field input {
    border: none;
    width: 100%;
    text-align: right;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    color: #777;
}

/* User-Friendly Apply Button */
.pg-apply-btn {
    width: 100%;
    background: var(--pg-primary); /* Primary black for high visibility */
    color: #ffffff;
    border: none;
    padding: 16px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5px;
}

.pg-clear-link {
    text-align: center;
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--pg-text-muted);
    text-decoration: none;
}

.pg-apply-btn:hover {
    background: #333;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.pg-apply-btn:active {
    transform: translateY(0);
}

/* Sidebar Desktop - Permanent on left */
@media screen and (min-width: 992px) {
    .pg-sidebar {
        width: 320px;
        flex-shrink: 0;
        position: sticky;
        top: 20px;
        height: calc(100vh - 70px); /* Slightly shorter to avoid overflow */
        background: #fff;
        display: flex;
        flex-direction: column;
    }

    div[part="body"] {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    .pg-filter-form {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .pg-sidebar-widgets {
        flex-grow: 1;
        overflow-y: auto;
        padding: 0 5px 20px 0;
        scrollbar-width: none; /* Hide for Firefox */
        -ms-overflow-style: none;  /* Hide for IE/Edge */
    }

    .pg-sidebar-widgets::-webkit-scrollbar {
        display: none; /* Hide for Chrome/Safari */
    }

    .pg-sidebar-footer {
        flex-shrink: 0;
        background: #fff;
        padding: 15px 0 0 0; /* Top padding only */
        border-top: 1px solid var(--pg-border);
    }

    .pg-filter-btn { display: none !important; }
}

/* Sidebar Mobile - Drawer style */
@media screen and (max-width: 991px) {
    .pg-sidebar {
        position: fixed;
        left: -350px;
        top: 0;
        width: 320px;
        height: 100%;
        background: #fff;
        z-index: 10001;
        transition: left 0.3s ease;
        padding: 0;
        display: flex;
        flex-direction: column;
    }
    .pg-sidebar.active { left: 0; }

    div[part="body"] {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 20px 20px;
        height: 100%;
    }

    .pg-filter-form {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    .pg-sidebar-widgets {
        flex-grow: 1;
        overflow-y: auto;
        margin-bottom: 0;
        scrollbar-width: none; /* Hide for Firefox */
        -ms-overflow-style: none;  /* Hide for IE/Edge */
    }

    .pg-sidebar-widgets::-webkit-scrollbar {
        display: none; /* Hide for Chrome/Safari */
    }

    .pg-sidebar-footer {
        flex-shrink: 0;
        background: #fff;
        padding: 15px 0 0 0; /* Removed left, right, bottom padding */
        border-top: 1px solid var(--pg-border);
        margin-top: auto;
        box-shadow: 0 -10px 20px rgba(0,0,0,0.05);
    }

    .pg-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 10000;
        display: none;
    }
    .pg-sidebar-overlay.active { display: block; }

    /* New Mobile Filter Button Styling */
    .pg-filter-btn-mobile {
        width: 100%;
        background: #ffffff;
        color: #111111;
        border: 1px solid #e5e5e5;
        padding: 12px 20px;
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        display: flex;
        justify-content: center; /* Center text */
        align-items: center;
        border-radius: 25px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }
}

/* Standard Product Layout (From Previous Step) */
product-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px; /* Reduced gap */
    width: 100%;
}

@media (min-width: 768px) { product-list { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 1024px) { product-list { grid-template-columns: repeat(4, 1fr); gap: 15px; } }
@media (min-width: 1400px) { product-list { grid-template-columns: repeat(5, 1fr); } }

/* Premium Product Card Styles (Inspired by Voyage) */
.product-card--premium {
    padding: 0; /* Full width image */
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.product-card--premium:hover {
    border-color: #eee;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.pg-product-card__figure {
    position: relative;
    aspect-ratio: 1/1;
    background: #fdfdfd;
    overflow: hidden;
    margin-bottom: 0;
}

.pg-product-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* removed transition for simple static image */
}

/* Secondary image hidden permanently since hover effect is removed */
.pg-product-card__image--secondary {
    display: none;
}

.pg-product-card__info {
    padding: 12px; /* Added internal padding */
    flex-grow: 1;
}

.pg-product-card__title {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #1a1a1a;
    margin-bottom: 6px;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pg-product-card__title a {
    color: inherit;
    text-decoration: none;
}

.pg-price-list {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.text-on-sale {
    color: #000;
    font-weight: 700;
    font-size: 15px;
}

.text-subdued {
    color: #999;
    font-size: 13px;
}



/* Premium Add to Cart Button */
.pg-product-card__add-to-cart {
    margin-top: auto;
    padding: 0; /* Removed padding for full-width button */
}

.pg-product-card__atc-button {
    width: 100%;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 10px; /* Square button for premium look */
}

.pg-product-card__atc-button:hover {
    background: #fff;
    color: #000;
}

/* Modern Minimal Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* Increased gap */
    border-radius: 0;
}

.page-item {
    margin: 0;
    border: none;
}

.page-item.disabled .page-link {
    background: transparent;
    color: #e0e0e0;
    border: 2px solid transparent;
}

.page-link {
    border: 2px solid transparent; /* Thick border specifically for hover visibility */
    background: transparent;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 600;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    outline: none;
}

.page-link:hover {
    background-color: transparent;
    border-color: #000; /* Pure black */
    color: #000;
    transform: translateY(-2px);
    text-decoration: none;
    z-index: 2;
}

.page-item.active .page-link {
    background-color: #000;
    border: 2px solid #000;
    color: #fff;
}

.page-link:focus {
    box-shadow: none;
}
