/* Products listing page */
.products-listing-page {
    background: #fff;
}

.products-listing-hero {
    /* Desktop banner native ratio (3322×519) — show image as designed */
    aspect-ratio: 3322 / 519;
    min-height: 0;
    display: flex;
    align-items: center;
    background-color: #001a3d;
    background-image: url(../../images/products-background-desktop.png);
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
}

.products-listing-hero__content {
    max-width: min(100%, 420px);
    padding: 28px 0;
    text-align: left;
}

.products-listing-hero__content h1 {
    margin: 0 0 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.75rem, 3.2vw, 2.35rem);
    line-height: 1.05;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #fff;
}

.products-listing-hero__sub {
    margin: 0;
    max-width: 100%;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.8rem, 1.35vw, 1.4rem);
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
}

.products-listing-tabs {
    background: var(--primary-navy, #1b3163);
}

.products-listing-tabs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 0;
}

.products-listing-tabs__list a {
    display: inline-block;
    padding: 14px 0px;
    text-decoration: none;
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
    margin: auto 20px;
}

.products-listing-tabs__list a.is-active {
    background: transparent;
    border-bottom: 3px solid #fff;
}

.products-listing-body {
    padding: 28px 0 100px;
}

.products-listing-layout {
    display: grid;
    grid-template-columns: 265px minmax(0, 1fr);
    gap: 34px;
}

.products-filters__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid #ececec;
    margin-bottom: 14px;
}

.products-filters__head h2 {
    margin: 0;
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: 0.08em;
}

.products-filters__head a {
    font-size: 13px;
    color: #666;
    text-decoration: none;
}

.products-filter-group {
    border-bottom: 1px solid #ececec;
    padding: 21px 0 14px;
}

.products-filter-group__toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 0 8px;
}

.products-filter-group__toggle-text {
    flex: 1;
    text-align: left;
}

.products-filter-group__toggle-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1;
    color: #333;
    min-width: 1.25rem;
    text-align: center;
}

.products-filter-group__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.products-filter-group__list li {
    margin: 7px 0;
}

.products-filter-group__list label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* Filter checkboxes — light gray border; bronze border + stroke check when checked */
.products-filter-group__list input[type='checkbox'] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 1px solid #c8c8c8;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.products-filter-group__list input[type='checkbox']:checked {
    border-color: var(--dark-accent-gold, #8f7858);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%238f7858' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6l2.5 3 4.5-5'/%3E%3C/svg%3E");
    background-size: 12px 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.products-filter-group__list input[type='checkbox']:focus-visible {
    outline: 2px solid var(--primary-navy, #1b3163);
    outline-offset: 2px;
}

/* Sort radios in mobile drawer — match checkbox look (single choice) */
.products-filter-group__list--sort input[type='radio'] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 1px solid #c8c8c8;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.products-filter-group__list--sort input[type='radio']:checked {
    border-color: var(--dark-accent-gold, #8f7858);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%238f7858' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6l2.5 3 4.5-5'/%3E%3C/svg%3E");
    background-size: 12px 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.products-filter-group__list--sort input[type='radio']:focus-visible {
    outline: 2px solid var(--primary-navy, #1b3163);
    outline-offset: 2px;
}

.products-listing-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* Keep toolbar + card content on the same horizontal inset as the grid. */
    --products-listing-inline-pad: 14px;
}

.products-listing-main__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
    padding-inline: var(--products-listing-inline-pad);
}

.products-listing-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.products-listing-sort label {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.products-listing-sort select {
    border: 0px solid #ececec;
    background: #FAFAFA;
    border-radius: 5px;
    padding: 8px 17px;
    font-size: 14px;
    color: #333;
    font-weight: 300;
}

.products-listing-count {
    margin: 0;
    font-size: 14px;
    color: #666;
    text-align: start;
}

.products-listing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 10px;
    width: 100%;
}

.products-listing-grid .card-col {
    width: auto;
    margin: 0;
}

.products-listing-grid .product-card {
    /* Exposed so the badge can offset past card padding to the image corner */
    --product-card-pad-top: 12px;
    padding: var(--product-card-pad-top) var(--products-listing-inline-pad) 16px;
}

.products-listing-grid .product-card::before {
    content: none;
    display: none;
}

.products-listing-grid .product-img {
    height: 290px;
}

.products-listing-grid .product-card__media--empty {
    height: 290px;
}

/* Second catalog cover image: crossfade on hover (desktop / fine pointer) */
.products-listing-grid .product-card__media--hover {
    position: relative;
    display: block;
    width: 100%;
    height: 290px;
}

.products-listing-grid .product-card__media--hover .product-img--primary,
.products-listing-grid .product-card__media--hover .product-img--secondary {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.45s ease;
}

.products-listing-grid .product-card__media--hover .product-img--primary {
    z-index: 1;
    opacity: 0;
}

.products-listing-grid .product-card__media--hover .product-img--secondary {
    z-index: 2;
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    /* Always-hovered: resting state already shows secondary */
}

@media (prefers-reduced-motion: reduce) {
    .products-listing-grid .product-card__media--hover .product-img--primary,
    .products-listing-grid .product-card__media--hover .product-img--secondary {
        transition-duration: 0.12s;
    }
}

/* Touch / no hover: keep secondary visible (always-hovered) */
@media (hover: none) {
    .products-listing-grid .product-card__media--hover .product-img--secondary {
        opacity: 1;
        display: block;
    }

    .products-listing-grid .product-card__media--hover .product-img--primary {
        opacity: 0;
    }
}

/*
 * Badge is position:absolute on .product-card, but the eye aligns it to the image.
 * Card padding is NOT equal (12px top vs 14px sides), so top:20 + right:20 looks
 * tighter on the right. Compensate: inset = from-image, plus each side’s padding.
 * (That’s why right:27 “felt” right — ~20 card inset + side-pad delta / optical nudge.)
 */
.products-listing-grid .badge-circle {
    --badge-from-image: 8px; /* keeps former top:20 with 12px pad-top */
    top: calc(var(--product-card-pad-top) + var(--badge-from-image));
    right: calc(var(--products-listing-inline-pad) + var(--badge-from-image));
    left: auto;
    bottom: auto;
}

.products-listing-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
    color: #666;
    font-size: 14px;
    letter-spacing: 0.04em;
}

.products-listing-load-more__spinner {
    width: 22px;
    height: 22px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--primary-navy, #1b3163);
    border-radius: 50%;
    animation: products-listing-load-more-spin 0.75s linear infinite;
}

.products-listing-sentinel {
    width: 100%;
    height: 1px;
    margin-top: 1px;
    pointer-events: none;
}

@keyframes products-listing-load-more-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .products-listing-load-more__spinner {
        animation: none;
        border-top-color: #999;
    }
}

