/**
 * Storefront Page Styles
 * Supplemental styles for Instacart-inspired product browsing
 * Uses Groceria's native utilities: overflow-x-auto, scroll-smooth, scrollbar-hide, product-style v1
 */

/* ==========================================================================
   Product Card Enhancements
   ========================================================================== */

/* Card hover effects */
.product-style.v1 .group:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Outline add-to-cart button hover */
.product-style.v1 .wc-block-components-product-button .wp-element-button:hover {
    background-color: var(--wp--preset--color--primary) !important;
    color: var(--wp--preset--color--white) !important;
}

/* Product title truncation */
.product-style.v1 .wp-block-post-title {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide wishlist controls inside product collection cards only. */
.wp-block-woocommerce-product-collection .yith-add-to-wishlist-button-block,
.wp-block-woocommerce-product-collection .yith-wcwl-add-to-wishlist,
.wp-block-woocommerce-product-collection .yith-wcwl-add-to-wishlist-button,
.wp-block-woocommerce-product-collection .add_to_wishlist {
    display: none !important;
}

/* Keep product cards visually even and pin the CTA row to the card bottom. */
.product-style.v1 .wc-block-product {
    display: flex !important;
    align-items: stretch !important;
}

.product-style.v1 .wc-block-product > .wp-block-group.group {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column;
    width: 100%;
}

.product-style.v1 .wc-block-product > .wp-block-group.group > .wp-block-group:last-child {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
    width: 100%;
    margin-top: auto;
}

.product-style.v1
    .wc-block-product
    > .wp-block-group.group
    > .wp-block-group:last-child
    .wp-block-woocommerce-product-price {
    min-width: 0;
}

.product-style.v1
    .wc-block-product
    > .wp-block-group.group
    > .wp-block-group:last-child
    .wp-block-woocommerce-product-button {
    justify-self: end;
}

/* Weekly Highlight promo card: fit the Radish image cleanly and suppress its white photo backdrop. */
.weekly-highlight-card {
    overflow: hidden;
    isolation: isolate;
}

.weekly-highlight-card > .wp-block-cover__image-background {
    top: 14%;
    left: 30%;
    width: 76%;
    height: 76%;
    transform: none;
    object-fit: contain !important;
    object-position: center center !important;
    mix-blend-mode: multiply;
    filter: saturate(1.08) contrast(1.04);
}

.weekly-highlight-card > .wp-block-cover__inner-container {
    position: relative;
    z-index: 1;
}

/* Just Arrived promo card: render the image 10% smaller. */
.just-arrived-card > .wp-block-cover__image-background {
    transform: scale(0.90);
    transform-origin: center center;
}

.just-arrived-card > .wp-block-cover__inner-container {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Single Product Page
   ========================================================================== */

.single-product {
    --narmada-product-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.single-product__layout,
.single-product__gallery,
.single-product__details,
.single-product__summary,
.single-product__reviews,
.single-product__related {
    min-width: 0;
}

.single-product .wp-block-woocommerce-breadcrumbs,
.single-product .wc-block-breadcrumbs {
    margin-top: var(--wp--preset--spacing--4);
    margin-bottom: var(--wp--preset--spacing--6);
}

.single-product .wp-block-post-title {
    text-wrap: balance;
}

.single-product .wp-block-woocommerce-product-summary {
    max-width: 60ch;
    color: color-mix(in oklab, var(--wp--preset--color--primary) 76%, var(--wp--preset--color--white));
}

.single-product .wp-block-woocommerce-product-price,
.single-product .wc-block-components-product-price,
.single-product .wc-block-components-quantity-selector input,
.single-product .qty {
    font-family: var(--wp--preset--font-family--inter);
}

.single-product__gallery .wc-block-product-gallery-large-image__inner-blocks {
    overflow: hidden;
    border: 1px solid color-mix(in oklab, var(--wp--preset--color--pearl) 88%, var(--wp--preset--color--white));
    border-radius: 1rem;
    background: color-mix(in oklab, var(--wp--preset--color--gray) 78%, var(--wp--preset--color--white));
}

.single-product .wc-block-components-product-stock-indicator--in-stock:not(:empty),
.single-product .wc-block-components-product-stock-indicator--available-on-backorder:not(:empty) {
    display: inline-flex;
    align-items: center;
    gap: var(--wp--preset--spacing--2);
    min-height: 2.75rem;
    margin-bottom: var(--wp--preset--spacing--4) !important;
    padding: 0.625rem var(--wp--preset--spacing--4);
    border: 1px solid color-mix(in oklab, var(--wp--preset--color--secondary) 22%, var(--wp--preset--color--pearl));
    border-radius: 999px;
    background: color-mix(in oklab, var(--wp--preset--color--secondary) 8%, var(--wp--preset--color--white));
    color: var(--wp--preset--color--primary) !important;
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 600;
    line-height: 1.4;
}

.single-product form.wp-block-add-to-cart-with-options,
.single-product form.cart {
    gap: var(--wp--preset--spacing--4);
}

.single-product form.wp-block-add-to-cart-with-options > .wp-block-group,
.single-product .wp-block-add-to-cart-with-options > .wp-block-group,
.single-product form.cart:not(.grouped_form) {
    gap: var(--wp--preset--spacing--3);
}

.single-product .wc-block-components-quantity-selector {
    min-width: 7.5rem;
    min-height: 3rem;
    border-radius: 0.875rem;
    background: var(--wp--preset--color--white);
}

.single-product .wc-block-components-quantity-selector::after {
    border-radius: 0.875rem;
}

.single-product .wc-block-components-quantity-selector__button {
    min-width: 2.75rem;
    min-height: 2.75rem;
    color: var(--wp--preset--color--primary);
    transition: color 0.18s var(--narmada-product-ease);
}

.single-product .wc-block-components-quantity-selector__button:hover {
    color: var(--wp--preset--color--secondary);
}

.single-product .wc-block-components-product-button .wp-block-button__link,
.single-product .single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    transition:
        background-color 0.18s var(--narmada-product-ease),
        border-color 0.18s var(--narmada-product-ease),
        color 0.18s var(--narmada-product-ease),
        transform 0.18s var(--narmada-product-ease);
}

.single-product .wc-block-components-product-button .wp-block-button__link:hover,
.single-product .single_add_to_cart_button:hover {
    transform: translateY(-1px);
}

.single-product .accordion-item__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 3rem;
    gap: var(--wp--preset--spacing--3);
    color: var(--wp--preset--color--primary);
    text-align: left;
    transition: color 0.18s var(--narmada-product-ease);
}

.single-product .accordion-item__toggle:hover {
    color: var(--wp--preset--color--secondary);
}

.single-product .wc-block-add-to-cart-with-options-variation-selector-attribute select {
    min-height: 3rem;
    padding-right: var(--wp--preset--spacing--4);
    padding-left: var(--wp--preset--spacing--4);
    transition:
        border-color 0.18s var(--narmada-product-ease),
        box-shadow 0.18s var(--narmada-product-ease);
}

.single-product .wc-block-add-to-cart-with-options-variation-selector-attribute select:hover {
    border-color: var(--wp--preset--color--primary);
}

.single-product .wc-block-components-product-button .wp-block-button__link:focus-visible,
.single-product .single_add_to_cart_button:focus-visible,
.single-product .wc-block-components-quantity-selector__button:focus-visible,
.single-product .accordion-item__toggle:focus-visible,
.single-product .wc-block-add-to-cart-with-options-variation-selector-attribute select:focus-visible,
.single-product .wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill:focus-within {
    outline: 2px solid var(--wp--preset--color--secondary) !important;
    outline-offset: 3px;
}

.single-product__support-note {
    gap: var(--wp--preset--spacing--1) !important;
    padding: var(--wp--preset--spacing--4) !important;
    border: 1px solid color-mix(in oklab, var(--wp--preset--color--secondary) 16%, var(--wp--preset--color--pearl)) !important;
    border-radius: 0.875rem;
    background: color-mix(in oklab, var(--wp--preset--color--gray) 75%, var(--wp--preset--color--white));
}

.single-product__support-note p {
    margin: 0;
}

.single-product__support-note a {
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.single-product__reviews > .wp-block-group {
    align-items: flex-start;
    gap: var(--wp--preset--spacing--10);
}

.single-product__reviews .product-review {
    min-width: min(100%, 40rem);
    flex: 1 1 0;
}

.single-product__reviews .wp-block-woocommerce-product-review-form {
    border-color: color-mix(in oklab, var(--wp--preset--color--pearl) 88%, var(--wp--preset--color--white)) !important;
    background: color-mix(in oklab, var(--wp--preset--color--gray) 76%, var(--wp--preset--color--white));
    box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04);
}

.single-product__reviews .comment-reply-title {
    font-family: var(--wp--preset--font-family--cardo);
    letter-spacing: -0.01em;
}

.single-product__related .wc-block-product-template {
    gap: var(--wp--preset--spacing--5);
}

.single-product__related .wp-block-post-title a {
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

@media (max-width: 781px) {
    .single-product .wp-block-woocommerce-product-price {
        flex-wrap: wrap;
        gap: var(--wp--preset--spacing--2);
    }

    .single-product form.wp-block-add-to-cart-with-options > .wp-block-group,
    .single-product .wp-block-add-to-cart-with-options > .wp-block-group,
    .single-product form.cart:not(.grouped_form) {
        flex-wrap: wrap !important;
    }

    .single-product .wc-block-components-quantity-selector,
    .single-product .wc-block-components-product-button,
    .single-product .wc-block-components-product-button .wp-block-button__link,
    .single-product .single_add_to_cart_button {
        width: 100%;
    }

    .single-product__reviews .wp-block-columns.is-not-stacked-on-mobile {
        flex-wrap: wrap !important;
        gap: var(--wp--preset--spacing--3);
    }
}

@media (prefers-reduced-motion: reduce) {
    .single-product .wc-block-components-quantity-selector__button,
    .single-product .wc-block-components-product-button .wp-block-button__link,
    .single-product .single_add_to_cart_button,
    .single-product .accordion-item__toggle,
    .single-product .wc-block-add-to-cart-with-options-variation-selector-attribute select {
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Category Archive Layout
   ========================================================================== */

.category-archive {
    --narmada-archive-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.category-archive__header {
    max-width: 58rem;
}

.category-archive__eyebrow a {
    text-decoration: none;
    transition: color 0.18s var(--narmada-archive-ease);
}

.category-archive__eyebrow a:hover {
    color: var(--wp--preset--color--primary);
}

.category-archive__title {
    text-wrap: balance;
}

.category-archive__description {
    max-width: 58ch;
    color: color-mix(in oklab, var(--wp--preset--color--primary) 70%, var(--wp--preset--color--white));
}

.category-archive__body,
.category-archive__content,
.category-archive__sidebar {
    min-width: 0;
}

.category-archive .wc-block-store-notices {
    margin-bottom: var(--wp--preset--spacing--2);
}

.category-archive .wc-block-components-notice-banner {
    border-color: color-mix(in oklab, var(--wp--preset--color--secondary) 18%, var(--wp--preset--color--pearl));
    border-radius: 0.875rem;
    background: color-mix(in oklab, var(--wp--preset--color--secondary) 7%, var(--wp--preset--color--white));
    color: var(--wp--preset--color--primary);
    box-shadow: none;
}

.category-archive .wc-block-components-notice-banner a {
    color: var(--wp--preset--color--primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/* ==========================================================================
   Category Archive Controls
   ========================================================================== */

.category-archive__sorting {
    gap: var(--wp--preset--spacing--3);
    padding-right: var(--wp--preset--spacing--4) !important;
    padding-left: var(--wp--preset--spacing--4) !important;
    border-left: 1px solid var(--wp--preset--color--pearl);
    border-right: 1px solid var(--wp--preset--color--pearl);
    border-radius: 0.875rem;
    background: color-mix(in oklab, var(--wp--preset--color--gray) 70%, var(--wp--preset--color--white));
}

.category-archive .wc-block-product-results-count,
.category-archive .woocommerce-result-count,
.category-archive .wp-block-woocommerce-product-price .wc-block-components-product-price,
.category-archive .wc-block-product-categories-list-item-count {
    font-family: var(--wp--preset--font-family--inter);
}

.category-archive .wc-block-product-results-count p {
    margin: 0;
    color: color-mix(in oklab, var(--wp--preset--color--primary) 78%, var(--wp--preset--color--white));
}

.category-archive .wc-block-catalog-sorting,
.category-archive .woocommerce-ordering {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--wp--preset--spacing--3);
    margin: 0;
}

.category-archive .woocommerce-ordering label {
    margin: 0;
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 600;
    white-space: nowrap;
}

.category-archive .woocommerce-ordering .orderby {
    width: min(100%, 13rem);
    min-height: 2.75rem;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid var(--wp--preset--color--pearl);
    border-radius: 0.75rem;
    background-color: var(--wp--preset--color--white);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--wp--preset--color--primary) 50%),
        linear-gradient(135deg, var(--wp--preset--color--primary) 50%, transparent 50%);
    background-position:
        calc(100% - 1rem) calc(50% - 2px),
        calc(100% - 0.625rem) calc(50% - 2px);
    background-size: 6px 6px;
    background-repeat: no-repeat;
    color: var(--wp--preset--color--primary);
    font: inherit;
    line-height: 1.2;
    appearance: none;
    box-shadow: none;
    transition:
        border-color 0.18s var(--narmada-archive-ease),
        box-shadow 0.18s var(--narmada-archive-ease),
        background-color 0.18s var(--narmada-archive-ease);
}

/* ==========================================================================
   Category Archive Product Grid
   ========================================================================== */

.category-archive__products {
    margin-bottom: 0;
}

.category-archive__products .wc-block-product-template__responsive {
    gap: var(--wp--preset--spacing--5);
}

.category-archive__products .wc-block-product {
    min-width: 0;
}

.category-archive__card {
    transition:
        transform 0.22s var(--narmada-archive-ease),
        border-color 0.22s var(--narmada-archive-ease),
        box-shadow 0.22s var(--narmada-archive-ease);
    box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04);
}

.category-archive__card:hover,
.category-archive__card:focus-within {
    transform: translateY(-2px);
    border-color: color-mix(in oklab, var(--wp--preset--color--secondary) 24%, var(--wp--preset--color--pearl));
    box-shadow:
        0 16px 26px -24px rgba(20, 20, 20, 0.45),
        0 10px 18px -24px rgba(0, 59, 34, 0.5);
}

.category-archive__card-media {
    overflow: hidden;
    padding: 0 !important;
    border: 1px solid color-mix(in oklab, var(--wp--preset--color--pearl) 88%, var(--wp--preset--color--white));
    background: var(--wp--preset--color--white);
}

.category-archive__product-image,
.category-archive__product-image a {
    display: block;
}

.category-archive__product-image {
    margin: 0;
    border-radius: inherit;
}

.category-archive__product-image img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.28s var(--narmada-archive-ease);
}

.category-archive__card:hover .category-archive__product-image img,
.category-archive__card:focus-within .category-archive__product-image img {
    transform: scale(1.03);
}

.category-archive__card-meta {
    align-items: center;
}

.category-archive .wp-block-post-terms {
    min-width: 0;
}

.category-archive .wp-block-post-terms a {
    text-decoration: none;
    transition: color 0.18s var(--narmada-archive-ease);
}

.category-archive .wp-block-post-title a {
    text-decoration-thickness: from-font;
    text-underline-offset: 0.15em;
    transition: color 0.18s var(--narmada-archive-ease);
}

.category-archive .wp-block-post-title a:hover {
    color: var(--wp--preset--color--secondary);
}

.category-archive .wp-block-woocommerce-product-price {
    color: var(--wp--preset--color--secondary);
}

.category-archive .wc-block-components-product-price {
    gap: var(--wp--preset--spacing--2);
}

.category-archive__card-footer {
    gap: var(--wp--preset--spacing--3);
}

.category-archive .wc-block-components-product-button .wp-element-button {
    min-height: 2.75rem;
    transition:
        background-color 0.18s var(--narmada-archive-ease),
        border-color 0.18s var(--narmada-archive-ease),
        color 0.18s var(--narmada-archive-ease),
        transform 0.18s var(--narmada-archive-ease),
        box-shadow 0.18s var(--narmada-archive-ease);
}

.category-archive .wc-block-components-product-button .wp-element-button:active {
    transform: translateY(1px);
}

/* ==========================================================================
   Sidebar Refinements
   ========================================================================== */

.category-archive .filter-content {
    padding: var(--wp--preset--spacing--5) !important;
    border: 1px solid var(--wp--preset--color--pearl);
    border-radius: 1rem;
    background: color-mix(in oklab, var(--wp--preset--color--gray) 55%, var(--wp--preset--color--white));
    box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04);
}

.category-archive .wc-block-product-filters {
    width: 100%;
}

.category-archive .wc-block-product-filter-removable-chips__items {
    gap: var(--wp--preset--spacing--2);
}

.category-archive .wc-block-product-filter-removable-chips__item {
    border: 1px solid var(--wp--preset--color--pearl);
    border-radius: 999px;
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--sm);
}

