:root {
    --pd-primary: #3D2314;     /* Deep rich brown */
    --pd-secondary: #8c5a3b;   /* Warm light brown */
    --pd-bg: #fafafa;
    --pd-text: #111;
    --pd-text-light: #666;
    --pd-border: #e6e6e6;
    --pd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --pd-radius: 4px;
}

body {
    background-color: #fff;
}

/* Breadcrumbs */
.hd-breadcrumb-container {
    padding: 20px 5%;
    font-size: 13px;
    color: var(--pd-text-light);
    border-bottom: 1px solid var(--pd-border);
}

.hd-breadcrumb-container a {
    color: var(--pd-text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.hd-breadcrumb-container a:hover {
    color: var(--pd-primary);
}

.hd-breadcrumb-container i {
    font-size: 10px;
    margin: 0 8px;
    color: #ccc;
}

#bc-current {
    font-weight: 500;
    color: var(--pd-text);
}

/* Main Layout */
.hd-products-layout {
    display: flex;
    width: calc(100% - 10%);
    max-width: 1500px;
    margin: 0 auto 0 5%;
    padding: 32px 0 48px;
    gap: 32px;
    align-items: flex-start;
    box-sizing: border-box;
}

/* Sidebar Filter */
.hd-sidebar-filter {
    flex: 0 0 280px;
    position: sticky;
    top: 40px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding-right: 14px;
    scrollbar-gutter: stable;
}

.hd-sidebar-filter::-webkit-scrollbar {
    width: 6px;
}

.hd-sidebar-filter::-webkit-scrollbar-track {
    background: transparent;
}

.hd-sidebar-filter::-webkit-scrollbar-thumb {
    background: #d9d3ce;
    border-radius: 999px;
}

.hd-sidebar-filter:hover::-webkit-scrollbar-thumb {
    background: #b8aca3;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--pd-primary);
}

.filter-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

.clear-all {
    font-size: 13px;
    color: var(--pd-text-light);
    cursor: pointer;
    text-decoration: underline;
}

.clear-all:hover {
    color: #c92a2a;
}

/* Selected Chips */
.selected-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    background-color: #f5f5f5;
    color: var(--pd-text);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid #eaeaea;
}

.filter-chip i {
    margin-left: 8px;
    font-size: 10px;
    cursor: pointer;
    color: #999;
}

.filter-chip i:hover {
    color: #c92a2a;
}

/* Accordion Groups */
.filter-group {
    border-bottom: 1px solid var(--pd-border);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.filter-group.has-selection,
.filter-group.expanded {
    background-color: rgba(61, 35, 20, 0.015);
}

.filter-group.expanded {
    border-color: rgba(61, 35, 20, 0.18);
}

.filter-group:first-child {
    border-top: 1px solid var(--pd-border);
}

.filter-group-header {
    appearance: none;
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 15px 0;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-align: left;
}

.filter-group-header:hover {
    color: var(--pd-primary);
}

.filter-group-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.filter-group-count {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border: 1px solid var(--pd-border);
    border-radius: 999px;
    color: var(--pd-text-light);
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    text-align: center;
    letter-spacing: 0;
}

.filter-group-count.has-selection {
    color: var(--pd-primary);
    background: rgba(61, 35, 20, 0.06);
    border-color: rgba(61, 35, 20, 0.16);
}

.filter-group-header i {
    font-size: 12px;
    color: var(--pd-text-light);
    transition: transform 0.3s ease;
}

.filter-group-header:hover i,
.filter-group-header:focus-visible i {
    color: var(--pd-primary);
}

.filter-group-header:focus-visible {
    outline: 2px solid rgba(61, 35, 20, 0.22);
    outline-offset: 2px;
    border-radius: 4px;
}

.filter-group.expanded .filter-group-header i {
    transform: rotate(180deg);
}

.filter-options {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: grid-template-rows 0.28s ease, opacity 0.18s ease, visibility 0s linear 0.28s;
}

.filter-group.expanded .filter-options {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: grid-template-rows 0.28s ease, opacity 0.18s ease, visibility 0s;
}

.filter-options-inner {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 15px;
}

.filter-group.expanded .filter-options-inner {
    overflow: visible;
}

/* Custom Checkbox */
.filter-option {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    cursor: pointer;
}

.filter-option input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 2px;
    margin-right: 12px;
    margin-top: 2px;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    transition: all 0.2s;
}

.filter-option input:checked + .checkbox-custom {
    background-color: var(--pd-primary);
    border-color: var(--pd-primary);
}

.filter-option input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-option-label {
    font-size: 14px;
    color: var(--pd-text-light);
    line-height: 1.4;
}

.filter-option:hover .filter-option-label {
    color: var(--pd-text);
}