.products-listing-grid.is-loading {
    pointer-events: none;
}

@keyframes products-listing-skeleton-shimmer {
    0% {
        background-position: 120% 0;
    }
    100% {
        background-position: -120% 0;
    }
}

.products-listing-grid .product-card--skeleton {
    padding: 12px 14px 16px;
}

.products-listing-grid .product-card-skeleton__media {
    height: 290px;
    width: 100%;
    border-radius: 5px;
    margin-bottom: 0.75rem;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 220% 100%;
    animation: products-listing-skeleton-shimmer 1.35s ease-in-out infinite;
}

.products-listing-grid .product-card-skeleton__line {
    height: 12px;
    border-radius: 5px;
    margin-bottom: 8px;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 220% 100%;
    animation: products-listing-skeleton-shimmer 1.35s ease-in-out infinite;
    animation-delay: 0.08s;
}

.products-listing-grid .product-card-skeleton__line--title {
    width: 88%;
}

.products-listing-grid .product-card-skeleton__line--title-short {
    width: 55%;
    margin-bottom: 14px;
}

.products-listing-grid .product-card-skeleton__line--price {
    width: 40%;
    height: 14px;
    margin-bottom: 14px;
}

.products-listing-grid .product-card-skeleton__btn {
    height: 38px;
    width: 100%;
    border-radius: 5px;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 220% 100%;
    animation: products-listing-skeleton-shimmer 1.35s ease-in-out infinite;
    animation-delay: 0.12s;
}

@media (prefers-reduced-motion: reduce) {
    .products-listing-grid .product-card-skeleton__media,
    .products-listing-grid .product-card-skeleton__line,
    .products-listing-grid .product-card-skeleton__btn {
        animation: none;
        background: #ececec;
    }

    .products-listing-load-more__spinner {
        animation: none;
        border-top-color: #999;
    }
}

