/*
 * ========================================
 * WOOCOMMERCE
 * PRODUCT LISTING PAGES (PLP)
 * ========================================
 */

/* ========================================
   PRODUCT GRID
   Eigen CSS grid i.p.v. GP-floats/kolommen,
   zodat alle kaarten in een rij even hoog zijn.
   Alleen voor lijsten met producten (:has), niet
   voor de oude categorie-fotokaarten.
   Kolommen: 3 desktop / 3 tablet / 1 mobiel.
======================================== */

.woocommerce ul.products:has(> li.type-product) {
    --plp-columns: 3;
    --plp-gap: 24px;

    display: grid !important;
    grid-template-columns: repeat(var(--plp-columns), minmax(0, 1fr)) !important;
    gap: var(--plp-gap) !important;
}

.woocommerce ul.products:has(> li.type-product)::before,
.woocommerce ul.products:has(> li.type-product)::after {
    content: none !important;
    display: none !important;
}

.woocommerce ul.products li.type-product {
    display: flex;
    flex-direction: column;

    width: auto !important;

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

    float: none !important;
    clear: none !important;
}

@media (max-width: 1024px) {

    .woocommerce ul.products:has(> li.type-product) {
        --plp-columns: 3;
        --plp-gap: 16px;
    }
}

@media (max-width: 768px) {

    .woocommerce ul.products:has(> li.type-product) {
        --plp-columns: 1;
        --plp-gap: 16px;
    }
}


/* ========================================
   PRODUCT CARDS
   Eén vlak in --neutral-100, zonder rand.
   Opbouw: beeld 1:1 → titel → summary →
   (vrije ruimte) → streep → prijs + pijl.

   Twee ankers: titel + summary bovenaan, streep +
   prijs onderaan (margin-top: auto). Het verschil
   tussen 1- en 2-regelige titels valt als lucht
   boven de streep; summary en prijs blijven per
   rij uitgelijnd.
======================================== */

.woocommerce ul.products li.type-product .woocommerce-loop-product__link {
    --card-padding: 20px;

    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto;

    padding: 0 var(--card-padding) 18px;

    background: var(--neutral-100);
    border-radius: var(--radius-md);

    overflow: hidden;

    color: inherit;
    text-decoration: none;

    transition: background-color .3s ease;
}


/* ========================================
   PRODUCT CARD — BEELD
======================================== */

.woocommerce ul.products li.type-product .wc-product-image {
    margin: 0 calc(var(--card-padding) * -1);
}

.woocommerce ul.products li.type-product .inside-wc-product-image {
    display: flex;
    align-items: center;
    justify-content: center;

    aspect-ratio: 1 / 1;

    overflow: hidden;

    background: transparent;
    border-radius: 0;
}

.woocommerce ul.products li.type-product .inside-wc-product-image img {
    display: block;

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 1.5em;

    object-fit: contain;

    transition: transform .4s ease;
}


/* ========================================
   PRODUCT CARD — TITEL (LEIDEND)
   Geen vaste hoogte: 1 of 2 regels, max 2.
======================================== */

.woocommerce ul.products li.type-product .woocommerce-loop-product__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;

    margin: 0 0 4px 0 !important;
    padding: 0 !important;

    color: var(--blue-900);

    font-size: 1.0625rem !important;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.4;

    transition: color .2s ease;
}


/* ========================================
   PRODUCT CARD — SUMMARY
   Materiaal · inhoud, zelfde termen als de
   filterchips. Eén regel, afgekapt met "…".
======================================== */

.woocommerce ul.products li.type-product .waterconcepts-card-meta {
    min-height: 1.4em;

    margin: 0 0 24px 0 !important;

    overflow: hidden;

    color: var(--neutral-600);

    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.4;

    white-space: nowrap;
    text-overflow: ellipsis;
}


/* ========================================
   PRODUCT CARD — STREEP + PRIJS + PIJL
   Onderaan de kaart vastgezet. Pijl als ::after,
   geen extra markup nodig.
======================================== */

.woocommerce ul.products li.type-product .price {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin: auto 0 0 0 !important;
    padding: 14px 0 0 0;

    border-top: 1px solid var(--neutral-300);

    color: var(--neutral-600) !important;

    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.2;
}