.filter-option.is-hidden {
    display: none;
}

.filter-group.show-all-options .filter-option.is-hidden {
    display: flex;
}

.filter-show-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px 0 2px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pd-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.filter-show-more:hover {
    text-decoration: underline;
}

.filter-show-more i {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.filter-group.show-all-options .filter-show-more i {
    transform: rotate(180deg);
}

/* Right Product Area */
.hd-products-grid-area {
    flex: 1;
    min-width: 0;
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--pd-border);
    padding-bottom: 15px;
}

.grid-header h1 {
    font-size: 28px;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    margin: 0;
}

.grid-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.product-count {
    font-size: 14px;
    color: var(--pd-text-light);
}

.sort-dropdown select {
    padding: 8px 15px;
    border: 1px solid var(--pd-border);
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    background-color: white;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 38px 28px;
}

.product-card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.product-card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.02;
    overflow: hidden;
    background-color: #f5f5f5;
    margin-bottom: 10px;
}

.product-card-img-wrapper img {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.product-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.35s ease, transform 0.6s ease;
}

.product-card-img-main {
    opacity: 1;
}

.product-card-img-hover {
    opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
    .product-card-img-wrapper.has-hover-image:hover .product-card-img-main {
        opacity: 0;
    }

    .product-card-img-wrapper.has-hover-image:hover .product-card-img-hover {
        opacity: 1;
    }
}

.product-card-ribbon {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    background: #6a4c3b;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    padding: 5px 9px;
    font-weight: 400;
}

.product-card-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.product-card-swatch {
    display: inline-block;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 1px solid #dedbd5;
    background-color: #f2eee8;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    outline: 2px solid transparent;
    outline-offset: 1px;
}

.product-card-swatch[data-swatch-image]:not([data-swatch-loaded="true"]) {
    background-image: none;
}

.product-card-swatch.active,
.product-card-swatch:hover,
.product-card-swatch:focus-visible {
    border-color: #111;
    outline-color: #fff;
    box-shadow: 0 0 0 1px #111;
}

.product-card-more {
    display: inline-block;
    margin-left: 5px;
    color: var(--pd-text);
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.product-card-info {
    text-align: left;
}

.product-card-title {
    font-family: var(--pd-font);
    font-size: 17px;
    line-height: 1.35;
    font-weight: 400;
    margin: 0 0 8px 0;
}

.product-card-title:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.product-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    min-height: 28px;
}

.card-tag {
    background-color: #fff4ea;
    color: #5d4a3d;
    font-size: 13px;
    line-height: 1.2;
    padding: 5px 8px;
    border-radius: 3px;
    font-weight: 400;
}

.product-card-price {
    font-size: 14px;
    color: var(--pd-text-light);
}

.product-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 34px 0 8px;
}

.product-load-more {
    min-width: 168px;
    min-height: 44px;
    border: 1px solid var(--pd-primary);
    background: #fff;
    color: var(--pd-primary);
    border-radius: 4px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.product-load-more:hover,
.product-load-more:focus-visible {
    background: var(--pd-primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(61, 35, 20, 0.12);
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 30px 14px;
    }

    .product-card-title {
        font-size: 15px;
    }

    .card-tag {
        font-size: 12px;
        padding: 4px 7px;
    }

    .product-card-swatches {
        gap: 5px;
    }

    .product-card-swatch {
        width: 20px;
        height: 20px;
    }
}

/* Skeletons */
.filter-skeleton {
    height: 50px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin-bottom: 10px;
    border-radius: 4px;
}

.product-card-skeleton {
    aspect-ratio: 1;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin-bottom: 30px;
}

@keyframes loading {
    to {
        background-position: -200% 0;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--pd-text-light);
}

.empty-state i {
    font-size: 40px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    color: var(--pd-text);
    margin-bottom: 10px;
}

.btn-clear-empty {
    margin-top: 20px;
    padding: 10px 25px;
    background-color: var(--pd-primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-clear-empty:hover {
    background-color: #2a180e;
}

@media (max-width: 900px) {
    .hd-products-layout {
        flex-direction: column;
        width: auto;
        padding: 24px 20px 40px;
        margin: 0;
        max-width: none;
        gap: 28px;
    }

    .hd-sidebar-filter {
        position: static;
        width: 100%;
        flex-basis: auto;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .grid-header {
        align-items: flex-start;
        gap: 16px;
        flex-direction: column;
    }
}

/* ===== P5-00 ????????????????????????? ===== */
#product-grid {
    position: relative;
}

.hd-listing-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
}

.hd-listing-overlay .spinner-border {
    color: #3b2314;
}

.hd-listing-slow-hint {
    display: none;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #6b6b6b;
}

.hd-listing-error-bar {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}
