/* =========================================================
   SPADE — COLLECTION / PRODUCT CATEGORY TEMPLATE
   ========================================================= */

:root {
    --spade-collection-gutter: clamp(18px, 2vw, 34px);
    --spade-collection-border: #e9e9e9;
    --spade-collection-muted: #777777;
    --spade-collection-pink: #ef3f78;
}


/* =========================================================
   REMOVE BLOCKSY / DEFAULT ARCHIVE SPACING
   ========================================================= */

.tax-product_cat .hero-section,
.tax-product_cat .ct-breadcrumbs {
    display: none !important;
}

.tax-product_cat .site-main,
.tax-product_cat #main-container,
.tax-product_cat .site-main > .ct-container,
.tax-product_cat .site-main > .ct-container-full {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;
}

.spade-collection {
    width: 100%;
    max-width: none;

    margin: 0;
    padding: 0;

    background: #ffffff;
    color: #111111;

    overflow: clip;
}


/* =========================================================
   HERO
   Wide, short channel-banner proportion
   ========================================================= */

.spade-collection-hero {
    width: 100%;
}

.spade-collection-hero__media {
    position: relative;

    width: 100%;
    aspect-ratio: 4.35 / 1;

    overflow: hidden;

    background:
        linear-gradient(
            120deg,
            #f7f2ef,
            #eee7e2
        );
}

.spade-collection-hero__media img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;
}

.spade-collection-hero__placeholder {
    width: 100%;
    height: 100%;
}

.spade-collection-hero__content {
    width: 100%;

    padding:
        clamp(30px, 3.7vw, 54px)
        var(--spade-collection-gutter)
        clamp(30px, 3.7vw, 54px);

    text-align: center;

    box-sizing: border-box;
}

.spade-collection-hero__eyebrow {
    margin: 0 0 9px;

    color: var(--spade-collection-pink);

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 9px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.17em;

    text-transform: uppercase;
}

