/**
 * Shop Page Layout (Archive Product)
 * Page grid, sidebar, view controls, sort dropdown, loading states
 *
 * @package LustMich
 */

/* =============================================
   Shop H1
   ============================================= */
.lm-shop-h1 {
    font-size: 22px;
    font-weight: 300;
    color: #201712;
    margin: 0 0 1.5rem;
}

/* =============================================
   Page Layout
   ============================================= */
.lm-shop-page {
    width: 100%;
    padding: 5rem 0;
    background: #fff;
}
.lm-shop-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
}

/* =============================================
   Sidebar
   ============================================= */
.lm-shop-sidebar {
    position: sticky;
    top: 50px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}
.lm-sidebar-title {
    font-size: 24px;
    font-weight: 300;
    color: #201712;
    margin-bottom: 1.5rem;
}

/* =============================================
   View Controls
   ============================================= */
.lm-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}
.lm-view-toggle {
    display: flex;
    gap: 0.5rem;
}
.lm-view-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0px !important;
    padding: 10px 16px;
    background: white;
    border: 1px solid #E6E6E6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 400;
    color: #696969;
}
.lm-view-btn svg {
    width: 20px;
    height: 20px;
}
.lm-view-btn:hover {
    background: #F6F9FC;
    border-color: #A28573;
    color: #A28573;
}
.lm-view-btn:hover svg {
    stroke: #A28573;
}
.lm-view-btn.active {
    background: white;
    border-color: #A28573;
    color: #A28573;
    font-weight: 400;
}
.lm-view-btn.active svg {
    stroke: #A28573;
}
.lm-product-count {
    font-size: 14px;
    color: #696969;
}
.lm-product-count strong {
    color: #201712;
    font-weight: 400;
}

/* =============================================
   Sort Dropdown
   ============================================= */
.lm-sort-dropdown {
    position: relative;
}
.lm-sort-dropdown__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    border: none !important;
    letter-spacing: 0px !important;
    cursor: pointer;
    font-size: 12px;
    font-weight: 300;
    color: #696969;
    transition: all 0.3s ease;
}
.lm-sort-dropdown__trigger:hover {
    border-color: #A28573;
    color: #A28573;
}
.lm-sort-dropdown__trigger:hover .lm-sort-dropdown__arrow {
    stroke: #A28573;
}
.lm-sort-dropdown__label {
    font-weight: 300;
    color: #201712;
}
.lm-sort-dropdown__arrow {
    transition: transform 0.3s ease;
}
.lm-sort-dropdown.is-open .lm-sort-dropdown__trigger {
    border-color: #A28573;
    color: #A28573;
}
.lm-sort-dropdown.is-open .lm-sort-dropdown__arrow {
    transform: rotate(180deg);
    stroke: #A28573;
}
.lm-sort-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: white;
    border: 1px solid #E6E6E6;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 6px 0;
    margin: 0;
    z-index: 100;
}
.lm-sort-dropdown.is-open .lm-sort-dropdown__menu {
    display: block;
}
.lm-sort-dropdown__header {
    padding: 8px 16px 4px !important;
    font-size: 12px;
    font-style: italic;
    color: #999;
    font-weight: 300;
    pointer-events: none;
}
.lm-sort-dropdown__menu li {
    margin: 0;
    padding: 0;
}
.lm-sort-dropdown__menu a {
    display: block;
    padding: 8px 16px;
    color: #696969;
    text-decoration: none;
    font-size: 14px;
    font-weight: 300;
    transition: all 0.2s ease;
}
.lm-sort-dropdown__menu a:hover {
    background: #F6F9FC;
    color: #A28573;
}
.lm-sort-dropdown__menu a.is-active {
    color: #A28573;
    font-weight: 400;
}

/* =============================================
   Loading States
   ============================================= */
.lm-loading-initial {
    text-align: center;
    padding: 4rem 2rem;
    color: #696969;
    font-size: 16px;
}
.lm-loading-more {
    text-align: center;
    padding: 2rem;
    color: #696969;
}
.lm-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 4px solid #E6E6E6;
    border-top-color: #A28573;
    border-radius: 50%;
    animation: lm-spin 0.8s linear infinite;
}
@keyframes lm-spin {
    to { transform: rotate(360deg); }
}
.lm-no-more-products {
    text-align: center;
    padding: 2rem;
    color: #696969;
    font-size: 14px;
}

/* =============================================
   Hide mobile-only elements on desktop
   ============================================= */
.lm-category-tab,
.lm-sidebar-overlay {
    display: none;
}

/* =============================================
   Hide big grid on mobile
   ============================================= */
@media (max-width: 768px) {
    .lm-view-btn--grid-big {
        display: none;
    }
}

/* =============================================
   Responsive: Tablet
   ============================================= */
@media (max-width: 1024px) {
    .lm-shop-container {
        grid-template-columns: 240px 1fr;
        gap: 2rem;
        padding: 0 1.5rem;
    }
    .lm-view-btn span {
        display: none;
    }
    .lm-view-btn {
        padding: 10px;
    }
    .lm-sort-dropdown__label {
        display: none;
    }
}

/* =============================================
   Responsive: Mobile
   ============================================= */
@media (max-width: 767px) {
    .lm-shop-page {
        padding: 3rem 0;
    }
    .lm-shop-h1 {
        text-align: center;
    }
    .lm-shop-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    /* Slide-in drawer */
    .lm-shop-sidebar {
        position: fixed;
        font-size: larger;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        max-height: 100%;
        background: #fff;
        z-index: 10000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow: visible;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
    .lm-shop-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15);
    }
    .lm-shop-sidebar .lm-sidebar-inner {
        height: 100%;
        overflow-y: auto;
        padding: 40px 1.5rem 2rem;
    }

    /* Vertical binder tab */
    .lm-category-tab {
        display: block;
        position: absolute;
        top: 20%;
        right: -25px;
        transform: translateY(-50%);
        padding-right: 6px !important;
        writing-mode: vertical-lr;
        background: #a2857369;
        color: #fff;
        border: none;
        padding: 16px 8px;
        font-size: 11px;
        font-weight: 400;
        letter-spacing: 3px;
        text-transform: uppercase;
        cursor: pointer;
        border-radius: 0 6px 6px 0;
        z-index: 1;
        white-space: nowrap;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        transition: background 0.2s ease;
    }
    .lm-category-tab:active {
        background: #8a6f60;
    }

    /* Overlay */
    .lm-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 9999;
        transition: opacity 0.3s ease;
    }
    .lm-sidebar-overlay.is-open {
        display: block;
    }

    /* View controls */
    .lm-view-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    .lm-view-toggle {
        justify-content: center;
    }
    .lm-product-count {
        text-align: center;
    }
}
