/* Affililab product cards / slider in Passione's look — see
   inc/affiliate-slider.php and assets/js/affiliate-slider.js.

   The plugin's own CSS uses long selector chains (up to 7 classes), so every
   rule here starts with .gn-aff repeated (= 5 classes on the wrapper) to win
   without !important, whatever order the two stylesheets load in. */

/* ── Wrapper ─────────────────────────────────────────────────────────── */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff {
    --gn-aff-card: 220px;
    border: 0;
    padding: 0;
    margin: 36px auto;
    max-width: 730px;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff span.affiliate-label {
    font-size: 11px;
    line-height: 1.4;
    color: var(--color-grey-muted, #767676);
    letter-spacing: .02em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module {
    background: transparent;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module:empty {
    display: none;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module:not(:first-of-type) {
    border-top: 0;
}

/* ── Track: one card, or a centred scroll-snap row ───────────────────── */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-single {
    display: flex;
    justify-content: center;
    padding: 8px 0 16px;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-slider {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: center;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Lets the first and last card reach the centre. */
    padding: 20px calc(50% - var(--gn-aff-card) / 2) 28px;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-slider::-webkit-scrollbar {
    display: none;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-stage {
    position: relative;
}

/* ── Card ────────────────────────────────────────────────────────────── */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product {
    flex: 0 0 var(--gn-aff-card);
    width: var(--gn-aff-card);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    align-self: stretch;
    padding: 0;
    border: 1px solid #e6e6e3;
    border-bottom: 1px solid #e6e6e3;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    overflow: hidden;
    text-align: center;
    scroll-snap-align: center;
    transition: transform .3s ease, box-shadow .3s ease;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-single .wp-affililab-product {
    flex-basis: 280px;
    width: 280px;
}
/* JS ready: side cards a bit smaller, the centred one lifted. */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-slider.is-ready .wp-affililab-product {
    transform: scale(.92);
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-slider.is-ready .wp-affililab-product.is-active {
    transform: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
}

/* Image: packshots contained on white, editorial photos ("manual"
   products) fill the box. */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-img {
    position: relative;
    width: 100%;
    max-width: none;
    aspect-ratio: 4 / 3;
    height: auto;
    margin: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border-bottom: 1px solid #ececea;
}
/* The box keeps its 4:3 whatever the image: the image sits inside it. */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-img img {
    position: absolute;
    inset: 14px;
    width: calc(100% - 28px);
    height: calc(100% - 28px);
    max-width: none;
    max-height: none;
    margin: 0;
    object-fit: contain;
    border-radius: 0;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product.manual .product-img img {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* With a brand logo, the packshot starts below it. */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-img:has(.brand-logo) img {
    inset: 36px 14px 12px;
    height: calc(100% - 48px);
}
/* Brand logo (API products): small, top left of the image. */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-img img.brand-logo {
    inset: 10px auto auto 10px;
    z-index: 1;
    width: auto;
    height: 18px;
    max-width: 72px;
    object-fit: contain;
    opacity: .75;
}

/* Text block */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 14px 14px 16px;
    background: #fff;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content .product-content-top {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content .product-content-top .product-title {
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
    color: #000;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content .product-content-top .product-logo,
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .div-separator,
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-link .link-icon,
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .wp-affililab-rating .label {
    display: none;
}
/* Stars: black, centred. */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .wp-affililab-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    color: #000;
    font-size: 13px;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .wp-affililab-rating .rating-bg span,
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .wp-affililab-rating .rating-front span {
    color: #d9d9d6;
    font-size: 16px;
    line-height: 16px;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .wp-affililab-rating .rating-front span {
    color: #000;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .wp-affililab-rating .wp-affililab-raring-wrapper {
    height: 16px;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .wp-affililab-rating .aff-rating-count {
    color: var(--color-grey-muted, #767676);
}

/* Price + button */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-price {
    margin-top: auto;
    padding-top: 4px;
    font-size: 21px;
    line-height: 1.2;
    font-weight: 800;
    color: #000;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content .product-content-bottom {
    width: 100%;
    padding: 4px 0 0;
    display: flex;
    justify-content: center;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content .product-content-bottom .product-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 10px 20px;
    border: 0;
    border-radius: 999px;
    /* !important: the plugin's colour settings print inline !important
       rules per shop (teal Thomann, orange Amazon, blue Plugin Boutique). */
    background: #111 !important;
    color: #fff !important;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s, color .2s;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content .product-content-bottom .product-link span {
    margin: 0;
}
/* Active card, single card and hover: lime. */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product.is-active .product-content .product-content-bottom .product-link,
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-single .wp-affililab-product .product-content .product-content-bottom .product-link,
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content .product-content-bottom .product-link:hover,
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content .product-content-bottom .product-link:focus-visible {
    background: var(--color-lime, #D1FF8A) !important;
    color: #000 !important;
}

/* ── Arrows (added by JS) ────────────────────────────────────────────── */
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-nav {
    position: absolute;
    top: var(--gn-aff-arrow-top, 45%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #000;
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity .2s, background-color .2s, color .2s;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-nav--prev {
    left: 0;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-nav--next {
    right: 0;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-nav--next svg {
    transform: scaleX(-1);
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-nav:hover,
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-nav:focus-visible {
    background: var(--color-lime, #D1FF8A);
    color: #000;
}
.wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-nav:disabled {
    opacity: .2;
    cursor: default;
    background: #000;
    color: #fff;
}

/* Two products fit side by side on desktop: no slider there. */
@media (min-width: 601px) {
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-slider.gn-aff-pair {
        justify-content: center;
        overflow: visible;
        padding-left: 0;
        padding-right: 0;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-pair ~ .gn-aff-nav {
        display: none;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-pair.is-ready .wp-affililab-product {
        transform: none;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-pair .wp-affililab-product .product-content .product-content-bottom .product-link {
        background: var(--color-lime, #D1FF8A) !important;
        color: #000 !important;
    }
}

/* ── Phones: one full-width card per swipe ───────────────────────────── */
@media (max-width: 600px) {
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff {
        --gn-aff-card: 100%;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-slider {
        padding-left: 0;
        padding-right: 0;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-single .wp-affililab-product {
        flex-basis: 100%;
        width: 100%;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-slider.is-ready .wp-affililab-product {
        transform: none;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content .product-content-top .product-title {
        font-size: 18px;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-price {
        font-size: 24px;
    }
    /* Keeps the title clear of the arrows on the image/text line. */
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-slider .wp-affililab-product .product-content {
        padding: 18px 56px 18px;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .wp-affililab-module .wp-affililab-product .product-content .product-content-bottom .product-link {
        padding: 12px 28px;
        font-size: 16px;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-nav {
        width: 44px;
        height: 44px;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-nav--prev {
        left: 8px;
    }
    .wp-affiliate-wrapper.gn-aff.gn-aff.gn-aff.gn-aff .gn-aff-nav--next {
        right: 8px;
    }
}
