/* ==========================================================================
   AMY PREMIUM PRODUCT LISTING PAGE STYLES
   ========================================================================== */

:root {
    --amy-font: 'Manrope', sans-serif;
    --amy-black: #111111;
    --amy-gray-dark: #444444;
    --amy-gray-light: #999999;
    --amy-border: #EBEBEB;
    --amy-bg-light: #F8F9FA;
    --amy-red-accent: #d1121d;
    --amy-white: #FFFFFF;
}

/* 1. Category Banner */


@media (max-width: 991px) {
    .premium-banner {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .premium-banner-left {
        padding: 40px 20px;
        text-align: center;
        align-items: center;
    }

    .premium-banner-right {
        height: 250px;
        min-height: auto;
    }
}

/* 2. Breadcrumbs Bar & Filters Row */
.premium-breadcrumbs-bar {
    padding: 16px 0;
}

.breadcrumbs-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.breadcrumbs-left {
    /* display: flex;
    align-items: center; */
    gap: 10px;
    font-size: 14px;
}

.breadcrumbs-left a.home-icon {
    display: inline-flex;
    align-items: center;
    color: var(--amy-black);
    transition: opacity 0.2s;
}

.breadcrumbs-left a.home-icon:hover {
    opacity: 0.7;
}

.breadcrumbs-left .sep {
    color: var(--amy-gray-light);
}

.breadcrumbs-left .current {
    color: var(--amy-gray-dark);
    font-weight: 500;
}

.breadcrumbs-right {
    display: flex;
    gap: 12px;
}

.select-wrapper {
    position: relative;
}

.custom-select-ui {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--amy-white);
    border: 1px solid var(--amy-border);
    border-radius: 8px;
    padding: 8px 36px 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--amy-black);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--amy-font);
}

.custom-select-ui:hover {
    border-color: var(--amy-black);
}

.select-wrapper::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23111111' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

@media (max-width: 480px) {
    .breadcrumbs-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    .breadcrumbs-right {
        width: 100%;
        justify-content: space-between;
    }

    .select-wrapper {
        flex: 1;
    }

    .custom-select-ui {
        width: 100%;
    }
}

/* 3. Product Listing Grid Layout */
.product-list {
    padding: 0 0 50px 0;
}

/* 4. Sidebar Styles */
.sidebar-product {
    position: sticky;
    top: 100px;
}

.close-sidebar {
    display: none;
}

.sidebar-title-heading {
    font-size: 15px;
    font-weight: 800;
    color: var(--amy-black);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-box {
    background: var(--amy-white);
    border: 1px solid var(--amy-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

/* Category List inside Sidebar */
.sidebar-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-category-list li {
    border-bottom: 1px solid #F6F6F6;
}

.sidebar-category-list li:last-child {
    border-bottom: none;
}

.sidebar-category-list li a {
    display: flex;
    align-items: center;
    padding: 14px 0;
    background: transparent;
    color: var(--amy-gray-dark);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sidebar-category-list li a:hover,
.sidebar-category-list li a.active {
    color: var(--amy-red-accent);
}

.sidebar-category-list li a .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #8E8E93;
    transition: color 0.25s ease;
}

.sidebar-category-list li a:hover .icon,
.sidebar-category-list li a.active .icon {
    color: var(--amy-red-accent);
}

.sidebar-category-list li a .text {
    flex: 1;
    font-weight: 500;
    font-size: 14.5px;
}

.sidebar-category-list li a .chevron {
    display: inline-flex;
    align-items: center;
    color: #8E8E93;
    opacity: 0.6;
    transition: all 0.25s ease;
}

.sidebar-category-list li a:hover .chevron,
.sidebar-category-list li a.active .chevron {
    opacity: 1;
    color: var(--amy-red-accent);
    transform: translateX(4px);
}

/* Filter Group styling inside sidebar */
.filter-group-inner {
    margin-bottom: 25px;
}

.filter-sub-heading {
    font-size: 12px;
    font-weight: 800;
    color: var(--amy-black);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 0 12px 0;
}

/* Range Slider Styles */
.range-slider-wrapper {
    padding: 0 4px;
}

.range-slider-container {
    position: relative;
    width: 100%;
    height: 5px;
    margin: 20px 0 12px;
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #E5E5E5;
    border-radius: 3px;
    z-index: 1;
}

.range-slider-container input[type="range"] {
    position: absolute;
    width: 100%;
    height: 100%;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    z-index: 2;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
}

.range-slider-container input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--amy-black);
    cursor: pointer;
    pointer-events: auto;
    -webkit-appearance: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    border: 2px solid var(--amy-white);
    transition: transform 0.1s ease;
}

.range-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-slider-container input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--amy-black);
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid var(--amy-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.1s ease;
}

