/* =========================================
   Product List Page - Sidebar Layout
   ========================================= */

.product-layout-wrapper {
    background-color: #f7f8fa;
    /* Light gray background for the whole page area */
    padding: 40px 0;
    min-height: 80vh;
}

.product-layout-inner {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

/* --- Sidebar --- */
.product-sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.sidebar-head {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.sidebar-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #0a8fc4;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    border-bottom: 1px solid #f5f5f5;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    transition: background 0.2s;
    cursor: pointer;
}

.menu-link-row:hover {
    background-color: #f9f9f9;
}

.menu-link-row.active {
    background-color: #e6f7ff;
    /* Light blue highlight */
}

.menu-link-row.active .menu-link {
    color: #1890ff;
    /* Primary blue */
    font-weight: 600;
}

.menu-link {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    flex-grow: 1;
}

.submenu-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: transform 0.3s;
}

.menu-item.expanded .submenu-toggle {
    transform: rotate(90deg);
}

/* Submenu */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #fff;
    display: none;
    /* Hidden by default */
}

.submenu-item a {
    display: block;
    padding: 12px 20px;
    /* Left aligned with parent */
    text-decoration: none;
    color: #444;
    font-size: 13px;
    transition: color 0.2s;
}

.submenu-item a:hover {
    color: #1890ff;
}

.submenu-item.active a {
    color: #1890ff;
    font-weight: 600;
    background-color: #f0f0f0;
}


/* --- Main Content --- */
.product-main-content {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.content-header {
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
    padding-bottom: 16px;
}

.page-heading {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin: 0 0 8px 0;
}

.breadcrumbs-simple {
    font-size: 13px;
    color: #888;
}

.breadcrumbs-simple a {
    color: #666;
    text-decoration: none;
}

.breadcrumbs-simple a:hover {
    color: #1890ff;
}

.breadcrumbs-simple .sep {
    margin: 0 6px;
    color: #ccc;
}

.breadcrumbs-simple .current {
    color: #333;
}


/* --- Product Grid --- */
.product-grid-simple {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card-simple {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.product-card-simple:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.pc-thumb {
    width: 100%;
    aspect-ratio: 1;
    /* Square image */
    background: #f9f9f9;
    overflow: hidden;
    position: relative;
}

.pc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* or contain, depending on preference. 'cover' looks cleaner */
    transition: transform 0.3s;
}

.product-card-simple:hover .pc-thumb img {
    transform: scale(1.05);
}

.pc-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.pc-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 16px 0;
    line-height: 1.4;
    height: 42px;
    /* Limit to 2 lines approx */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pc-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.pc-title a:hover {
    color: #1890ff;
}


/* Pagination */
.pagination-simple {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination-simple .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #eee;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination-simple .page-numbers.current,
.pagination-simple .page-numbers:hover {
    background-color: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

/* Responsive */
@media (max-width: 991px) {
    .product-layout-inner {
        grid-template-columns: 1fr;
        position: relative;
    }

    /* Header Row for Title and Filter Button */
    .header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .header-row .page-heading {
        margin: 0;
        font-size: 16px;
        line-height: 1.2;
    }

    /* Inline Filter Button */
    .btn-filter-inline {
        display: flex;
        align-items: center;
        gap: 6px;
        background: #f0f2f5;
        border: none;
        padding: 6px 12px;
        border-radius: 5px;
        /* Pill shape */
        font-size: 14px;
        
        cursor: pointer;
        white-space: nowrap;
        transition: background 0.2s;
    }

    .btn-filter-inline:hover {
        background: #e1e4e8;
    }

    .btn-filter-inline i {
        font-size: 16px;
    }

    /* Off-canvas Drawer Sidebar */
    .product-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        /* Slide from left */
        width: 100%;
        /* Full screen width */
        height: 100vh;
        background: #fff;
        z-index: 10000;
        transform: translateX(-100%);
        /* Hidden by default */
        transition: transform 0.3s ease;
        box-shadow: none;
        /* No shadow needed for full screen */
        overflow-y: auto;
        margin: 0;
        border-radius: 0;
    }

    .product-sidebar.active {
        transform: translateX(0);
    }

    /* Admin Bar Fix for Mobile */
    body.admin-bar .product-sidebar {
        top: 46px !important;
        height: calc(100vh - 46px) !important;
    }

    /* Sidebar Header Mobile */
    .sidebar-header-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        border-bottom: 1px solid #eee;
        background: transparent;
        flex-shrink: 0;
    }

    .sidebar-header-mobile .sidebar-title {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #1f2937;
    }

    .btn-close-sidebar {
        width: 30px;
        height: 30px;
        border: none;
        background: transparent;
        color: #1f2937;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-radius: 8px;
        transition: background-color 0.2s ease;
        padding: 0;
        font-size: 26px;
        line-height: 1;
        font-weight: 300;
    }

    .btn-close-sidebar:hover {
        background: rgba(15, 23, 42, 0.08);
    }

    .sidebar-head {
        display: none;
        /* Hide original title in drawer */
    }

    /* Reset Menu Styles for Vertical Layout in Drawer */
    .sidebar-menu-wrap {
        padding: 0;
        margin: 0;
        overflow: visible;
    }

    .sidebar-menu {
        display: block;
        /* Vertical list */
        padding: 0;
    }

    .menu-item {
        border-bottom: 1px solid #f5f5f5;
        display: block;
    }

    .menu-link-row {
        padding: 12px 20px;
        background: transparent;
        border: none;
        border-radius: 0;
        justify-content: space-between;
    }

    .menu-link-row.active {
        background-color: #e6f7ff;
    }

    .menu-link-row.active .menu-link {
        color: #1890ff;
    }

    .submenu-toggle {
        display: flex;
        margin-left: auto;
    }

    /* Submenu in Drawer (Accordion style) */
    .submenu {
        position: static;
        /* Normal flow */
        box-shadow: none;
        border: none;
        background: #fcfcfc;
        padding: 0;
        display: none;
    }

    .menu-item.expanded .submenu {
        display: block !important;
    }

    .submenu-item a {
        padding: 10px 20px 10px 35px;
        /* Indent */
        border-bottom: 1px solid #f9f9f9;
    }

    /* Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .product-main-content {
        padding: 15px;
    }

    .pc-title{
        font-size: 14px;
    }
}

/* Desktop: Hide mobile elements */
@media (min-width: 992px) {

    .mobile-filter-bar,
    .sidebar-header-mobile,
    .sidebar-overlay,
    .btn-filter-inline {
        display: none;
    }
}