.category-archive .wc-block-product-filter-removable-chips__remove {
    border-radius: 999px;
    color: var(--wp--preset--color--primary);
    transition: color 0.18s var(--narmada-archive-ease);
}

.category-archive .wc-block-product-filter-removable-chips__remove:hover {
    color: var(--wp--preset--color--secondary);
}

.category-archive .wc-block-product-filter-clear-button .wp-block-button__link {
    min-height: 2.75rem;
    border-color: var(--wp--preset--color--pearl);
    border-radius: 0.75rem;
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--primary);
    box-shadow: none;
    transition:
        background-color 0.18s var(--narmada-archive-ease),
        border-color 0.18s var(--narmada-archive-ease),
        color 0.18s var(--narmada-archive-ease);
}

.category-archive .wc-block-product-filter-clear-button .wp-block-button__link:hover {
    border-color: var(--wp--preset--color--primary);
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

.category-archive .wc-block-product-filter-checkbox-list__items {
    display: grid;
    gap: var(--wp--preset--spacing--3);
}

.category-archive .wc-block-product-filter-checkbox-list__label {
    align-items: flex-start;
    width: 100%;
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--sm);
}

.category-archive .wc-block-product-filter-checkbox-list__input-wrapper {
    margin-top: 0.125rem;
}

.category-archive input[type='checkbox'].wc-block-product-filter-checkbox-list__input {
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--wp--preset--color--pale-gray);
    border-radius: 0.25rem;
    background: var(--wp--preset--color--white);
}

