/**
 * Login Pakistan - All Categories Page Styles
 *
 * Dedicated styling for [lp_all_categories] module.
 * Fully scoped under .lp-all-categories.
 */

.lp-all-categories,
.lp-all-categories * {
    box-sizing: border-box;
}

.lp-all-categories {
    --lp-green: #0b4b31;
    --lp-green-dark: #073a27;
    --lp-gold: #d3a243;
    --lp-text: #252925;
    --lp-muted: #717771;
    --lp-border: #e5ded3;
    --lp-soft: #fdfbf7;
    --lp-card-bg: #ffffff;

    width: 100%;
    padding: 32px 24px 32px;
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--lp-text);
}

/* =========================================================
   INNER SHELL
   Matches Shop max-width 1380px and margin auto
========================================================= */

.lp-all-categories__shell {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
}

/* =========================================================
   DESKTOP GRID LAYOUT
   Matches Shop 255px minmax(0, 1fr) with 24px gap
========================================================= */

.lp-all-categories__layout {
    display: grid;
    grid-template-columns: 255px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* =========================================================
   MOBILE TRIGGER BUTTON (Hidden on Desktop)
========================================================= */

.lp-all-categories__mobile-toggle {
    display: none;
}

.lp-all-categories__drawer-head {
    display: none;
}

.lp-all-categories__overlay {
    display: none;
}

/* =========================================================
   LEFT SIDEBAR CONTAINER
========================================================= */

.lp-all-categories__sidebar {
    position: sticky;
    top: 20px;
    overflow: hidden;
    border: 1px solid var(--lp-border);
    border-radius: 13px;
    background: #fffdf9;
    padding-bottom: 8px;
}

.lp-all-categories__section {
    padding: 0 18px 12px;
}

/* =========================================================
   ACCORDION TOGGLE BUTTON (SHOP BY CATEGORY)
========================================================= */

.lp-all-categories__accordion-toggle {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    border: 0 !important;
    outline: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--lp-green);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    cursor: pointer;
}

.lp-all-categories__accordion-title {
    position: relative;
    padding-bottom: 5px;
}

.lp-all-categories__accordion-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 46px;
    height: 1px;
    background: var(--lp-green);
}

.lp-all-categories__accordion-icon {
    font-size: 15px;
    line-height: 1;
    color: var(--lp-green);
    transition: transform 0.22s ease;
    display: inline-block;
}

/* ACCORDION COLLAPSE / EXPAND LOGIC */

.lp-all-categories__accordion-content {
    display: block;
    padding-top: 6px;
}

.lp-all-categories__accordion:not(.is-open) .lp-all-categories__accordion-content {
    display: none;
}

.lp-all-categories__accordion:not(.is-open) .lp-all-categories__accordion-icon {
    transform: rotate(-90deg);
}

.lp-all-categories__accordion-toggle:hover,
.lp-all-categories__accordion-toggle:focus,
.lp-all-categories__accordion-toggle:focus-visible,
.lp-all-categories__accordion-toggle:active {
    color: var(--lp-green) !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.lp-all-categories__accordion-toggle:hover .lp-all-categories__accordion-title,
.lp-all-categories__accordion-toggle:focus .lp-all-categories__accordion-title,
.lp-all-categories__accordion-toggle:active .lp-all-categories__accordion-title {
    color: var(--lp-green) !important;
}
/* =========================================================
   CLEAR ALL FILTER CONTROL
========================================================= */

.lp-all-categories__clear-wrap {
    display: flex;
    justify-content: flex-end;
    padding: 2px 0 8px;
}

.lp-all-categories__clear-btn {
    border: 0 !important;
    background: transparent !important;
    color: #a32222;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

.lp-all-categories__clear-btn:hover,
.lp-all-categories__clear-btn:focus-visible {
    color: #cf1515;
}

/* =========================================================
   CATEGORY TREE & HIERARCHICAL INDENTATION
========================================================= */

.lp-all-categories__tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lp-all-categories__tree--children {
    padding-left: 18px;
    margin-top: 4px;
    margin-bottom: 4px;
    border-left: 1px dashed #e2d9cb;
    margin-left: 7px;
}

.lp-all-categories__item {
    margin: 0;
    padding: 4px 0;
}

.lp-all-categories__label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--lp-text);
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
    transition: color 0.15s ease;
}

.lp-all-categories__label:hover {
    color: var(--lp-green);
}

/* Native Checkbox visually hidden, accessible */
.lp-all-categories__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

/* Custom Checkbox UI */
.lp-all-categories__custom-check {
    width: 16px;
    height: 16px;
    border: 1.5px solid #c2b8aa;
    border-radius: 3px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.lp-all-categories__checkbox:focus-visible + .lp-all-categories__custom-check {
    outline: 2px solid var(--lp-green);
    outline-offset: 1px;
}

.lp-all-categories__checkbox:checked + .lp-all-categories__custom-check {
    background: var(--lp-green);
    border-color: var(--lp-green);
}

.lp-all-categories__checkbox:checked + .lp-all-categories__custom-check::after {
    content: "";
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-0.5px, -0.5px);
}