.range-slider-container input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--amy-gray-dark);
    font-weight: 600;
}

/* Color Circle Filters */
.color-options-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.color-dot-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    padding: 0;
}

.color-dot-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    border-radius: 50%;
    background: var(--color-bg);
    transition: all 0.2s ease;
}

.color-dot-btn::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid transparent;
    border-radius: 50%;
    transition: all 0.25s ease;
}

.color-dot-btn:hover::after,
.color-dot-btn.active::after {
    border-color: var(--amy-black);
}

/* Reset All Filters Button */
.btn-reset-all-filters {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--amy-border);
    background: var(--amy-white);
    color: var(--amy-gray-dark);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 10px;
}

.btn-reset-all-filters:hover {
    background: var(--amy-bg-light);
    color: var(--amy-black);
    border-color: var(--amy-gray-light);
}

/* Hide original inputs visually but keep functional */
.hidden-filter-inputs {
    display: none !important;
}

/* 5. Main Content Area */
/* Category Tab Pills */
.category-tabs-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.category-tab-pill {
    padding: 6px 14px;
    border: 1px solid var(--amy-border);
    background: var(--amy-white);
    color: var(--amy-gray-dark);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.25s ease;
    outline: none;
}

.category-tab-pill:hover,
.category-tab-pill.active {
    background: var(--amy-black);
    color: var(--amy-white);
    border-color: var(--amy-black);
}

/* 6. Product Cards Grid styling */
.product-block {
    position: relative;
}

.product-block>.row {
    row-gap: 24px;
}

.product-card {
    background: var(--amy-white);
    border: 1px solid var(--amy-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.05);
}

.card-img-wrap {
    position: relative;
    padding-bottom: 100%;
    /* background: var(--amy-bg-light); */
    overflow: hidden;
}

.card-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .card-img-wrap img {
    transform: scale(1.06);
}

.badge-new {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--amy-black);
    color: var(--amy-white);
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.1em;
    z-index: 2;
}

.badge-sale {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--amy-red-accent);
    color: var(--amy-white);
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.1em;
    z-index: 2;
}

.badge-soldout {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--amy-gray-light);
    color: var(--amy-white);
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.1em;
    z-index: 2;
}

/* Soldout Overlay */
.product-card.soldout .card-img-wrap::after {
    content: "TẠM HẾT HÀNG";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    color: var(--amy-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    z-index: 1;
}

.product-card.soldout .card-img-wrap img {
    filter: grayscale(1);
    opacity: 0.6;
}

.product-card.soldout .btn-add-cart {
    background: var(--amy-bg-light);
    color: var(--amy-gray-light);
    border-color: var(--amy-border);
    cursor: not-allowed;
    pointer-events: none;
}

.card-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-sku {
    font-size: 11px;
    color: var(--amy-gray-light);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px;
}

.card-title a {
    color: var(--amy-black);
    text-decoration: none;
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--amy-black);
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 10px;
    flex-wrap: wrap;
}

.card-price-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.card-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--amy-black);
    line-height: 1.2;
}

.card-price-old {
    font-size: 12px;
    font-weight: 500;
    color: var(--amy-gray-light);
    text-decoration: line-through;
    margin-top: 2px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-wishlist,
.btn-add-cart {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid var(--amy-border);
    background: var(--amy-white);
    color: var(--amy-gray-dark);
    padding: 0;
    outline: none;
}

.btn-wishlist svg,
.btn-add-cart svg {
    width: 16px;
    height: 16px;
}

.btn-wishlist:hover {
    border-color: #FF2D55;
    background: var(--amy-white);
    color: #FF2D55;
}

.btn-wishlist.active {
    border-color: #FF2D55;
    background: #FF2D55;
    color: var(--amy-white);
}

.btn-add-cart:hover {
    background: var(--amy-black);
    color: var(--amy-white);
    border-color: var(--amy-black);
}

/* 7. Pagination Styling (Moved to global style.css) */

/* Mobile Toggle Filter Button */
.btn-toggle-filter {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--amy-white);
    border: 1px solid var(--amy-border);
    padding: 6px 13px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    /* width: 100%; */
    justify-content: center;
    /* margin-bottom: 20px; */
    font-size: 15px;
    color: var(--amy-black);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.25s ease;
}