@media (max-width: 991px) {
    .products-listing-layout {
        grid-template-columns: 1fr;
    }
    .products-filter-group__toggle-text {
    font-size:16px;
}

    /* Mobile / tablet: two products per row (see ≤575px — stays 2 columns on small phones too) */
    .products-listing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Panel from below .top-bar only (announcement + currency stay visible); JS measures .top-bar bottom */
    .products-filters {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: var(--products-filter-drawer-top, 100px);
        z-index: 1045;
        max-width: 100%;
        margin: 0;
        padding: 0 16px calc(28px + env(safe-area-inset-bottom, 0));
        background: #fff;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
        pointer-events: none;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.06);
    }

    .products-filters.is-open {
        transform: translateX(0);
        pointer-events: auto;
    }

    .products-filters__drawer-head {
        display: flex;
        align-items: center;
        justify-content: center;
        position: sticky;
        top: 0;
        z-index: 2;
        margin: 0 -16px;
        padding: 19px 48px 19px 16px;
        background: #fff;
        border-bottom: 1px solid #ececec;
    }

    .products-filters__drawer-title {
        margin: 0;
        font-size: 15px;
        font-weight: 400;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        text-align: center;
        color: #111;
    }

    .products-filters__drawer-close {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        border: 0;
        background: transparent;
        padding: 8px 14px;
        font-size: 28px;
        line-height: 1;
        color: #222;
        cursor: pointer;
    }

    .products-filters__drawer-close:focus-visible {
        outline: 2px solid var(--primary-navy, #1b3163);
        outline-offset: 2px;
    }

    .products-filters__category {
        margin: 0 -16px 8px;
        padding: 18px 20px 20px;
        background: var(--primary-navy, #1b3163);
    }

    .products-filters__category-label {
        margin: 0 0 12px;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #fff;
    }

    .products-filters__category-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .products-filters__category-list li {
        margin: 10px 0;
    }

    .products-filters__category-list a {
        display: inline-block;
        font-size: 14px;
        color: #fff;
        text-decoration: none;
        text-transform: capitalize;
    }

    .products-filters__category-list a.is-active {
        color: var(--accent-gold, #c9a66b);
        font-weight: 600;
    }

    .products-filters__category-list a.is-active::before {
        content: '— ';
    }

    /* Accordion: slide open/closed (no display:none — animates max-height) */
    .products-filter-group__list {
        max-height: 560px;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .products-filter-group.is-collapsed .products-filter-group__list {
        max-height: 0;
    }

    .products-listing-filter-mobile-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        box-sizing: border-box;
        margin: 0 0 14px;
        padding: 10px var(--products-listing-inline-pad) 25px;
        border: 0;
        border-bottom: 1px solid #ececec;
        background: #fff;
        text-align: start;
        cursor: pointer;
        font-family: inherit;
    }

    .products-listing-filter-mobile-trigger:focus-visible {
        outline: 2px solid var(--primary-navy, #1b3163);
        outline-offset: 2px;
    }

    .products-listing-filter-mobile-trigger__start {
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    .products-listing-filter-mobile-trigger__icon {
        color: #555;
        font-size: 1rem;
    }

    .products-listing-filter-mobile-trigger__label {
        font-size: 15px;
        color: #555;
        font-weight: 300;
    }

    .products-listing-filter-mobile-trigger__count {
        font-size: 15px;
        color: #555;
        font-weight: 300;
    }

    .products-listing-body .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (min-width: 992px) {
    .products-filters {
        position: static;
        transform: none !important;
        transition: none;
        pointer-events: auto;
        z-index: auto;
        overflow: visible;
        max-height: none;
        margin: 0;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .products-filters.is-open {
        transform: none !important;
    }

    /* Sidebar: ignore mobile collapse + animation */
    .products-filter-group.is-collapsed .products-filter-group__list {
        display: block !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .products-filter-group__list {
        transition: none;
    }
}

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

@media (max-width: 767.98px) {
    .products-listing-hero {
        /* Mobile banner native ratio (1586×992) — show image as designed */
        aspect-ratio: 1586 / 992;
        min-height: 0;
        background-image: url(../../images/products-background-mobile.png);
        background-size: 100% 100%;
        background-position: center center;
    }

    .products-listing-hero__content {
        max-width: min(100%, 260px);
        padding: 22px 0;
    }

    .products-listing-hero__content h1 {
        font-size: 1.5rem;
    }

    .products-listing-hero__sub {
        font-size: 0.72rem;
        letter-spacing: 0.04em;
    }

    .products-listing-tabs__list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Keep 2×N grid on phones; tighten card chrome so two columns fit */
    .products-listing-main {
        --products-listing-inline-pad: 8px;
    }

    .products-listing-grid {
        gap: 14px 8px;
    }

    .products-listing-grid .product-img {
        height: auto;
        max-height: 200px;
        width: 100%;
        object-fit: contain;
    }

    .products-listing-grid .product-card::before {
        content: none;
        display: none;
    }

    .products-listing-grid .product-card {
        --product-card-pad-top: 10px;
        padding: var(--product-card-pad-top) var(--products-listing-inline-pad) 12px;
    }
}

/* RTL support (scoped to listing page only) */
.products-listing-page[dir='rtl'] {
    direction: rtl;
}

.products-listing-page[dir='rtl'] .products-listing-hero__content {
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}

.products-listing-page[dir='rtl'] .products-listing-hero__content h1,
.products-listing-page[dir='rtl'] .products-listing-hero__sub,
.products-listing-page[dir='rtl'] .products-filter-group__toggle,
.products-listing-page[dir='rtl'] .products-filter-group__toggle-text {
    text-align: right;
}

.products-listing-page[dir='rtl'] .products-filter-group__list label {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.products-listing-page[dir='rtl'] .products-listing-layout {
    direction: rtl;
}

.products-listing-page[dir='rtl'] .products-filter-group__list label {
    direction: rtl;
    flex-direction: row-reverse !important;
    justify-content: flex-end !important;
    text-align: right;
}

.products-listing-page[dir='rtl'] .products-filter-group__list label input[type='checkbox'],
.products-listing-page[dir='rtl'] .products-filter-group__list label input[type='radio'] {
    order: 2;
}

.products-listing-page[dir='rtl'] .products-filters__head {
    direction: rtl;
    justify-content: space-between;
}

.products-listing-page[dir='rtl'] .products-filters {
    text-align: right;
}

.products-listing-page[dir='rtl'] .products-listing-grid .badge-circle {
    top: calc(var(--product-card-pad-top) + var(--badge-from-image));
    left: calc(var(--products-listing-inline-pad) + var(--badge-from-image));
    right: auto;
    bottom: auto;
}

.products-listing-page[dir='rtl'] .products-listing-pagination .account-orders-page-arrow i {
    transform: scaleX(-1);
}

@media (max-width: 991px) {
    .products-listing-page[dir='rtl'] .products-filters {
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
    }

    .products-listing-page[dir='rtl'] .products-filters.is-open {
        transform: translateX(0);
    }

    .products-listing-page[dir='rtl'] .products-filters__drawer-head {
        padding: 19px 16px 19px 48px;
    }

    .products-listing-page[dir='rtl'] .products-filters__drawer-close {
        right: auto;
        left: 8px;
    }

    .products-listing-page[dir='rtl'] .products-listing-filter-mobile-trigger {
        text-align: right;
    }

    .products-listing-page[dir='rtl'] .products-listing-filter-mobile-trigger__start {
        flex-direction: row-reverse;
    }
}

/* Header + footer RTL on localized listing/detail pages only */
body.page-rtl-localized .site-header,
body.page-rtl-localized .site-footer {
    direction: rtl;
}

body.page-rtl-localized .top-bar-actions {
    right: auto !important;
    left: 0;
    flex-direction: row-reverse;
}

body.page-rtl-localized .site-navbar-toolbar {
    flex-direction: row-reverse;
}

body.page-rtl-localized .site-search-inner {
    direction: rtl;
}

body.page-rtl-localized .footer-col,
body.page-rtl-localized .footer-newsletter-block {
    text-align: right;
}

body.page-rtl-localized .footer-locale-row,
body.page-rtl-localized .footer-locale-row-mobile {
    direction: rtl;
    flex-direction: row;
    justify-content: flex-start;
    width: auto;
    margin-inline-start: 0;
    margin-inline-end: 0;
}

body.page-rtl-localized .footer-locale-row .footer-locale-currency,
body.page-rtl-localized .footer-locale-row-mobile .footer-locale-currency {
    order: 1;
}

body.page-rtl-localized .footer-locale-row .footer-locale-language,
body.page-rtl-localized .footer-locale-row-mobile .footer-locale-language {
    order: 2;
}

body.page-rtl-localized .footer-locale-row a,
body.page-rtl-localized .footer-locale-row-mobile a {
    margin-right: 0 !important;
    margin-left: 16px !important;
}

body.page-rtl-localized .footer-locale-row a:last-child,
body.page-rtl-localized .footer-locale-row-mobile a:last-child {
    margin-left: 0 !important;
}

/* Header fine-tuning */
body.page-rtl-localized .site-header .navbar-nav {
    direction: rtl;
}

body.page-rtl-localized .site-header .navbar-nav .nav-link,
body.page-rtl-localized .site-header .mega-menu h6,
body.page-rtl-localized .site-header .mega-menu ul li a {
    text-align: right;
}

body.page-rtl-localized .site-header .mega-menu h6,
body.page-rtl-localized .site-header .mega-menu a {
    font-family: 'Cairo', 'Montserrat', 'Open Sans', Arial, sans-serif !important;
}

body.page-rtl-localized .site-header .mega-menu ul li a:hover {
    padding-left: 0;
    padding-right: 5px;
}

body.page-rtl-localized .site-header .site-navbar-toolbar .position-absolute.top-0.start-100.translate-middle.badge {
    left: 0 !important;
    right: auto !important;
    transform: translate(-50%, -50%);
}

/* Footer fine-tuning */
body.page-rtl-localized .site-footer .social-icon-rounded {
    margin-right: 0;
    margin-left: 8px;
}

body.page-rtl-localized .site-footer .footer-newsletter-form {
    align-items: stretch;
}

body.page-rtl-localized .site-footer .footer-newsletter-block {
    text-align: center;
}