.category-archive input[type='checkbox'].wc-block-product-filter-checkbox-list__input:checked {
    border-color: var(--wp--preset--color--secondary);
    background: var(--wp--preset--color--secondary);
}

.category-archive .wc-block-product-filter-checkbox-list__show-more {
    margin-top: var(--wp--preset--spacing--2);
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 600;
    text-decoration-color: color-mix(in oklab, var(--wp--preset--color--primary) 35%, transparent);
    text-underline-offset: 0.18em;
    transition: color 0.18s var(--narmada-archive-ease);
}

.category-archive .wc-block-product-filter-checkbox-list__show-more:hover {
    color: var(--wp--preset--color--secondary);
}

/* Keep archive category trees compact and readable across parent/child levels. */
.filter-content .wp-block-categories,
.filter-content .wc-block-product-categories-list,
.filter-content .wc-block-product-categories-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--wp--preset--color--charcoal);
}

.filter-content .wp-block-categories li,
.filter-content .wc-block-product-categories-list li {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.5rem;
    margin: 0;
    font-size: 0.813rem;
}

/* Leaf items (no children) — link starts in column 2 to align with toggled siblings */
.filter-content .wp-block-categories li:not(.has-children) > a,
.filter-content .wc-block-product-categories-list li:not(.has-children) > a {
    grid-column: 2;
}