.btn-toggle-filter:hover {
    background: var(--amy-bg-light);
}

@media (max-width: 991px) {
    .btn-toggle-filter {
        display: flex;
    }

    .sidebar-product {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: var(--amy-white);
        z-index: 9999;
        overflow-y: auto;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        transform: translateX(-100%);
        padding: 24px 20px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
        display: block !important;
    }

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

    .sidebar-box {
        border: none;
        border-radius: 0;
        padding: 0;
        margin-bottom: 30px;
        box-shadow: none;
        background: transparent;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .close-sidebar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--amy-border);
    }

    .close-sidebar span {
        font-size: 16px;
        font-weight: 800;
        text-transform: uppercase;
        color: var(--amy-black);
        letter-spacing: 0.03em;
    }

    .close-sidebar button {
        background: none;
        border: none;
        font-size: 28px;
        cursor: pointer;
        color: var(--amy-gray-dark);
        line-height: 1;
        transition: color 0.2s;
    }

    .close-sidebar button:hover {
        color: var(--amy-red-accent);
    }
}

/* ==========================================================================
   ADDED SUBMENU ACCORDION & AJAX FILTER LOADING STYLES
   ========================================================================== */

#result-filter-product {
    position: relative;
    transition: all 0.3s ease;
}

#result-filter-product.is-loading {
    pointer-events: none;
}

#result-filter-product.is-loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    z-index: 10;
    backdrop-filter: blur(4px);
    border-radius: 8px;
    transition: all 0.3s ease;
}

#result-filter-product.is-loading::after {
    content: "";
    position: absolute;
    top: 100px;
    /* Fixed distance from top since container can be long */
    left: 50%;
    width: 50px;
    height: 50px;
    margin-left: -25px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #d1121d;
    /* Premium red accent */
    border-radius: 50%;
    animation: premium-spin 0.8s linear infinite;
    z-index: 11;
}

@keyframes premium-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Submenu Accordion Styles */
.sidebar-category-list li.has-submenu {
    position: relative;
}

.submenu-list {
    list-style: none;
    padding: 4px 0 16px 40px;
    margin: 0;
    /* display: none; */
    position: relative;
}

/* Vertical tree line connected from the parent category */
.submenu-list::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12px;
    /* Aligns perfectly with the center of the parent category icon */
    bottom: 12px;
    width: 1.5px;
    background: #EBEBEB;
    /* var(--amy-border) */
}

.submenu-list li {
    border-bottom: none !important;
    position: relative;
}

.submenu-list li a.subcategory-link {
    padding: 8px 0;
    font-size: 13.5px;
    font-weight: 500;
    color: #666666;
    display: flex;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

/* Horizontal branch connector line */
.submenu-list li a.subcategory-link::before {
    content: "";
    position: absolute;
    left: -28px;
    /* Extends from the vertical tree line */
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 1.5px;
    background: #EBEBEB;
    transition: all 0.25s ease;
}

/* Active & Hover states for micro-interactions */
.submenu-list li a.subcategory-link:hover,
.submenu-list li a.subcategory-link.active {
    color: var(--amy-red-accent, #d1121d);
    padding-left: 8px;
}

.submenu-list li a.subcategory-link:hover::before,
.submenu-list li a.subcategory-link.active::before {
    background: var(--amy-red-accent, #d1121d);
    width: 22px;
}

.sidebar-category-list li a .chevron {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.sidebar-category-list li.open>a .chevron {
    transform: rotate(90deg);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.sidebar-category-list li.open>a {
    color: var(--amy-red-accent, #d1121d);
    font-weight: 600;
}