/* my-php-website/assets/css/shop.css */

.shop-page-section {
    padding: 5px 0 40px 0;
    background-color: transparent;
}

.shop-container-outer {
    max-width: 1415px;
    margin: 0 auto;
    padding: 0 15px;
}

.shop-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}


/* Sidebar */
.shop-sidebar {
    flex: 0 0 250px;
    width: 250px;
    background: transparent;
    padding-right: 15px;
}

.filter-group {
    margin-bottom: 25px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 15px;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.filter-title .toggle-icon {
    font-size: 12px;
    color: #888;
    transition: transform 0.3s;
}

.filter-title.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.filter-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    user-select: none;
    padding-left: 28px;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: #888;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #333;
    border-color: #333;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* Main Content */
.shop-main-content {
    flex: 1;
    min-width: 0;
}

/* Top Bar */
.shop-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eaeaea;
}

.grid-toggles {
    display: flex;
    gap: 10px;
}

.grid-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.grid-toggle-btn:hover {
    color: #666;
}

.grid-toggle-btn.active {
    color: #333;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sort-by-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}

.shop-sort-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.product-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Product Grid Layouts */
.shop-product-grid {
    display: grid;
    gap: 20px;
    transition: all 0.3s ease;
}

.mobile-only-grid-btn {
    display: none !important;
}

.desktop-only-grid-btn {
    display: flex !important;
}

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

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

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

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

/* Breadcrumb & Header from Cart Page */
.co-breadcrumb {
    width: 100%;
    max-width: 1100px;
    margin: 20px auto 0;
    padding: 0 20px;
    font-size: 0.9rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}
.co-breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}
.co-breadcrumb a:hover {
    color: #111;
}
.co-breadcrumb .co-sep {
    color: #999;
    margin: 0 8px;
    font-size: 0.7rem;
}
.co-breadcrumb .co-current {
    color: #111;
    font-weight: 500;
}

/* Page-numbered Pagination */
.shop-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 45px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

.pagination-btn {
    background-color: #ffffff;
    border: 1px solid #eaeaea;
    color: #333333;
    width: 44px;
    height: 44px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.pagination-btn:hover:not(:disabled) {
    background-color: #111116;
    border-color: #111116;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination-btn.active {
    background-color: #111116;
    border-color: #111116;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination-btn:disabled {
    color: #cccccc;
    cursor: not-allowed;
    background-color: #fafafa;
    border-color: #eeeeee;
    box-shadow: none;
}

.pagination-ellipsis {
    color: #888888;
    font-size: 14px;
    width: 24px;
    text-align: center;
    font-weight: 500;
}

/* Filter Toggle & Drawer Styles */
.shop-filter-toggle-btn {
    display: none;
}

.sidebar-mobile-header {
    display: none;
}

/* Responsive */
@media (max-width: 991px) {
    .top-bar-left {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .shop-filter-toggle-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background-color: #111116;
        color: #ffffff;
        border: 1px solid rgba(255,255,255,0.1);
        padding: 8px 16px;
        border-radius: 6px;
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .shop-filter-toggle-btn:hover {
        background-color: var(--header-text-hover, #d29a5a);
        color: #ffffff;
    }

    .sidebar-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #eaeaea;
    }

    .sidebar-mobile-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        color: #111;
    }

    #close-filters {
        background: transparent;
        border: none;
        font-size: 20px;
        color: #333;
        cursor: pointer;
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .shop-container {
        flex-direction: column;
    }
    
    .shop-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 350px;
        max-width: 85vw;
        height: 100vh;
        background-color: #ffffff;
        z-index: 2001;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: 0 0 30px rgba(0,0,0,0.15);
        padding: 25px 20px;
        flex: none;
        margin-bottom: 0;
    }

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

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

@media (max-width: 767px) {
    .mobile-only-grid-btn {
        display: flex !important;
    }
    .desktop-only-grid-btn {
        display: none !important;
    }

    /* Mobile: reduce vertical spacing between header and Shop title/breadcrumb */
    .shop-page-section {
        padding-top: 0 !important;
        padding-bottom: 15px;
    }

    /* Reduce the header block (title + breadcrumb) wrapper padding */
    .shop-page-section .shop-container-outer > div:first-child {
        padding-top: 0 !important;
        padding-bottom: 2px !important;
    }

    /* Reduce Shop title (h1) bottom margin to bring breadcrumb closer */
    .shop-page-section .shop-container-outer > div:first-child > h1 {
        margin-bottom: 2px !important;
        font-size: 1.5rem !important;
    }

    /* Reduce breadcrumb top margin */
    .shop-page-section .co-breadcrumb {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
    }

    /* Reduce top bar spacing but keep distance from breadcrumb */
    .shop-page-section .shop-top-bar {
        margin-top: 20px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    /* Move pagination closer */
    .shop-page-section .shop-pagination {
        margin-top: 15px;
        padding-top: 10px;
    }
}

@media (max-width: 576px) {
    .shop-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .shop-product-grid.grid-cols-3,
    .shop-product-grid.grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .shop-product-grid {
        gap: 8px !important;
    }
}