.spade-collection-hero__title {
    margin: 0;

    color: #111111;

    font-family:
        var(--spade-font-heading, "DM Serif Display", Georgia, serif);

    font-size: clamp(42px, 4.6vw, 68px);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.spade-collection-hero__description {
    max-width: 760px;

    margin: 16px auto 0;

    color: var(--spade-collection-muted);

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 12px;
    line-height: 1.75;
}

.spade-collection-hero__description > *:first-child {
    margin-top: 0;
}

.spade-collection-hero__description > *:last-child {
    margin-bottom: 0;
}


/* =========================================================
   SHOP BY CATEGORY — COMPACT ONE-LINE STRIP
   ========================================================= */

.spade-collection-nav {
    width: 100%;

    border-top: 1px solid var(--spade-collection-border);
    border-bottom: 1px solid var(--spade-collection-border);

    background: #ffffff;
}

.spade-collection-nav__inner {
    width: 100%;

    display: flex;
    align-items: center;

    gap: clamp(24px, 3vw, 46px);

    padding:
        18px
        var(--spade-collection-gutter);

    box-sizing: border-box;
}

.spade-collection-nav__label {
    flex: 0 0 auto;

    padding-right: clamp(20px, 2.5vw, 38px);

    border-right: 1px solid var(--spade-collection-border);

    color: #111111;

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.14em;

    white-space: nowrap;
    text-transform: uppercase;
}

.spade-collection-nav__scroll {
    min-width: 0;

    flex: 1;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: clamp(24px, 3vw, 50px);

    overflow-x: auto;

    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.spade-collection-nav__scroll::-webkit-scrollbar {
    display: none;
}

.spade-collection-nav__item {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;

    gap: 9px;

    padding: 5px 0;

    color: #111111;

    text-decoration: none;

    white-space: nowrap;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.spade-collection-nav__item:hover {
    color: var(--spade-collection-pink);
}

.spade-collection-nav__icon {
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;
}

.spade-collection-nav__icon svg {
    width: 100%;
    height: 100%;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.spade-collection-nav__name {
    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
}


/* =========================================================
   CATEGORY GROUPS
   ========================================================= */

.spade-collection-groups {
    width: 100%;
}

.spade-collection-group {
    width: 100%;

    padding:
        clamp(50px, 5vw, 76px)
        var(--spade-collection-gutter);

    border-bottom: 1px solid var(--spade-collection-border);

    box-sizing: border-box;

    scroll-margin-top: 100px;
}

.spade-collection-group__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 28px;

    margin-bottom: 24px;
}

.spade-collection-group__eyebrow {
    margin: 0 0 7px;

    color: var(--spade-collection-pink);

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;

    text-transform: uppercase;
}

.spade-collection-group__title {
    margin: 0;

    font-family:
        var(--spade-font-heading, "DM Serif Display", Georgia, serif);

    font-size: clamp(38px, 3.4vw, 54px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.025em;
}

.spade-collection-group__view-all {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    padding-bottom: 5px;

    border-bottom: 1px solid #111111;

    color: #111111;

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;

    text-decoration: none;
    text-transform: uppercase;

    white-space: nowrap;
}

.spade-collection-group__view-all span {
    transition: transform 0.2s ease;
}

.spade-collection-group__view-all:hover span {
    transform: translateX(3px);
}


/* =========================================================
   ARIENTI-STYLE PARENT COLLECTION FEATURE
   =========================================================
   archive-product.php controls the actual viewport pinning.
   The editorial HOLDER remains in the zig-zag grid and stretches
   to the complete height of the product column.
   ========================================================= */

.spade-collection-group__layout {
    display: grid;

    grid-template-columns:
        minmax(0, 0.86fr)
        minmax(0, 1.14fr);

    gap: clamp(18px, 2vw, 30px);

    align-items: stretch;
}


/* =========================================================
   ZIG-ZAG ORDER
   ========================================================= */

/* Default section: editorial LEFT / products RIGHT. */

.spade-collection-group__editorial {
    position: relative;

    min-width: 0;

    /*
     * This holder must span the same grid-row height as all
     * eight products. It becomes the boundary within which
     * the pinned editorial image is allowed to travel.
     */
    align-self: stretch;
}

.spade-collection-group--media-right
.spade-collection-group__editorial {
    grid-column: 2;
    grid-row: 1;
}

.spade-collection-group--media-right
.spade-collection-group__products {
    grid-column: 1;
    grid-row: 1;
}


/* =========================================================
   EDITORIAL PANEL
   ========================================================= */

.spade-collection-group__editorial-link {
    position: absolute;

    top: 0;
    right: 0;
    bottom: auto;
    left: 0;

    display: block;

    width: 100%;

    /*
     * JavaScript writes the exact viewport-fit height on desktop.
     */
    height: min(72vh, 780px);
    min-height: 440px;

    overflow: hidden;

    background: #f4f1ef;

    text-decoration: none;
}

.spade-collection-group__editorial-link.spade-editorial-is-fixed {
    margin: 0 !important;
}

.spade-collection-group__editorial-link::after {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.50) 0%,
            rgba(0, 0, 0, 0.06) 46%,
            rgba(0, 0, 0, 0) 68%
        );

    pointer-events: none;
}

.spade-collection-group__editorial-link img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    transition: transform 0.7s ease;
}

.spade-collection-group__editorial-link:hover img {
    transform: scale(1.025);
}

.spade-collection-group__placeholder {
    width: 100%;
    height: 100%;

    background:
        linear-gradient(
            135deg,
            #eee8e4,
            #f8f5f3
        );
}

.spade-collection-group__editorial-overlay {
    position: absolute;

    right: 30px;
    bottom: 30px;
    left: 30px;

    z-index: 3;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    color: #ffffff;
}

.spade-collection-group__editorial-kicker {
    margin-bottom: 7px;

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;

    text-transform: uppercase;
}

.spade-collection-group__editorial-overlay strong {
    font-family:
        var(--spade-font-heading, "DM Serif Display", Georgia, serif);

    font-size: clamp(34px, 3.5vw, 54px);
    font-weight: 400;
    line-height: 0.98;
}

.spade-collection-group__editorial-overlay > span:last-child {
    margin-top: 15px;

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.09em;

    text-transform: uppercase;
}


/* =========================================================
   PRODUCT GRID — 8 PRODUCTS / 2 COLUMNS
   ========================================================= */

.spade-collection-group__products {
    min-width: 0;
}

.spade-collection-group__grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap:
        clamp(28px, 3vw, 42px)
        clamp(10px, 1.2vw, 18px);
}


/* =========================================================
   COLLECTION PRODUCT CARD
   ========================================================= */

.spade-collection-product {
    position: relative;

    min-width: 0;
}

.spade-collection-product__media {
    position: relative;

    display: block;

    width: 100%;
    aspect-ratio: 4 / 5;

    overflow: hidden;

    background: #f5f5f3;
}

.spade-collection-product__image {
    position: absolute;
    inset: 0;

    display: block;

    width: 100% !important;
    height: 100% !important;

    object-fit: cover;

    transition:
        opacity 0.35s ease,
        transform 0.55s ease;
}

.spade-collection-product__image--hover {
    opacity: 0;
}

.spade-collection-product__media:hover
.spade-collection-product__image--primary {
    opacity: 0;
    transform: scale(1.02);
}

.spade-collection-product__media:hover
.spade-collection-product__image--hover {
    opacity: 1;
    transform: scale(1.02);
}


