/* ==========================================================================
   LIGHTCOMMERCE ARCHIVE CSS - ISOLATION BEM (OPTIMIZED PADDING & MOBILE)
   ========================================================================== */

.lc-scope *,
.lc-scope *::before,
.lc-scope *::after {
    font-family: var(--font-lexend, 'Lexend'), sans-serif !important;
    box-sizing: border-box;
}

/* 1. BREADCRUMB DÒNG TRÊN CÙNG */
.lc-shop-breadcrumb-row {
    max-width: var(--container-max-w, 1200px) !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-top: 30px !important;
    padding-bottom: 20px !important;
}

.lc-shop-breadcrumb-row .woocommerce-breadcrumb,
.lc-shop-breadcrumb-row nav {
    background: transparent !important;
    border: none !important;
    font-size: 14px !important;
    color: var(--text-grey, #7B8A99) !important;
    margin: 0 !important;
    padding: 0 !important;
}

.lc-shop-breadcrumb-row a {
    color: var(--text-grey, #7B8A99) !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.lc-shop-breadcrumb-row a:hover {
    color: var(--color-accent, #027CC5) !important;
}

/* 2. LAYOUT 2 CỘT CHÍNH */
.lc-shop-main {
    max-width: var(--container-max-w, 1200px) !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-top: 10px !important;
    padding-bottom: 60px !important;
    padding-left: var(--container-pad-x, 15px) !important;
    padding-right: var(--container-pad-x, 15px) !important;
}

.lc-shop-layout {
    display: flex !important;
    gap: 40px !important;
    align-items: flex-start !important;
}

/* CỘT TRÁI - SIDEBAR (BỘ LỌC) */
.lc-shop-sidebar {
    width: 260px !important;
    flex-shrink: 0 !important;
}

.lc-sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-title, #000000) !important;
    margin: 0 0 10px 0;
}

.lc-sidebar-chevron {
    display: none;
    color: var(--text-dark, #000000);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.lc-sidebar-divider {
    width: 100%;
    height: 1px;
    background-color: #E2E8F0 !important;
    margin-top: 18px;
    margin-bottom: 18px;
}

.lc-sidebar-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark, #000000) !important;
    margin: 0 0 16px 0;
}

/* 2.1. DANH MỤC SẢN PHẨM */
.lc-cat-filter-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.lc-cat-filter-list li {
    margin-bottom: 8px;
}

.lc-cat-filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none !important;
    color: var(--text-dark, #000000) !important;
    opacity: 0.8 !important;
    font-size: 14.5px;
    padding: 6px 0;
    transition: all 0.2s ease;
}

.lc-cat-filter-item:hover {
    color: var(--color-accent, #027CC5) !important;
    opacity: 1 !important;
}

.lc-cat-label-wrap {
    display: flex;
    align-items: center;
    min-width: 0;
}

.lc-checkbox-box {
    width: 17px;
    height: 17px;
    border: 1.5px solid var(--text-grey, #7B8A99);
    border-radius: 4px;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.lc-cat-filter-item.active {
    color: var(--color-accent, #027CC5) !important;
    font-weight: 600;
    opacity: 1 !important;
}

.lc-cat-filter-item.active .lc-checkbox-box {
    background-color: var(--color-accent, #027CC5) !important;
    border-color: var(--color-accent, #027CC5) !important;
}

.lc-cat-filter-item.active .lc-checkbox-box::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.lc-cat-toggle-icon {
    font-size: 18px;
    font-weight: 300;
    color: var(--color-accent, #027CC5) !important;
}

/* 2.2. BỘ LỌC GIÁ KÈM TOOLTIP SỐ */
.lc-price-slider-container {
    position: relative;
    width: 100%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    margin: 38px 0 20px 0;
}

.lc-price-slider-track {
    position: absolute;
    height: 100%;
    background-color: var(--color-accent, #027CC5);
    border-radius: 3px;
    top: 0;
    left: 0%;
    right: 0%;
}

.lc-price-range-input {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 0;
    left: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    margin: 0;
    outline: none;
}

#lcRangeMin { z-index: 5; }
#lcRangeMax { z-index: 6; }

.lc-price-range-input::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--color-accent, #027CC5);
    pointer-events: auto;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.1s ease;
}

.lc-price-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.lc-price-range-input::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--color-accent, #027CC5);
    pointer-events: auto;
    -moz-appearance: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.1s ease;
}

.lc-price-range-input::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.lc-slider-tooltip {
    position: absolute;
    top: -30px;
    background-color: var(--color-accent, #027CC5);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

#lcTooltipMax {
    transform: translateX(50%);
}

.lc-slider-tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px 4px 0 4px;
    border-style: solid;
    border-color: var(--color-accent, #027CC5) transparent transparent transparent;
}

.lc-filter-price .lc-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.lc-filter-price input[type="number"] {
    width: 100%;
    padding: 8px 10px !important;
    border: 1px solid #dcdcdc !important;
    border-radius: 4px !important;
    font-size: 13.5px !important;
    color: var(--text-dark, #000000) !important;
    background-color: #ffffff !important;
    outline: none !important;
    transition: border-color 0.2s ease;
    -moz-appearance: textfield;
}

.lc-filter-price input[type="number"]::-webkit-outer-spin-button,
.lc-filter-price input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.lc-filter-price input[type="number"]:focus {
    border-color: var(--color-accent, #027CC5) !important;
}

.lc-price-separator {
    color: var(--text-grey, #7B8A99);
    font-size: 14px;
    font-weight: 500;
}

.lc-btn-filter-price {
    width: 100%;
    padding: 9px 12px !important;
    background-color: var(--color-accent, #027CC5) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.lc-btn-filter-price:hover {
    background-color: #02639e !important;
}

.lc-btn-filter-price:active {
    transform: scale(0.98);
}

/* 2.3. BỘ LỌC MÀU SẮC */
.lc-color-filter-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.lc-color-item {
    margin-bottom: 6px;
}

.lc-color-link {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    color: var(--text-dark, #000000) !important;
    opacity: 0.8;
    font-size: 14px;
    padding: 5px 0;
    transition: all 0.2s ease;
}

.lc-color-link:hover {
    opacity: 1;
    color: var(--color-accent, #027CC5) !important;
}

.lc-color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #dcdcdc;
    margin-right: 10px;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.lc-color-item:hover .lc-color-swatch {
    transform: scale(1.15);
}

.lc-color-name {
    flex-grow: 1;
}

.lc-color-count {
    font-size: 12.5px;
    color: var(--text-grey, #7B8A99);
    margin-left: 6px;
}

.lc-color-item.active .lc-color-link {
    font-weight: 600;
    opacity: 1;
    color: var(--color-accent, #027CC5) !important;
}

.lc-color-item.active .lc-color-swatch {
    border-color: var(--color-accent, #027CC5) !important;
    box-shadow: 0 0 0 2px var(--color-accent, #027CC5);
}

.lc-no-filter {
    font-size: 13.5px;
    color: var(--text-grey, #7B8A99);
}

/* CỘT PHẢI - CONTENT */
.lc-shop-content {
    flex: 1 !important;
    min-width: 0 !important;
}

/* 3. HEADER & TOOLBAR SẮP XẾP */
.lc-shop-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #f2f2f2;
    padding-bottom: 15px;
    gap: 15px;
}

.lc-shop-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-title, #000000) !important;
    margin: 0 !important;
    letter-spacing: 0.5px;
}

.lc-shop-toolbar {
    display: flex;
    align-items: center;
}

.lc-shop-toolbar select,
.lc-shop-toolbar .woocommerce-ordering select,
.lc-scope select.custom-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    border: 1px solid #dcdcdc !important;
    padding: 8px 36px 8px 14px !important;
    font-family: var(--font-lexend, 'Lexend'), sans-serif !important;
    font-size: 14px !important;
    color: var(--text-dark, #000000) !important;
    cursor: pointer !important;
    outline: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

.lc-shop-toolbar select:focus,
.lc-scope select.custom-select:focus {
    border-color: var(--color-accent, #027CC5) !important;
}

/* 4. LƯỚI SẢN PHẨM 3 CỘT */
.lc-ajax-wrap {
    width: 100% !important;
    box-sizing: border-box !important;
}

.lc-scope .lc-product-grid,
.lc-scope .lc-product-grid--cols-3 {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-left: -10px !important;
    margin-right: -10px !important;
    width: calc(100% + 20px) !important;
    box-sizing: border-box !important;
}

.lc-scope .lc-product-grid > *,
.lc-scope .lc-product-grid--cols-3 > * {
    flex: 0 0 calc(33.333% - 20px) !important;
    max-width: calc(33.333% - 20px) !important;
    width: calc(33.333% - 20px) !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
    margin-bottom: 25px !important;
    box-sizing: border-box !important;
}

.lc-scope .lc-product-grid .product-card {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

.lc-scope .lc-product-grid .product-card__img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
}

.lc-scope .lc-product-grid .product-card__img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.lc-no-products {
    width: 100% !important;
    text-align: center;
    padding: 30px 0;
}

/* 5. PHÂN TRANG (PAGINATION) */
.lc-pagination {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 6px; 
    margin-top: 40px;
    width: 100% !important;
}

.lc-pagination a {
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    width: 32px; 
    height: 32px;
    border: 1px solid #dcdcdc; 
    color: var(--text-dark, #000000); 
    font-size: 13.5px; 
    font-weight: 500; 
    text-decoration: none;
    background-color: #ffffff;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.lc-pagination a:hover { 
    border-color: #999999; 
    color: var(--color-accent, #027CC5); 
}

.lc-pagination a.active {
    background-color: var(--color-accent, #027CC5) !important;
    border-color: var(--color-accent, #027CC5) !important; 
    color: #ffffff !important; 
    font-weight: 600;
}

/* ==========================================================================
   6. RESPONSIVE OPTIMIZATION
   ========================================================================== */

/* TABLET (Dưới 1200px) */
@media (max-width: 1200px) {
    .lc-shop-layout {
        flex-direction: column !important;
        gap: 20px !important;
    }

    .lc-shop-sidebar {
        width: 100% !important;
    }

    .lc-sidebar-section {
        border: 1px solid #dcdcdc !important;
        background-color: #ffffff !important;
        padding: 12px 16px !important;
        border-radius: 4px !important;
    }

    .lc-sidebar-header-toggle {
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .lc-sidebar-chevron {
        display: inline-flex !important;
    }

    .lc-sidebar-collapse-body {
        display: none;
        margin-top: 14px;
    }

    .lc-sidebar-section.is-open .lc-sidebar-collapse-body {
        display: block !important;
    }

    .lc-sidebar-section.is-open .lc-sidebar-chevron {
        transform: rotate(180deg) !important;
    }

    .lc-scope .lc-product-grid > *,
    .lc-scope .lc-product-grid--cols-3 > * {
        flex: 0 0 calc(33.333% - 20px) !important;
        max-width: calc(33.333% - 20px) !important;
        width: calc(33.333% - 20px) !important;
    }
}

/* MOBILE (Dưới 767px) */
@media (max-width: 767px) {
    .lc-shop-breadcrumb-row {
        padding-top: 20px !important;
        padding-bottom: 5px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .lc-shop-main {
        padding-top: 10px !important;
        padding-bottom: 40px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .lc-shop-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .lc-shop-title {
        font-size: 22px !important;
    }

    .lc-shop-toolbar {
        width: 100% !important;
    }

    .lc-shop-toolbar select,
    .lc-shop-toolbar .woocommerce-ordering,
    .lc-shop-toolbar .woocommerce-ordering select,
    .lc-scope select.custom-select {
        width: 100% !important;
    }

    .lc-scope .lc-product-grid,
    .lc-scope .lc-product-grid--cols-3 {
        margin-left: -6px !important;
        margin-right: -6px !important;
        width: calc(100% + 12px) !important;
    }

    .lc-scope .lc-product-grid > *,
    .lc-scope .lc-product-grid--cols-3 > * {
        flex: 0 0 calc(50% - 12px) !important;
        max-width: calc(50% - 12px) !important;
        width: calc(50% - 12px) !important;
        margin-left: 6px !important;
        margin-right: 6px !important;
        margin-bottom: 16px !important;
    }

    .lc-pagination {
        margin-top: 25px;
    }
}