/**
 * ESP Category Page Styles
 *
 * 1:1 copy of crone/PaulB styling patterns
 * Matches the Hyva/Magento Page Builder layout structure
 */

/* ==========================================================================
   CRONE UTILITY CLASSES
   These mirror the cmsp66-* prefixed Tailwind-like classes from crone
   ========================================================================== */

/* Positioning */
.crone-relative {
    position: relative;
}

.crone-left-1\/2 {
    left: 50%;
}

.crone-right-1\/2 {
    right: 50%;
}

.crone-mx-\[-50vw\] {
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Spacing */
.crone-my-6 {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.crone--mt-8 {
    margin-top: -2rem;
}

.crone-mb-6 {
    margin-bottom: 1.5rem;
}

.crone-pb-2 {
    padding-bottom: 0.5rem;
}

.crone-pb-4 {
    padding-bottom: 1rem;
}

/* Flexbox */
.crone-flex {
    display: flex;
}

.crone-flex-col {
    flex-direction: column;
}

.crone-flex-wrap {
    flex-wrap: wrap;
}

.crone-justify-center {
    justify-content: center;
}

/* Sizing */
.crone-w-full {
    width: 100%;
}

.crone-w-screen {
    width: 100vw;
}

/* Typography */
.crone-text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.crone-text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.crone-text-6xl {
    font-size: 3.75rem;
    line-height: 1;
}

.crone-font-bold {
    font-weight: 700;
}

.crone-uppercase {
    text-transform: uppercase;
}

.crone-text-white {
    --tw-text-opacity: 1;
    color: rgb(255 255 255 / var(--tw-text-opacity));
}

.crone-underline {
    text-decoration-line: underline;
}

/* Responsive */
@media (min-width: 768px) {
    .md\:crone-flex-row {
        flex-direction: row;
    }
}

@media (min-width: 1024px) {
    .lg\:crone-mt-8 {
        margin-top: 2rem;
    }
}

/* ==========================================================================
   PAGE BUILDER STRUCTURE CLASSES
   Matching the Magento Page Builder HTML structure from crone
   ========================================================================== */

/* Main content area */
.page-main {
    overflow: hidden;
}

.page-main .columns {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-main .column.main {
    width: 100%;
}

/* Page Builder Column Group - the row container */
.pagebuilder-column-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

/* Page Builder Column Line - flex container for columns */
.pagebuilder-column-line {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
}

/* Page Builder Column - individual column */
.pagebuilder-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-position: right top;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

/* Item columns in the grid (6-column layout) */
.crone-item-col {
    text-align: center;
    width: calc(16.6667% - 16px);
    margin-left: 8px;
    margin-right: 8px;
    margin-bottom: 20px;
    align-self: stretch;
}

/* Banner wrapper */
.pagebuilder-banner-wrapper {
    min-height: 452px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagebuilder-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagebuilder-poster-content {
    text-align: center;
    padding: 2rem;
}

/* Banner border style (optional) */
.banner-border {
    /* Can add border styling if needed */
}

/* Row inner container */
.crone-row-inner {
    justify-content: flex-start;
    display: flex;
    flex-direction: column;
    background-position: left top;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: scroll;
    padding: 0 1rem;
}

/* ==========================================================================
   PAGE TITLE & TEXT STYLES
   ========================================================================== */

/* Page title - matching crone's title styling */
.page-title.title-font {
    font-family: inherit;
    color: var(--esp-primary, #374151);
    margin: 0;
    padding: 0;
}

.text-primary {
    color: var(--esp-primary, #374151);
}

/* ==========================================================================
   IMAGE GRID ITEMS
   ========================================================================== */

/* Image figures */
.pagebuilder-column figure {
    margin: 0;
    padding: 0;
}

.pagebuilder-column figure img {
    max-width: 100%;
    height: auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pagebuilder-column figure a:hover img {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Mobile-only images hidden on desktop, vice versa */
.pagebuilder-mobile-only {
    display: none;
}

.pagebuilder-mobile-hidden {
    display: block;
}

@media (max-width: 767px) {
    .pagebuilder-mobile-only {
        display: block;
    }
    .pagebuilder-mobile-hidden {
        display: none;
    }
}

/* ==========================================================================
   BACKGROUND CONTAINER STYLES
   ========================================================================== */

.bg-container-darker {
    background-color: #f3f4f6;
    padding: 2rem 0;
}

.row-full-width-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================================================
   TEXT LIST SECTION (Bottom brand list from crone)
   ========================================================================== */

.crone-text-list {
    display: flex;
    flex-wrap: wrap;
    padding: 2rem 0;
}

.crone-text-list-spacer {
    width: 8.3333%;
}

.crone-text-list-col {
    width: 25%;
    padding-left: 20px;
}

.crone-text-list-col p {
    margin: 0 0 0.25rem 0;
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

/* Tablet breakpoint */
@media (max-width: 1024px) {
    .crone-item-col {
        width: calc(25% - 16px); /* 4 columns on tablet */
    }

    .crone-text-list-spacer {
        display: none;
    }

    .crone-text-list-col {
        width: 33.333%;
        padding-left: 10px;
    }
}

/* Mobile breakpoint */
@media (max-width: 767px) {
    .crone-item-col {
        width: calc(50% - 16px); /* 2 columns on mobile */
    }

    .crone-text-6xl {
        font-size: 2.5rem;
    }

    .crone-text-3xl {
        font-size: 1.5rem;
    }

    .pagebuilder-banner-wrapper {
        min-height: 250px;
    }

    .crone-text-list-col {
        width: 100%;
        padding-left: 0;
        padding-bottom: 1rem;
    }

    .crone-text-list-col p span {
        font-size: 20px !important;
    }

    /* Full-width sections need margin adjustment on mobile */
    .crone-mx-\[-50vw\] {
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .crone-w-screen {
        width: calc(100% + 2rem);
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .crone-item-col {
        width: calc(100% - 16px); /* 1 column on small mobile */
    }
}

/* ==========================================================================
   MESSAGE STYLES
   ========================================================================== */

.page.messages .message {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page.messages .message.success {
    background-color: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

.page.messages .message.error {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.page.messages .message.warning {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.page.messages .message.info {
    background-color: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

/* ==========================================================================
   BREADCRUMB NAVIGATION
   ========================================================================== */

.esp-breadcrumb {
    background-color: var(--esp-bg-alt, #f9fafb);
    padding: 0.75rem 0;
}

.esp-breadcrumb__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    color: var(--esp-text-light);
}

.esp-breadcrumb__item {
    display: flex;
    align-items: center;
}

.esp-breadcrumb__item a {
    color: var(--esp-text-light, #6b7280);
    text-decoration: none;
    transition: color 0.15s ease;
}

.esp-breadcrumb__item a:hover {
    color: var(--esp-primary, #d97706);
    text-decoration: underline;
}

.esp-breadcrumb__sep {
    padding: 0 0.5rem;
    color: var(--esp-text-light, #6b7280);
}

.esp-breadcrumb__item--current {
    color: var(--esp-text);
    font-weight: var(--esp-font-medium);    /* 500 */
}

.esp-breadcrumb__item--current span:not(.esp-breadcrumb__sep) {
    color: var(--esp-text, #374151);
}

/* ==========================================================================
   DYNAMIC CATEGORY PAGE STYLES
   WooCommerce product category archive styling
   ========================================================================== */

/* Category Header */
.esp-category-header {
    padding: 2rem 0 1rem;
    border-bottom: none;
    margin-bottom: 1.5rem;
}

.esp-category-title {
    font-family: var(--esp-font-heading);
    font-size: var(--esp-text-4xl);         /* 2.25rem / 36px - slightly smaller */
    font-weight: var(--esp-font-bold);      /* 700 */
    font-style: normal;
    color: var(--esp-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: var(--esp-tracking-wide); /* 0.025em */
    text-decoration: none;
    line-height: var(--esp-leading-tight);  /* 1.25 */
}

.esp-category-description {
    font-size: var(--esp-text-base);        /* 1rem / 16px */
    color: var(--esp-text);
    line-height: var(--esp-leading-relaxed); /* 1.625 */
    max-width: 800px;
}

.esp-category-description p {
    margin: 0 0 0.5rem 0;
}

/* ==========================================================================
   CATEGORY CARDS GRID (Subcategories)
   ========================================================================== */

.esp-categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    padding-bottom: 3rem;
}

.esp-category-card {
    background: #fff;
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.esp-category-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.esp-category-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1rem;
    text-align: center;
}

.esp-category-card__image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.esp-category-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.esp-category-card:hover .esp-category-card__image img {
    transform: scale(1.05);
}

.esp-category-card__title {
    font-size: var(--esp-text-base);        /* 1rem / 16px */
    font-weight: var(--esp-font-normal);    /* 400 */
    color: var(--esp-text);
    margin: 0 0 0.25rem 0;
    line-height: var(--esp-leading-snug);   /* 1.375 */
}

.esp-category-card__count {
    font-size: var(--esp-text-xs);          /* 0.75rem / 12px */
    color: var(--esp-text-light);
}

/* ==========================================================================
   PRODUCT CARDS GRID
   ========================================================================== */

.esp-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding-bottom: 3rem;
}

.esp-product-card {
    background: #fff;
    border: 1px solid var(--esp-border, #e5e7eb);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.esp-product-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.esp-product-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1rem;
}

.esp-product-card__image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: #f9fafb;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.esp-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.esp-product-card:hover .esp-product-card__image img {
    transform: scale(1.05);
}

.esp-product-card__title {
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    font-weight: var(--esp-font-medium);    /* 500 */
    color: var(--esp-text);
    margin: 0 0 0.5rem 0;
    line-height: var(--esp-leading-normal); /* 1.5 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.esp-product-card__price {
    font-size: var(--esp-text-base);        /* 1rem / 16px */
    font-weight: var(--esp-font-bold);      /* 700 */
    color: var(--esp-primary);
}

.esp-product-card__price del {
    color: var(--esp-text-light);
    font-weight: var(--esp-font-normal);    /* 400 */
    margin-right: 0.5rem;
}

.esp-product-card__price ins {
    text-decoration: none;
}

.esp-no-products {
    padding: 3rem;
    text-align: center;
    color: var(--esp-text-light, #6b7280);
    font-size: 1.1rem;
}

/* ==========================================================================
   RESPONSIVE CATEGORY/PRODUCT GRIDS
   ========================================================================== */

@media (max-width: 1200px) {
    .esp-categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .esp-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .esp-categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .esp-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .esp-category-title {
        font-size: var(--esp-text-3xl);     /* 1.875rem / 30px */
    }

    .esp-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .esp-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .esp-categories-grid {
        grid-template-columns: 1fr;
    }

    .esp-products-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   FILTER SIDEBAR LAYOUT
   Two-column layout with sidebar for leaf category pages
   ========================================================================== */

.esp-category-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.esp-filter-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
}

.esp-category-main {
    flex: 1;
    min-width: 0;
}

/* ==========================================================================
   FILTER PANEL
   ========================================================================== */

.esp-filter-panel {
    background: #fff;
    border: 1px solid var(--esp-border, #e5e7eb);
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

.esp-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--esp-border, #e5e7eb);
    background: var(--esp-bg-alt, #f9fafb);
}

.esp-filter-title {
    font-size: var(--esp-text-lg);          /* 1.125rem / 18px */
    font-weight: var(--esp-font-bold);      /* 700 */
    color: var(--esp-text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: var(--esp-tracking-wide); /* 0.025em */
}

.esp-filter-clear {
    font-size: 0.8rem;
    color: var(--esp-primary, #d97706);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease;
}

.esp-filter-clear:hover {
    background-color: rgba(217, 119, 6, 0.1);
    text-decoration: underline;
}

/* ==========================================================================
   FILTER LOADING OVERLAY
   ========================================================================== */

.esp-filter-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.esp-filter-spinner {
    width: 32px;
    height: 32px;
    color: var(--esp-primary, #d97706);
    animation: esp-spin 1s linear infinite;
}

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

/* ==========================================================================
   FILTER GROUPS (Collapsible Sections)
   ========================================================================== */

.esp-filter-group {
    border-bottom: 1px solid var(--esp-border, #e5e7eb);
}

.esp-filter-group:last-child {
    border-bottom: none;
}

.esp-filter-group__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    font-weight: var(--esp-font-semibold);  /* 600 */
    color: var(--esp-text);
    text-align: left;
    transition: background-color 0.15s ease;
}

.esp-filter-group__header:hover {
    background-color: var(--esp-bg-alt, #f9fafb);
}

.esp-filter-group__header span {
    flex: 1;
}

.esp-filter-chevron {
    width: 18px;
    height: 18px;
    color: var(--esp-text-light, #6b7280);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.esp-filter-chevron--open {
    transform: rotate(180deg);
}

.esp-filter-group__content {
    padding: 0 1.25rem 1rem;
}

/* ==========================================================================
   FILTER ITEMS (Checkbox List)
   ========================================================================== */

.esp-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
}

.esp-filter-list::-webkit-scrollbar {
    width: 6px;
}

.esp-filter-list::-webkit-scrollbar-track {
    background: var(--esp-bg-alt, #f9fafb);
    border-radius: 3px;
}

.esp-filter-list::-webkit-scrollbar-thumb {
    background: var(--esp-border, #e5e7eb);
    border-radius: 3px;
}

.esp-filter-list::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

.esp-filter-list li {
    margin-bottom: 0.25rem;
}

.esp-filter-list li:last-child {
    margin-bottom: 0;
}

.esp-filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    cursor: pointer;
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    color: var(--esp-text);
    transition: color 0.15s ease;
}

.esp-filter-item:hover {
    color: var(--esp-primary, #d97706);
}

.esp-filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--esp-primary, #d97706);
    flex-shrink: 0;
}

.esp-filter-item__label {
    flex: 1;
    line-height: 1.3;
}

.esp-filter-item__count {
    color: var(--esp-text-light, #6b7280);
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ==========================================================================
   PRICE FILTER
   ========================================================================== */

.esp-price-filter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.esp-price-filter__inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.esp-price-filter__field {
    flex: 1;
}

.esp-price-filter__field label {
    display: block;
    font-size: 0.75rem;
    color: var(--esp-text-light, #6b7280);
    margin-bottom: 0.25rem;
}

.esp-price-filter__field input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--esp-border, #e5e7eb);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--esp-text, #374151);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.esp-price-filter__field input:focus {
    outline: none;
    border-color: var(--esp-primary, #d97706);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.esp-price-filter__sep {
    color: var(--esp-text-light, #6b7280);
    padding-top: 1.25rem;
}

.esp-price-filter__range {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--esp-text-light, #6b7280);
}

.esp-price-filter__apply {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    background-color: var(--esp-primary);
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    font-weight: var(--esp-font-semibold);  /* 600 */
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.esp-price-filter__apply:hover {
    background-color: var(--esp-primary-dark, #b45309);
}

/* ==========================================================================
   FILTER BAR (Product Count / Active Filters)
   ========================================================================== */

.esp-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--esp-border, #e5e7eb);
}

.esp-filter-product-count {
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    font-weight: var(--esp-font-medium);    /* 500 */
    color: var(--esp-text);
}

.esp-filter-active-count {
    font-size: 0.85rem;
    color: var(--esp-primary, #d97706);
}

/* ==========================================================================
   RESPONSIVE FILTER SIDEBAR
   Mobile: Stack sidebar above products
   ========================================================================== */

@media (max-width: 992px) {
    .esp-category-layout {
        flex-direction: column;
        gap: 1.5rem;
    }

    .esp-filter-sidebar {
        width: 100%;
        position: static;
    }

    .esp-filter-panel {
        max-width: none;
    }

    /* Adjust products grid in sidebar layout context */
    .esp-category-main .esp-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .esp-category-main .esp-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .esp-filter-header {
        padding: 0.875rem 1rem;
    }

    .esp-filter-group__header {
        padding: 0.75rem 1rem;
    }

    .esp-filter-group__content {
        padding: 0 1rem 0.875rem;
    }
}

@media (max-width: 480px) {
    .esp-category-main .esp-products-grid {
        grid-template-columns: 1fr;
    }

    .esp-filter-list {
        max-height: 200px;
    }
}

/* ==========================================================================
   MOBILE FILTER DRAWER
   Slide-from-left filter panel for mobile viewports (< 992px)
   ========================================================================== */

/* Hide inline sidebar on mobile, show filter button instead */
@media (max-width: 991px) {
    .esp-filter-sidebar {
        display: none;
    }
}

/* Mobile Filter Button - visible only on mobile */
.esp-mobile-filter-btn {
    display: none; /* Hidden on desktop */
}

@media (max-width: 991px) {
    .esp-mobile-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        background: #fff;
        border: 1px solid var(--esp-border, #e5e7eb);
        border-radius: 0.375rem;
        font-size: var(--esp-text-sm);
        font-weight: var(--esp-font-medium);
        color: var(--esp-text);
        cursor: pointer;
        transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .esp-mobile-filter-btn:hover {
        border-color: var(--esp-primary, #d97706);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .esp-mobile-filter-btn svg {
        width: 18px;
        height: 18px;
        color: var(--esp-text-light, #6b7280);
    }

    .esp-mobile-filter-btn__badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.25rem;
        height: 1.25rem;
        padding: 0 0.375rem;
        background: var(--esp-primary, #d97706);
        color: #fff;
        font-size: 0.75rem;
        font-weight: var(--esp-font-bold);
        border-radius: 9999px;
    }

    /* Filter bar layout adjustment */
    .esp-filter-bar {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* ==========================================================================
   FILTER DRAWER CONTAINER
   ========================================================================== */

.esp-filter-drawer {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
    display: none;
}

.esp-filter-drawer[x-cloak] {
    display: none !important;
}

.esp-filter-drawer--open {
    pointer-events: auto;
    display: block;
}

/* WordPress Admin Bar offset */
.admin-bar .esp-filter-drawer {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .esp-filter-drawer {
        top: 46px;
    }
}

/* ==========================================================================
   FILTER DRAWER BACKDROP
   ========================================================================== */

.esp-filter-drawer__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 300ms ease;
}

.esp-filter-drawer--open .esp-filter-drawer__backdrop {
    opacity: 1;
}

/* ==========================================================================
   FILTER DRAWER PANEL
   ========================================================================== */

.esp-filter-drawer__panel {
    position: absolute;
    top: 0;
    left: 0;  /* Slides from LEFT (opposite of cart drawer) */
    bottom: 0;
    width: 100%;
    max-width: 320px;
    background-color: #fff;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);  /* Start off-screen to the left */
    transition: transform 300ms ease-out;
}

.esp-filter-drawer--open .esp-filter-drawer__panel {
    transform: translateX(0);
}

/* ==========================================================================
   FILTER DRAWER HEADER
   ========================================================================== */

.esp-filter-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--esp-border, #e5e7eb);
    background-color: var(--esp-bg-alt, #f9fafb);
    flex-shrink: 0;
}

.esp-filter-drawer__title {
    font-size: 1.125rem;
    font-weight: var(--esp-font-bold);
    color: var(--esp-text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: var(--esp-tracking-wide);
}

.esp-filter-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 9999px;
    color: var(--esp-text-light, #6b7280);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.esp-filter-drawer__close:hover {
    background-color: #e5e7eb;
    color: var(--esp-text);
}

.esp-filter-drawer__close svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ==========================================================================
   FILTER DRAWER CONTENT
   ========================================================================== */

.esp-filter-drawer__content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    background-color: #fff;
}

/* Custom scrollbar for filter drawer */
.esp-filter-drawer__content::-webkit-scrollbar {
    width: 6px;
}

.esp-filter-drawer__content::-webkit-scrollbar-track {
    background: var(--esp-bg-alt, #f9fafb);
}

.esp-filter-drawer__content::-webkit-scrollbar-thumb {
    background: var(--esp-border, #e5e7eb);
    border-radius: 3px;
}

.esp-filter-drawer__content::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* Loading overlay in drawer */
.esp-filter-drawer__loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ==========================================================================
   FILTER DRAWER FOOTER
   ========================================================================== */

.esp-filter-drawer__footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--esp-border, #e5e7eb);
    background-color: #fff;
    flex-shrink: 0;
}

.esp-filter-drawer__footer-actions {
    display: flex;
    gap: 0.75rem;
}

.esp-filter-drawer__clear-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--esp-border, #e5e7eb);
    border-radius: 0.375rem;
    font-size: var(--esp-text-sm);
    font-weight: var(--esp-font-medium);
    color: var(--esp-text-light, #6b7280);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.esp-filter-drawer__clear-btn:hover {
    border-color: var(--esp-text-light, #6b7280);
    color: var(--esp-text);
}

.esp-filter-drawer__view-btn {
    flex: 2;
    padding: 0.75rem 1rem;
    background: var(--esp-primary, #d97706);
    border: none;
    border-radius: 0.375rem;
    font-size: var(--esp-text-sm);
    font-weight: var(--esp-font-semibold);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.esp-filter-drawer__view-btn:hover {
    background: var(--esp-primary-dark, #b45309);
}

/* ==========================================================================
   BODY SCROLL LOCK (Filter Drawer)
   ========================================================================== */

body.esp-filter-drawer-open {
    overflow: hidden;
}

/* ==========================================================================
   MOBILE PRODUCT GRID - Single Column at 768px
   ========================================================================== */

@media (max-width: 768px) {
    .esp-category-main .esp-products-grid {
        grid-template-columns: 1fr;  /* Single column on mobile/tablet */
        gap: 1rem;
    }
}