.lp-all-categories__name {
    flex-grow: 1;
    word-break: break-word;
}

.lp-all-categories__count {
    color: var(--lp-muted);
    font-size: 11px;
    margin-left: auto;
}

.lp-all-categories__empty-sidebar {
    font-size: 13px;
    color: var(--lp-muted);
    margin: 8px 0;
}

/* =========================================================
   RIGHT MAIN CONTENT & CATEGORY GRID
========================================================= */

.lp-all-categories__main {
    width: 100%;
    min-width: 0;
}

.lp-all-categories__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    width: 100%;
}

/* =========================================================
   CATEGORY CARD
========================================================= */

.lp-all-categories__card {
    display: flex;
    flex-direction: column;
    background: var(--lp-card-bg);
    border: 1px solid var(--lp-border);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    outline: none;
    position: relative;
}

.lp-all-categories__card:hover,
.lp-all-categories__card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(11, 75, 49, 0.08);
    border-color: var(--lp-gold);
}

.lp-all-categories__card-figure {
    position: relative;
    width: 100%;
    padding-top: 80%; /* 5:4 aspect ratio */
    background: #f8f6f1;
    overflow: hidden;
    margin: 0;
}

.lp-all-categories__card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.lp-all-categories__card-img--placeholder {
    object-fit: contain;
    padding: 24px;
    background: #f7f4ee;
    opacity: 0.85;
}

.lp-all-categories__card:hover .lp-all-categories__card-img {
    transform: scale(1.04);
}

.lp-all-categories__card-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    gap: 12px;
    background: #fffdfa;
    border-top: 1px solid #f2ede5;
}

.lp-all-categories__card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--lp-green);
    margin: 0;
    line-height: 1.35;
    transition: color 0.18s ease;
}

.lp-all-categories__card:hover .lp-all-categories__card-title {
    color: var(--lp-green-dark);
}

.lp-all-categories__card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--lp-gold);
    letter-spacing: 0.3px;
}

.lp-all-categories__card-cta-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.lp-all-categories__card:hover .lp-all-categories__card-cta-arrow {
    transform: translateX(4px);
}

/* =========================================================
   NO RESULTS STATE (CLIENT-SIDE FILTERING)
========================================================= */

.lp-all-categories__no-results {
    text-align: center;
    padding: 48px 20px;
    background: #fffdfa;
    border: 1px dashed var(--lp-border);
    border-radius: 12px;
}

.lp-all-categories__no-results-msg {
    font-size: 15px;
    color: var(--lp-muted);
    margin: 0 0 16px;
}

.lp-all-categories__reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border: 1px solid var(--lp-green) !important;
    border-radius: 6px;
    background: var(--lp-green) !important;
    color: #fff !important;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.lp-all-categories__reset-btn:hover {
    background: var(--lp-green-dark) !important;
    border-color: var(--lp-green-dark) !important;
}

.lp-all-categories__empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--lp-muted);
}

/* =========================================================
   RESPONSIVE: MOBILE & TABLET DRAWER BEHAVIOR
   Matches dynamic-shop.css @media (max-width: 800px)
========================================================= */

@media (max-width: 800px) {

    .lp-all-categories {
        padding: 0 16px 25px;
    }

    .lp-all-categories__layout {
        display: block;
    }

    /* Mobile Filter Button */
    .lp-all-categories__mobile-toggle {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 16px;
        padding: 9px 15px;
        border: 1px solid var(--lp-green) !important;
        border-radius: 6px;
        background: #fff !important;
        color: var(--lp-green);
        font-family: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .lp-all-categories__mobile-icon {
        font-size: 15px;
        line-height: 1;
    }

    /* Left Sidebar transforms into slide-out drawer */
    .lp-all-categories__sidebar {
        width: min(86vw, 340px);
        height: 100dvh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 10002;
        overflow-y: auto;
        border-radius: 0;
        border: 0;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
        transform: translateX(-102%);
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .lp-all-categories__sidebar.is-open {
        transform: translateX(0);
    }

    /* Drawer Header */
    .lp-all-categories__drawer-head {
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 18px;
        border-bottom: 1px solid var(--lp-border);
        color: var(--lp-green);
        background: #fffdf9;
    }

    .lp-all-categories__drawer-title {
        font-size: 16px;
        font-weight: 600;
        color: var(--lp-green);
    }

    .lp-all-categories__drawer-close {
        width: 34px;
        height: 34px;
        border: 1px solid var(--lp-border) !important;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff !important;
        color: var(--lp-green);
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
        padding: 0;
    }

    /* Mobile Backdrop Overlay */
    .lp-all-categories__overlay {
        position: fixed;
        inset: 0;
        z-index: 10001;
        display: block;
        background: rgba(6, 60, 40, 0.35);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .lp-all-categories__overlay.is-active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* 2 columns on tablet */
    .lp-all-categories__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 520px) {
    .lp-all-categories__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .lp-all-categories__card-figure {
        padding-top: 75%;
    }
}