/* Badge */

.spade-collection-product__badge {
    position: absolute;
    top: 12px;
    left: 12px;

    z-index: 5;

    padding: 6px 9px;

    color: #ffffff;

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 7px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.1em;

    text-transform: uppercase;
}

.spade-collection-product__badge--new {
    background: #e83d72;
}

.spade-collection-product__badge--sale {
    background: #b52428;
}

.spade-collection-product__badge--best-seller {
    background: #a28649;
}

.spade-collection-product__badge--sold-out {
    background: #343434;
}

.spade-collection-product__badge--trending {
    background: #4d2f78;
}


/* Quick add */

.spade-collection-product__quick-add {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    width: 100%;

    padding: 10px 2px 8px;

    border-bottom: 1px solid #dedede;

    color: #111111;

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;

    text-decoration: none;
    text-transform: uppercase;
}

.spade-collection-product__quick-add span:last-child {
    transition: transform 0.2s ease;
}

.spade-collection-product__quick-add:hover span:last-child {
    transform: translateX(3px);
}


/* Info */

.spade-collection-product__info {
    padding: 13px 2px 0;
}

.spade-collection-product__brand {
    margin: 0 0 5px;

    color: #888888;

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 8px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.12em;

    text-transform: uppercase;
}

.spade-collection-product__name {
    min-height: 2.8em;

    margin: 0;

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.spade-collection-product__name a {
    color: #111111;
    text-decoration: none;
}

.spade-collection-product__price {
    margin-top: 7px;

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 12px;
    font-weight: 700;
}

.spade-collection-product__price del {
    margin-right: 5px;

    color: #999999;
    font-weight: 400;
}

.spade-collection-product__price ins {
    color: #111111;
    text-decoration: none;
}

.spade-collection-product__bnpl {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 5px 7px;

    margin-top: 6px;

    color: #777777;

    font-family:
        var(--spade-font-body, "Manrope", Arial, sans-serif);

    font-size: 8px;
    line-height: 1.5;
}

.spade-collection-product__bnpl-logos {
    display: inline-flex;
    align-items: center;

    gap: 4px;
}

.spade-collection-product__bnpl-logos img {
    display: block;

    width: auto;
    height: 12px;

    object-fit: contain;
}


/* Mobile view all hidden on desktop */

.spade-collection-group__view-all--mobile {
    display: none;
}


/* =========================================================
   LEAF CATEGORY / STANDARD CATEGORY
   ========================================================= */

.spade-collection-leaf,
.spade-shop-fallback {
    width: 100%;

    padding:
        clamp(44px, 4vw, 70px)
        var(--spade-collection-gutter)
        80px;

    box-sizing: border-box;
}

.spade-collection-leaf__header {
    margin-bottom: 30px;
}

.spade-collection-leaf__eyebrow {
    margin: 0 0 8px;

    color: var(--spade-collection-pink);

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;

    text-transform: uppercase;
}

.spade-collection-leaf__header h2 {
    margin: 0;

    font-family:
        var(--spade-font-heading, "DM Serif Display", Georgia, serif);

    font-size: clamp(38px, 4vw, 58px);
    font-weight: 400;
}


/* WooCommerce leaf grid */

.spade-collection-leaf ul.products,
.spade-shop-fallback ul.products {
    display: grid !important;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap:
        38px
        clamp(10px, 1.2vw, 18px) !important;

    margin: 0 !important;
}

.spade-collection-leaf ul.products::before,
.spade-collection-leaf ul.products::after,
.spade-shop-fallback ul.products::before,
.spade-shop-fallback ul.products::after {
    display: none !important;
}

.spade-collection-leaf ul.products li.product,
.spade-shop-fallback ul.products li.product {
    width: auto !important;
    margin: 0 !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) {

    :root {
        --spade-collection-gutter: 20px;
    }

    .spade-collection-hero__media {
        aspect-ratio: 3.25 / 1;
    }

    .spade-collection-nav__inner {
        gap: 24px;
    }

    .spade-collection-nav__scroll {
        justify-content: flex-start;
    }

    .spade-collection-group__layout {
        grid-template-columns:
            minmax(0, 0.8fr)
            minmax(0, 1.2fr);

        gap: 18px;
    }

    .spade-collection-group__grid {
        gap:
            28px
            10px;
    }

    .spade-collection-product__name {
        font-size: 11px;
    }

    .spade-collection-leaf ul.products,
    .spade-shop-fallback ul.products {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    :root {
        --spade-collection-gutter: 14px;
    }

    .spade-collection-hero__media {
        aspect-ratio: 16 / 6.5;
    }

    .spade-collection-hero__content {
        padding:
            28px
            14px
            30px;
    }

    .spade-collection-hero__title {
        font-size: 40px;
    }

    .spade-collection-hero__description {
        margin-top: 13px;

        font-size: 10px;
        line-height: 1.65;
    }


    /* Category nav remains one horizontal line */

    .spade-collection-nav__inner {
        display: block;

        padding:
            14px
            0;
    }

    .spade-collection-nav__label {
        display: block;

        margin: 0 14px 11px;
        padding: 0;

        border: 0;

        font-size: 9px;
    }

    .spade-collection-nav__scroll {
        gap: 22px;

        padding:
            0
            14px;

        scroll-padding-inline: 14px;
    }

    .spade-collection-nav__item {
        gap: 7px;
    }

    .spade-collection-nav__icon {
        width: 29px;
        height: 29px;
    }

    .spade-collection-nav__name {
        font-size: 10px;
    }


    /* Sections */

    .spade-collection-group {
        padding:
            42px
            14px;

        scroll-margin-top: 78px;
    }

    .spade-collection-group__header {
        display: block;

        margin-bottom: 18px;
    }

    .spade-collection-group__title {
        font-size: 38px;
    }

    .spade-collection-group__view-all--desktop {
        display: none;
    }

    .spade-collection-group__layout,
    .spade-collection-group--media-right
    .spade-collection-group__layout {
        display: flex;
        flex-direction: column;
    }

    .spade-collection-group--media-right
    .spade-collection-group__editorial,
    .spade-collection-group--media-right
    .spade-collection-group__products {
        grid-column: auto;
        grid-row: auto;
    }


    /* Editorial becomes a normal mobile banner */

    .spade-collection-group__editorial {
        position: static;

        width: 100%;
        min-height: 0 !important;
    }

    .spade-collection-group__editorial-link {
        position: relative !important;

        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;

        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        aspect-ratio: 16 / 10;
    }

    .spade-collection-group__editorial-overlay {
        right: 18px;
        bottom: 18px;
        left: 18px;
    }

    .spade-collection-group__editorial-overlay strong {
        font-size: 34px;
    }


    /* 8 products in 2 columns */

    .spade-collection-group__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap:
            26px
            8px;
    }

    .spade-collection-product__badge {
        top: 8px;
        left: 8px;

        padding: 5px 7px;

        font-size: 6px;
    }

    .spade-collection-product__quick-add {
        padding-top: 8px;

        font-size: 7px;
    }

    .spade-collection-product__brand {
        font-size: 7px;
    }

    .spade-collection-product__name {
        min-height: 3em;

        font-size: 10px;
        line-height: 1.45;
    }

    .spade-collection-product__price {
        font-size: 10px;
    }

    .spade-collection-product__bnpl {
        font-size: 7px;
    }

    .spade-collection-product__bnpl-logos img {
        height: 10px;
    }

    .spade-collection-group__view-all--mobile {
        display: inline-flex;

        margin-top: 28px;
    }


    /* Leaf archive */

    .spade-collection-leaf,
    .spade-shop-fallback {
        padding:
            36px
            14px
            60px;
    }

    .spade-collection-leaf ul.products,
    .spade-shop-fallback ul.products {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap:
            28px
            8px !important;
    }
}


/* =========================================================
   SPADE — ARIENTI EDITORIAL FINAL OVERRIDE
   ========================================================= */

@media (min-width: 701px) {

    .tax-product_cat
    .spade-arienti-editorial
    .spade-collection-group__layout {
        display: grid !important;
        align-items: stretch !important;
    }

    .tax-product_cat
    .spade-arienti-editorial
    .spade-collection-group__editorial {
        position: relative !important;

        align-self: stretch !important;

        min-width: 0 !important;

        overflow: visible !important;
    }

    .tax-product_cat
    .spade-arienti-editorial
    .spade-collection-group--media-right
    .spade-collection-group__editorial {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .tax-product_cat
    .spade-arienti-editorial
    .spade-collection-group--media-right
    .spade-collection-group__products {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    body >
    .spade-collection-group__editorial-link.spade-editorial-is-fixed {
        position: fixed !important;

        display: block !important;

        margin: 0 !important;

        overflow: hidden !important;

        box-sizing: border-box !important;
    }
}


/* =========================================================
   SPADE — EDITORIAL SMOOTHING HINTS
   ========================================================= */

@media (min-width: 701px) {

    .spade-arienti-editorial
    .spade-collection-group__editorial-link {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    body >
    .spade-collection-group__editorial-link.spade-editorial-is-fixed {
        will-change: transform;
        transform: translateZ(0);
    }

    body >
    .spade-collection-group__editorial-link.spade-editorial-is-fixed img {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}