.woocommerce ul.products li.type-product .price::after {
    content: "";

    flex: 0 0 auto;

    width: 32px;
    height: 32px;

    border-radius: 50%;

    background:
        var(--white)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233786c2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E")
        no-repeat center / 16px 16px;

    transition: background-color .2s ease;
}

/* "vanaf" en "/st" — zacht, nooit vet */
.woocommerce ul.products li.type-product .price .waterconcepts-price__prefix,
.woocommerce ul.products li.type-product .price .waterconcepts-price__suffix {
    color: var(--neutral-600) !important;

    font-size: 0.875rem;
    font-weight: 400 !important;
}

/* Bedrag */
.woocommerce ul.products li.type-product .price .woocommerce-Price-amount {
    color: var(--blue-900) !important;

    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.woocommerce ul.products li.type-product .price .woocommerce-Price-currencySymbol {
    font-weight: inherit;
}

/* Geen prijs → "Prijs op aanvraag" */
.woocommerce ul.products li.type-product .price .waterconcepts-price__request {
    color: var(--blue-900);

    font-size: 0.875rem;
    font-weight: 600;
}


/* ========================================
   PRODUCT CARD — HOVER + FOCUS
   Kaart iets donkerder (tussenstap -100/-200,
   houdt tekst ≥4,5:1), product licht groter,
   titel primary, pijl wordt gevuld.
======================================== */

.woocommerce ul.products li.type-product .woocommerce-loop-product__link:hover {
    background: color-mix(in srgb, var(--neutral-100) 50%, var(--neutral-200));
}

.woocommerce ul.products li.type-product .woocommerce-loop-product__link:hover .inside-wc-product-image img {
    transform: scale(1.04);
}

.woocommerce ul.products li.type-product .woocommerce-loop-product__link:hover .woocommerce-loop-product__title {
    color: var(--blue-500);
}

.woocommerce ul.products li.type-product .woocommerce-loop-product__link:hover .price::after {
    background:
        var(--blue-500)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E")
        no-repeat center / 16px 16px;
}

.woocommerce ul.products li.type-product .woocommerce-loop-product__link:focus-visible {
    outline: 2px solid var(--blue-400);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    .woocommerce ul.products li.type-product .inside-wc-product-image img {
        transition: none;
    }

    .woocommerce ul.products li.type-product .woocommerce-loop-product__link:hover .inside-wc-product-image img {
        transform: none;
    }
}


/* ========================================
   PRODUCT CARDS — MOBIEL (1 kolom)
   Kaart is breed genoeg voor de desktop-typografie
   en de pijl; alleen de binnenruimte iets kleiner.
======================================== */

@media (max-width: 768px) {

    .woocommerce ul.products li.type-product .woocommerce-loop-product__link {
        --card-padding: 16px;

        padding-bottom: 16px;
    }

    .woocommerce ul.products li.type-product .waterconcepts-card-meta {
        margin-bottom: 20px !important;
    }
}


/* ========================================
   QUANTITY STEPPER
   Input rekt op, -/+ blijven hun eigen breedte
======================================== */

.woocommerce div.product form.cart div.quantity {
    margin: 0;
}

.quantity.buttons-added {
    display: flex;
    align-items: stretch;

    width: 100%;
}

.quantity.buttons-added
input.qty {
    flex: 1;
    width: auto;
}

.quantity.buttons-added
a.minus,
.quantity.buttons-added
a.plus {
    flex: 0 0 auto;
}

.woocommerce .quantity .qty{
    border-color: var(--neutral-400) !important;
    background: var(--neutral-50) !important;
}

.quantity .minus,
.quantity .plus {
    border-color: var(--neutral-400) !important;
    background: var(--neutral-50) !important;
}

.quantity .minus {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
}

.quantity .plus {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}

.quantity .minus:hover,
.quantity .plus:hover {
    background: var(--neutral-200) !important;
}


/* ========================================
   PLP DESCRIPTION — BAND
   Staat buiten de content-container (hook
   generate_before_footer), dus zo breed als de
   wrapper — net als de hero. Geen 100vw-truc.

   Tekst links, uitgelijnd met de content,
   verticaal gecentreerd naast de foto.
   Foto rechts tot de wrapperrand, standaard
   vierkant (= formaat van de aangeleverde foto's,
   dus geen uitsnede). Alleen als de tekst hoger is
   dan het vierkant groeit de foto mee; dan wordt
   er alleen aan de zijkanten bijgesneden.

   --container / --gutter moeten gelijk zijn aan
   GP's containerbreedte en zijpadding (hero-tekst
   staat op dezelfde lijn).
======================================== */

.plp-description {
    --container: 1600px;
    --gutter: 30px;

    container-type: inline-size;

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

    margin-top: 5rem;

    background: color-mix(in srgb, var(--neutral-100) 50%, var(--neutral-200));
}


/* ========================================
   PLP DESCRIPTION — TEKST
======================================== */

.plp-description__text {
    display: flex;
    align-items: center;

    padding:
        5rem
        4rem
        5rem
        calc(max(0px, (100cqw - var(--container)) / 2) + var(--gutter));
}

.plp-description__text-inner {
    max-width: 62ch;
}

/* Specifieker dan ".plp-description__text-inner p",
   anders nemen kleur, grootte en marge van de
   bodytekst het over (de eyebrow is ook een <p>). */
.plp-description__text-inner .plp-description__eyebrow {
    margin: 0 0 0.625rem 0 !important;

    color: var(--blue-500) !important;

    font-size: 0.75rem !important;
    font-weight: 700;
    letter-spacing: 0.15em;
    line-height: 1.4 !important;
    text-transform: uppercase;
}

/* Koppen: sectieniveau (H3/H4-maten uit het
   handout), ongeacht welk niveau de editor koos */
.plp-description__text-inner h2 {
    margin: 2.5rem 0 1rem 0;

    color: var(--blue-900);

    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.plp-description__text-inner h3,
.plp-description__text-inner h4 {
    margin: 2rem 0 0.75rem 0;

    color: var(--blue-900);

    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.3;
}

/* Eerste kop direct onder de eyebrow */
.plp-description__eyebrow + h2,
.plp-description__eyebrow + h3,
.plp-description__eyebrow + h4 {
    margin-top: 0;
}

.plp-description__text-inner p,
.plp-description__text-inner li {
    color: var(--neutral-600);

    font-size: 1rem;
    line-height: 1.65;
}

.plp-description__text-inner p {
    margin: 0 0 1em 0;
}

.plp-description__text-inner a {
    color: var(--blue-500);
    font-weight: 700;
}

.plp-description__text-inner > *:last-child {
    margin-bottom: 0;
}


/* ========================================
   PLP DESCRIPTION — FOTO
======================================== */

.plp-description__media {
    position: relative;

    overflow: hidden;
}

/* Minimaal vierkant: de spacer geeft de hoogte,
   de grid-rij rekt verder op als de tekst hoger is. */
.plp-description__media::before {
    content: "";

    display: block;

    padding-top: 100%;
}

/* Specifiek + !important: ".woocommerce img
   { height: auto }" (body-class) wint anders,
   waardoor de foto niet tot onderaan het vlak loopt. */
.plp-description .plp-description__img {
    position: absolute;
    inset: 0;

    display: block;

    width: 100% !important;
    height: 100% !important;
    max-width: none !important;

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


/* ========================================
   PLP DESCRIPTION — TABLET + MOBIEL
   Eén kolom: foto boven, tekst eronder.
======================================== */

@media (max-width: 1024px) {

    .plp-description {
        grid-template-columns: minmax(0, 1fr);

        margin-top: 4rem;
    }

    /* Eén kolom: vaste verhouding i.p.v. vierkant,
       anders wordt de foto op tablet ~1000px hoog. */
    .plp-description__media {
        order: -1;

        aspect-ratio: 4 / 3;
    }

    .plp-description__media::before {
        content: none;
    }

    .plp-description__text {
        padding: 3.5rem var(--gutter);
    }

    .plp-description__text-inner h2 {
        font-size: 1.5rem;
    }

    .plp-description__text-inner h3,
    .plp-description__text-inner h4 {
        font-size: 1.1875rem;
    }
}

@media (max-width: 768px) {

    .plp-description {
        --gutter: 15px;

        margin-top: 3rem;
    }

    .plp-description__media {
        aspect-ratio: 1 / 1;
    }

    .plp-description__text {
        padding: 2.5rem var(--gutter);
    }

    .plp-description__text-inner h2 {
        font-size: 1.375rem;
    }

    .plp-description__text-inner h3,
    .plp-description__text-inner h4 {
        font-size: 1.125rem;
    }
}


/* ========================================
   TERM DESCRIPTION (ALLEEN NOG PDP)
   Beschrijvingstab op de PDP. Wordt opgepakt
   bij de PDP; de PLP gebruikt .plp-description.
======================================== */

.woocommerce .term-description {
    position: relative;
}

/* Full width background */
.woocommerce .term-description::before {
    content: "";

    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;

    width: 100vw;

    transform: translateX(-50%);

    background: var(--neutral-100);

    z-index: -1;
}

.term-description h2,
.term-description h3,
.term-description h4 {
    color: var(--navy);
}

.woocommerce .term-description *:last-child {
    margin-bottom: 0;
}

/* ========================================
   TERM DESCRIPTION IMAGE / CONTENT
======================================== */

.term-description__content {
    display: grid;

    grid-template-columns: 2fr 1.25fr;
    gap: 4rem;

    align-items: stretch;

    margin: 4rem 0;
}

.term-description__text {
    display: flex;
    align-items: center;

    padding: 4rem 0;
}

.term-description__text-inner {
    width: 100%;
}

/* Image */
.term-description__image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

.term-description__image img {
    display: block;

    width: 100%;
    max-height: 100%;

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

    border-radius: var(--radius-md);
}

/* ========================================
   TERM DESCRIPTION
   TABLET
======================================== */

@media (max-width: 1024px) {

    .term-description__content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .term-description__image {
        order: -1;
        padding-top: 2.5rem;
    }

    .term-description__text {
        padding: 0;
    }
}

/* ========================================
   TERM DESCRIPTION
   MOBILE
======================================== */

@media (max-width: 600px) {

    .term-description__content {
        margin: 2.5rem 0;
        gap: 2rem;
    }

    .term-description__image {
        margin: 0 -15px;
        padding: 0;
    }

    .term-description__image img {
        width: 100%;
        border-radius: var(--radius-reset);
    }
}

/* ========================================
   PRODUCT CONTROLS
   SORTING + FILTERS

   Desktop (>1024px): filters links, sortering rechts.
   Tablet/mobiel (<=1024px): sortering boven de filters.

   Alle maten en randkleuren via variabelen, zodat
   select en filterchips per definitie gelijk zijn.
======================================== */

.waterconcepts-product-controls {
    --control-height: 36px;
    --control-padding-x: 12px;
    --control-font-size: 0.875rem;
    --control-border: var(--neutral-300);
    --control-border-hover: var(--blue-400);

    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.5rem 1.5rem;

    margin: 3rem 0;
}

.waterconcepts-product-controls .waterconcepts-product-filters {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;

    margin: 0;
}

.waterconcepts-product-controls .waterconcepts-product-ordering {
    order: 2;
    flex: 0 0 auto;

    margin: 0;
}


/* ========================================
   PRODUCT ORDERING
======================================== */

.waterconcepts-product-controls .woocommerce-ordering {
    float: none;

    width: fit-content;

    margin: 0 !important;
}

.waterconcepts-product-controls .woocommerce-ordering select.orderby {
    width: auto;
    height: var(--control-height);

    margin: 0;
    padding: 0 var(--control-padding-x);

    background-color: var(--white) !important;
    border: 1px solid var(--control-border) !important;
    border-radius: var(--radius-sm) !important;

    color: var(--blue-900) !important;

    font-family: inherit;
    font-size: var(--control-font-size) !important;
    font-weight: 500;
    line-height: 1;

    cursor: pointer;

    transition: border-color .2s ease;
}

.waterconcepts-product-controls .woocommerce-ordering select.orderby:hover {
    border-color: var(--control-border-hover) !important;
}

.woocommerce .woocommerce-ordering,
.woocommerce .woocommerce-result-count {
    margin: 0 !important;
}


/* ========================================
   PRODUCT FILTERS
   LAYOUT — één doorlopende rij, overal 0.5rem
======================================== */

/* Plugin-wrappers neutraliseren */
.waterconcepts-product-filters .widget,
.waterconcepts-product-filters .wpc-filters-main-wrap,
.waterconcepts-product-filters .wpc-filters-section,
.waterconcepts-product-filters .wpc-filter-content {
    width: auto;

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

    border: 0 !important;
}

/* Geselecteerde-filters-chips van de plugin: dubbel met
   de actieve staat van de labels zelf */
.waterconcepts-product-filters .wpc-filters-widget-top-container {
    display: none;
}

.waterconcepts-product-filters .wpc-filter-header {
    display: none;
}

.waterconcepts-product-filters .wpc-filters-widget-wrapper,
.waterconcepts-product-filters .wpc-filters-ul-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;

    margin: 0;
    padding: 0;

    list-style: none;
}

.waterconcepts-product-filters .wpc-filters-labels li.wpc-term-item {
    margin: 0 !important;
    padding: 0 !important;
}


/* ========================================
   PRODUCT FILTERS
   CHIP — het label is de enige zichtbare doos,
   wrapper + link zijn volledig neutraal
======================================== */

.waterconcepts-product-filters .wpc-filters-labels .wpc-term-item-content-wrapper,
.waterconcepts-product-filters .wpc-filters-labels .wpc-filter-label-wrapper,
.waterconcepts-product-filters .wpc-filters-labels .wpc-filter-link {
    margin: 0 !important;
    padding: 0 !important;

    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;

    color: inherit !important;

    font: inherit !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.waterconcepts-product-filters .wpc-filters-labels li.wpc-term-item label {
    display: flex !important;
    align-items: center;

    height: var(--control-height);

    margin: 0 !important;
    padding: 0 var(--control-padding-x) !important;

    background: var(--white) !important;
    border: 1px solid var(--control-border) !important;
    border-radius: var(--radius-sm) !important;

    color: var(--blue-900) !important;

    font-family: inherit;
    font-size: var(--control-font-size) !important;
    font-weight: 500 !important;
    line-height: 1 !important;

    cursor: pointer;

    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

/* Hover */
.waterconcepts-product-filters .wpc-filters-labels li.wpc-term-item label:hover {
    border-color: var(--control-border-hover) !important;
}

/* Actief */
.waterconcepts-product-filters .wpc-filters-labels li.wpc-term-selected label,
.waterconcepts-product-filters .wpc-filters-labels li.wpc-term-item input:checked + label {
    background: var(--blue-500) !important;
    border-color: var(--blue-500) !important;
    color: var(--white) !important;
}

/* Actief + hover */
.waterconcepts-product-filters .wpc-filters-labels li.wpc-term-selected label:hover,
.waterconcepts-product-filters .wpc-filters-labels li.wpc-term-item input:checked + label:hover {
    background: var(--blue-900) !important;
    border-color: var(--blue-900) !important;
}


/* ========================================
   FILTER CLEANUP
======================================== */

.waterconcepts-product-filters .wpc-filters-labels::after {
    display: none !important;
}

.waterconcepts-product-filters .wpc-edit-filter-set,
.wpc-no-filter-terms {
    display: none !important;
}


/* ========================================
   FILTER EVERYTHING - MOBIELE KNOP
======================================== */

.wpc-filters-open-button-container a.wpc-open-close-filters-button {
    display: inline-flex;
    align-items: center;

    height: 36px;
    padding: 0 12px;

    background: var(--white) !important;
    border: 1px solid var(--neutral-300) !important;
    border-radius: var(--radius-sm) !important;

    color: var(--blue-900) !important;

    font-size: 0.875rem;
    font-weight: 500;
}

.wpc-icon-html-wrapper span {
    background: var(--blue-400) !important;
}

.wpc-icon-html-wrapper span::after {
    border-color: var(--blue-400) !important;
}


/* ========================================
   PRODUCT CONTROLS
   TABLET + MOBIEL — sortering boven filters
======================================== */

@media (max-width: 1024px) {

    .waterconcepts-product-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .waterconcepts-product-controls .waterconcepts-product-ordering {
        order: 0;
    }
}


/* ========================================
   SHOP CATEGORIES
======================================== */

.shop-categories {
    padding: 3em 0;
}