.filter-content .category-tree-toggle {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--wp--preset--color--charcoal);
    border-radius: 999px;
    transition:
        color 0.18s var(--narmada-archive-ease),
        background-color 0.18s var(--narmada-archive-ease),
        transform 0.18s var(--narmada-archive-ease);
}

.filter-content .category-tree-toggle:hover {
    background: color-mix(in oklab, var(--wp--preset--color--secondary) 10%, transparent);
    color: var(--wp--preset--color--secondary);
}

.filter-content .category-tree-toggle svg {
    transition: transform 0.2s ease;
    transform: rotate(-90deg);
}

.filter-content .has-children.is-expanded > .category-tree-toggle svg {
    transform: rotate(0deg);
}

.filter-content .has-children > ul {
    display: none;
}

.filter-content .has-children.is-expanded > ul {
    display: block;
}

.filter-content .wc-block-product-categories-list li.is-current > a,
.filter-content .wp-block-categories li.is-current > a {
    color: var(--wp--preset--color--secondary);
    font-weight: 600;
}

.filter-content .wp-block-categories li + li,
.filter-content .wc-block-product-categories-list li + li {
    margin-top: 0.625rem;
}

.filter-content .wp-block-categories li a,
.filter-content .wc-block-product-categories-list li a {
    min-width: 0;
    color: var(--wp--preset--color--primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.filter-content .wp-block-categories li a:hover,
.filter-content .wc-block-product-categories-list li a:hover,
.filter-content .wp-block-categories .current-cat > a,
.filter-content .wc-block-product-categories-list .wc-block-product-categories-list-item-current > a {
    color: var(--wp--preset--color--secondary);
}

.filter-content .wp-block-categories li > ul,
.filter-content .wc-block-product-categories-list li > ul {
    grid-column: 1 / -1;
    margin-top: 0.125rem;
    padding-left: 0.875rem;
    border-left: 1px solid var(--wp--preset--color--pale-gray);
}

.filter-content .wp-block-categories ul li + li,
.filter-content .wc-block-product-categories-list ul li + li {
    margin-top: 0.375rem;
}

.filter-content .wp-block-categories ul li a,
.filter-content .wc-block-product-categories-list ul li a {
    font-size: 0.813rem;
    font-weight: 400;
}

.filter-content .wc-block-product-categories-list-item-count {
    justify-self: end;
    color: rgba(17, 17, 17, 0.65);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==========================================================================
   Category Archive Pagination & Empty State
   ========================================================================== */

.category-archive__pagination {
    gap: var(--wp--preset--spacing--2);
}

.category-archive .wp-block-query-pagination {
    align-items: center;
    gap: var(--wp--preset--spacing--2);
}

.category-archive .wp-block-query-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding-inline: 0.875rem;
    border: 1px solid var(--wp--preset--color--pearl);
    border-radius: 999px;
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--primary);
    text-decoration: none;
    transition:
        background-color 0.18s var(--narmada-archive-ease),
        border-color 0.18s var(--narmada-archive-ease),
        color 0.18s var(--narmada-archive-ease),
        transform 0.18s var(--narmada-archive-ease);
}

.category-archive .wp-block-query-pagination a:hover {
    border-color: color-mix(in oklab, var(--wp--preset--color--secondary) 35%, var(--wp--preset--color--pearl));
    background: color-mix(in oklab, var(--wp--preset--color--secondary) 8%, var(--wp--preset--color--white));
    color: var(--wp--preset--color--secondary);
}

.category-archive .wp-block-query-pagination a:active {
    transform: translateY(1px);
}

.category-archive .wp-block-query-pagination-numbers {
    gap: 0.375rem;
}

.category-archive .wp-block-query-pagination-numbers .page-numbers {
    width: 2.5rem;
    height: 2.5rem;
}

.category-archive__empty-state {
    max-width: 38rem;
    margin-inline: auto;
    text-align: center;
}

.category-archive__empty-state p {
    margin: 0;
}

.category-archive__empty-state a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

.category-archive__empty-search {
    width: min(100%, 28rem);
}

.category-archive__empty-search .wp-block-search__inside-wrapper {
    border-color: var(--wp--preset--color--pearl);
    border-radius: 0.75rem;
    background: var(--wp--preset--color--white);
}

.category-archive__empty-search .wp-block-search__input {
    min-height: 2.875rem;
}

.category-archive__empty-search .wp-block-search__button {
    min-width: 2.875rem;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

/* Top bar: single line on all screens */
.narmada-top-bar p {
    font-size: clamp(9px, 2.2vw, 14px);
    white-space: nowrap;
}

.category-archive :is(a, button, select, input, .wp-element-button, .category-tree-toggle):focus-visible {
    outline: 2px solid color-mix(in oklab, var(--wp--preset--color--secondary) 70%, var(--wp--preset--color--primary));
    outline-offset: 3px;
}

@media (min-width: 64rem) {
    .category-archive__sidebar {
        position: sticky;
        top: 6.5rem;
    }
}

/* Ensure horizontal scroll works on product collections */
@media (max-width: 1024px) {
    .product-style.v1 .wc-block-product-template {
        flex-wrap: nowrap !important;
    }

    .product-style.v1 .wc-block-product {
        min-width: 200px;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .category-archive__products .wc-block-product-template__responsive {
        gap: var(--wp--preset--spacing--4);
    }

    .product-style.v1 .wc-block-product {
        min-width: 180px;
    }
}

@media (max-width: 600px) {
    .category-archive__sorting {
        flex-wrap: wrap !important;
    }

    .category-archive .wc-block-product-results-count {
        width: 100%;
    }

    .category-archive .wc-block-catalog-sorting,
    .category-archive .woocommerce-ordering {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .category-archive .filter-content {
        padding: 0 !important;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .category-archive .wc-block-product-filters__open-overlay {
        width: 100%;
        min-height: 3rem;
        justify-content: center;
        gap: var(--wp--preset--spacing--2);
        padding: 0.875rem 1rem;
        border: 1px solid var(--wp--preset--color--pearl);
        border-radius: 0.875rem;
        background: color-mix(in oklab, var(--wp--preset--color--gray) 70%, var(--wp--preset--color--white));
        color: var(--wp--preset--color--primary);
        font-weight: 600;
    }

    .category-archive .wc-block-product-filters__overlay-dialog {
        background: var(--wp--preset--color--white);
    }

    .category-archive .wc-block-product-filters__overlay-header {
        padding: var(--wp--preset--spacing--5) var(--wp--preset--spacing--5) 0;
    }

    .category-archive .wc-block-product-filters__close-overlay {
        width: 2.75rem;
        height: 2.75rem;
        border: 1px solid var(--wp--preset--color--pearl);
        border-radius: 999px;
        background: var(--wp--preset--color--white);
        color: var(--wp--preset--color--primary);
    }

    .category-archive .wc-block-product-filters__overlay-content {
        padding: 0 var(--wp--preset--spacing--5) var(--wp--preset--spacing--6);
    }

    .category-archive .wc-block-product-filters__overlay-footer {
        padding: var(--wp--preset--spacing--4) var(--wp--preset--spacing--5) var(--wp--preset--spacing--5);
        background: color-mix(in oklab, var(--wp--preset--color--gray) 85%, var(--wp--preset--color--white));
        box-shadow: 0 -8px 24px -24px rgba(20, 20, 20, 0.55);
    }

    .category-archive .wc-block-product-filters__apply {
        min-height: 3rem;
        justify-content: center;
    }

    .category-archive .filter-content .wp-block-categories li,
    .category-archive .filter-content .wc-block-product-categories-list li {
        grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    }

    .category-archive .filter-content .category-tree-toggle {
        width: 2.75rem;
        height: 2.75rem;
        margin-left: -0.5rem;
    }

    .category-archive .woocommerce-ordering label {
        flex-basis: 100%;
        font-size: var(--wp--preset--font-size--xs-plus);
        letter-spacing: 0.04em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .category-archive .woocommerce-ordering .orderby {
        width: 100%;
    }

    .category-archive .product-style.v1 .wc-block-product > .wp-block-group.group > .wp-block-group:last-child {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .category-archive
        .product-style.v1
        .wc-block-product
        > .wp-block-group.group
        > .wp-block-group:last-child
        .wp-block-woocommerce-product-button {
        justify-self: stretch;
    }

    .category-archive .wc-block-components-product-button .wp-element-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .product-style.v1 .wc-block-product {
        min-width: 160px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-archive .category-archive__card,
    .category-archive .category-archive__product-image img,
    .category-archive .wc-block-components-product-button .wp-element-button,
    .category-archive .wc-block-product-filter-clear-button .wp-block-button__link,
    .category-archive .wc-block-product-filters__open-overlay,
    .category-archive .wc-block-product-filters__close-overlay,
    .category-archive .wc-block-product-filters__apply,
    .category-archive .woocommerce-ordering .orderby,
    .category-archive .wp-block-query-pagination a,
    .category-archive .category-tree-toggle,
    .category-archive .category-archive__eyebrow a,
    .category-archive .wp-block-post-title a {
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Mega Menu Dropdown – override white text inherited from nav bar
   ========================================================================== */

:root {
    --narmada-space-2xs: 0.25rem;
    --narmada-space-xs: 0.5rem;
    --narmada-space-sm: 0.75rem;
    --narmada-space-md: 1rem;
    --narmada-space-lg: 1.5rem;
    --narmada-space-xl: 2rem;
    --narmada-space-2xl: 3rem;
    --narmada-space-3xl: 4rem;
    --narmada-layer-dropdown: 20;
}

/* Ensure nav dropdowns appear above the carousel */
.header .wp-block-navigation {
    position: relative;
    z-index: var(--narmada-layer-dropdown);
}

.header .narmada-header__masthead {
    align-items: center;
}

.header .narmada-header__actions {
    align-items: center;
}

.header .narmada-header__nav-bar {
    padding-inline: clamp(var(--narmada-space-md), 3vw, var(--wp--preset--spacing--8));
}

.header .narmada-header__nav-inner {
    align-items: center;
    column-gap: clamp(var(--narmada-space-md), 2vw, var(--narmada-space-xl));
    row-gap: var(--narmada-space-sm);
}

.header .narmada-header__primary-nav {
    align-items: center;
}

.header .narmada-header__primary-nav > .wp-block-navigation-item > .wp-block-navigation-item__content,
.header .narmada-header__primary-nav > .wp-block-navigation-item > .wp-block-navigation-submenu__toggle,
.header .narmada-header__secondary-links p {
    line-height: 1.25;
}

.header .narmada-header__secondary-links {
    align-items: center;
}

.header .narmada-header__secondary-links p {
    margin: 0;
}

.has-mega-menu > .wp-block-navigation__submenu-container {
    color: var(--wp--preset--color--primary);
    border: 1px solid color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent);
    border-radius: 1rem;
    padding-block: clamp(var(--narmada-space-lg), 2.4vw, var(--narmada-space-2xl));
    padding-inline: clamp(var(--narmada-space-xl), 3vw, 3.75rem);
    background: color-mix(in srgb, var(--wp--preset--color--gray) 80%, white 20%);
    box-shadow: 0 20px 40px rgba(0, 59, 34, 0.12);
}

.has-mega-menu > .wp-block-navigation__submenu-container a {
    color: var(--wp--preset--color--contrast);
}

.has-mega-menu > .wp-block-navigation__submenu-container h2 {
    color: var(--wp--preset--color--primary);
}

.header .narmada-mega-menu {
    width: 100%;
}

.header .narmada-mega-menu__frame {
    box-sizing: border-box;
    gap: clamp(var(--narmada-space-lg), 2vw, var(--narmada-space-xl));
    padding-inline: clamp(0.75rem, 1.8vw, 2rem);
    padding-block: clamp(var(--narmada-space-sm), 1vw, var(--narmada-space-lg));
}

.header .narmada-mega-menu__grid {
    display: grid;
    column-gap: clamp(var(--narmada-space-xl), 2.5vw, 2.75rem);
    row-gap: clamp(var(--narmada-space-xl), 3vw, var(--narmada-space-2xl));
}

.header .narmada-mega-menu__section {
    min-width: 0;
}

.header .narmada-mega-menu__section {
    display: grid;
    align-content: start;
    gap: var(--narmada-space-md);
}

.header .narmada-mega-menu__section h2 {
    margin: 0;
    font-size: inherit;
    line-height: 1.35;
}

.header .narmada-mega-menu__section h2 a {
    text-decoration: none;
    font: inherit;
}

.header .narmada-mega-menu__section .mega-menu-list {
    display: grid;
    gap: var(--narmada-space-sm);
}

.header .narmada-mega-menu__section .mega-menu-list li {
    margin: 0;
    line-height: 1.35;
}

.header .narmada-mega-menu__section .mega-menu-list a {
    display: inline-block;
    text-wrap: balance;
}

@media (min-width: 64rem) {
    .header
        .narmada-header__primary-nav
        > .wp-block-navigation-item.has-mega-menu
        > .wp-block-navigation__submenu-container {
        top: calc(100% + 24px);
    }

    .header .narmada-mega-menu__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        grid-auto-flow: row;
        align-items: start;
    }

    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(-n + 5) {
        grid-row: 1;
    }

    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(6),
    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(7),
    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(8),
    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(9),
    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(10) {
        grid-row: 2;
    }

    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(1),
    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(6) {
        grid-column: 1;
    }

    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(2),
    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(7) {
        grid-column: 2;
    }

    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(3),
    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(8) {
        grid-column: 3;
    }

    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(4),
    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(9) {
        grid-column: 4;
    }

    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(5),
    .header .narmada-mega-menu__grid > .narmada-mega-menu__section:nth-child(10) {
        grid-column: 5;
    }
}

.header .narmada-header__primary-nav .wp-block-navigation__submenu-icon {
    margin-left: var(--narmada-space-xs);
}

/* Hide "All Departments" mega menu inside mobile burger overlay */
.wp-block-navigation__responsive-container.is-menu-open .has-mega-menu {
    display: none !important;
}

/* Hide About Us / Contact Us links on desktop (they appear in the Right Nav group instead) */
@media (min-width: 64rem) {
    .nav-mobile-only {
        display: none !important;
    }
}

@media (max-width: 63.999rem) {
    .header .narmada-header__nav-inner {
        row-gap: var(--narmada-space-md);
    }

    .has-mega-menu > .wp-block-navigation__submenu-container {
        padding-block: var(--narmada-space-lg);
        padding-inline: var(--narmada-space-xl);
        border-radius: 0.875rem;
    }

    .header .narmada-mega-menu__frame {
        padding-inline: var(--narmada-space-sm);
        padding-block: var(--narmada-space-xs);
    }

    .header .narmada-mega-menu__grid {
        column-gap: var(--narmada-space-lg);
        row-gap: var(--narmada-space-xl);
    }
}
