/*
 * Black Week – kampanjsida (page-templates/black-week.php)
 * Laddas endast på sidmallen, efter frontend.css och block-the-product-selector.css.
 */

:root {
    --bw-red: #ff1500;
    --bw-red-hover: #d12819;
    --bw-dark: #101010;
    --bw-light: #f4f4f3;
    --bw-muted: #8d8d8d;
}

/* Mjuk scroll till ankare; scroll-margin så att sektionen inte hamnar under den fasta headern */
html:has(.bw-page) {
    scroll-behavior: smooth;
}

.bw-section[id] {
    scroll-margin-top: 110px;
}

/* Sektioner */
.bw-section {
    padding: 84px 0 96px;
}

.bw-section--dark {
    background: var(--bw-dark);
    color: #fff;
}

.bw-section--light {
    background: var(--bw-light);
    color: #000;
}

.bw-section--light .bw-title {
    color: #000;
}

.bw-section--light .bw-subtitle {
    color: #555;
}

.bw-title .colored-text,
.bw-text__title .colored-text {
    color: var(--bw-red);
}

.bw-subtitle {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 56px;
}

.bw-subtitle p {
    margin: 0 0 0.6em;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.bw-subtitle p:last-child {
    margin-bottom: 0;
}

.bw-subtitle a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bw-subtitle a:hover {
    color: var(--bw-red);
}

/* Hero – bilden visas alltid i sin helhet, utan beskärning eller toning */
.bw-hero {
    position: relative;
}

.bw-hero__img {
    display: block;
    width: 100%;
    height: auto;
}

.bw-hero__content {
    position: relative;
    z-index: 1;
}

.bw-hero .bw-title {
    font-size: 64px;
    margin-bottom: 12px;
}

/* Bakom rubriken: bilden bestämmer höjden, texten läggs ovanpå och centreras */
.bw-hero--behind.bw-hero--has-image {
    padding: 0;
}

.bw-hero--behind.bw-hero--has-image .bw-hero__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bw-hero--behind.bw-hero--has-image .bw-title,
.bw-hero--behind.bw-hero--has-image .bw-subtitle {
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.bw-hero--behind.bw-hero--has-image .bw-subtitle {
    margin-bottom: 0;
}

.bw-hero__actions {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

/* Ovanför rubriken */
.bw-hero--above {
    padding-top: 0;
}

.bw-hero--above .bw-hero__media {
    margin-bottom: 64px;
}

/* Text och bild 50/50 (som topblocket på /kontakt/) */
.bw-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.bw-split--image-left .bw-split__media {
    order: -1;
}

.bw-split__text {
    display: flex;
    align-items: center;
    /* Minst 60 % av skärmhöjden, men aldrig lägre än 490px eller högre än 720px */
    min-height: clamp(490px, 60vh, 720px);
    padding: 75px clamp(24px, 5vw, 80px);
}

/* Texten linjerar mot sidans innehållsbredd på breda skärmar */
.bw-split__inner {
    width: 100%;
    max-width: 620px;
}

.bw-split--image-right .bw-split__inner {
    margin-left: auto;
}

.bw-split__title {
    font-size: 55px;
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -1.5px;
    margin: 0 0 24px;
}

.bw-split__content,
.bw-split__content p,
.bw-split__content li {
    font-size: 18px;
    line-height: 1.35;
}

.bw-split__content > :last-child {
    margin-bottom: 0;
}

.bw-split__content a {
    color: inherit;
    text-decoration: underline;
}

.bw-split__actions {
    margin-top: 32px;
}

.bw-split__media {
    position: relative;
    margin: 0;
    min-height: 100%;
}

.bw-split__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bw-split--black .bw-split__text {
    background: #000;
}

.bw-split--dark .bw-split__text {
    background: #101010;
}

.bw-split--black .bw-split__text,
.bw-split--dark .bw-split__text {
    color: #fff;
}

.bw-split--black .bw-split__title .colored-text,
.bw-split--dark .bw-split__title .colored-text {
    color: var(--bw-red);
}

.bw-split--black .bw-split__content,
.bw-split--dark .bw-split__content {
    color: #d0d0d0;
}

/* Röd bakgrund: svart text och vit markering, som på /kontakt/ */
.bw-split--red .bw-split__text {
    background: var(--bw-red);
    color: #000;
}

.bw-split--red .bw-split__title .colored-text {
    color: #fff;
}

.bw-split--red .bw-button {
    background: #000;
}

.bw-split--red .bw-button:hover,
.bw-split--red .bw-button:focus-visible {
    background: #fff;
    color: #000;
}

@media screen and (max-width: 991px) {
    .bw-split {
        grid-template-columns: 1fr;
    }

    /* Bilden alltid först på mobil */
    .bw-split__media {
        order: -1;
        aspect-ratio: 4 / 3;
        min-height: 0;
    }

    .bw-split__text {
        min-height: 0;
        padding: 32px 16px 40px;
    }

    .bw-split__inner {
        max-width: none;
    }

    .bw-split__title {
        font-size: 27px;
        margin-bottom: 16px;
    }

    .bw-split__actions {
        margin-top: 24px;
    }
}

/* Boxar, fyra i bredd – eget block med mörk bakgrund */
.bw-cards-section {
    background: #101010;
    color: #fff;
}

/* Bredare än temats container: upp till 1490px */
.bw-cards-section .container {
    max-width: 1490px;
}

.bw-cards-section .bw-subtitle {
    color: var(--bw-muted);
}

.bw-cards .card-select {
    height: auto;
}

/* Kvadratiska bilder */
.bw-cards .card-select__figure {
    height: auto;
    min-height: 0;
    aspect-ratio: 1;
    overflow: hidden;
}

/* Temat har transition: all, som kan ge suddig rendering vid nedskalning – animera bara opacity */
.bw-cards .card-select__img {
    transition: opacity 0.2s linear;
}

.bw-cards .card-select__info {
    height: auto;
    padding: 20px 24px;
}

.bw-cards .card-select__title {
    font-size: 22px;
    margin: 0;
}

@media screen and (max-width: 991px) {
    .bw-cards .card-select__info {
        padding: 14px 16px;
    }

    .bw-cards .card-select__title {
        font-size: 17px;
    }
}

/* Nyhetsbrev – samma bakgrund som boxblocket, formuläret renderas av Klaviyo */
.bw-newsletter .bw-subtitle {
    margin-bottom: 16px;
}

.bw-newsletter__form {
    max-width: 720px;
    margin: 0 auto;
}

/* Klaviyos formulär har egen luft (utfyllnad + minhöjd 120px där fältet centreras) – ta bort den här */
.bw-newsletter__form form.klaviyo-form {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.bw-newsletter__form form.klaviyo-form > div {
    min-height: 0 !important;
}

/* Rubrik och text – som nyhetsbrevsblocket men utan formulär; ingen extra luft under texten */
.bw-intro .bw-subtitle {
    margin-bottom: 0;
}

/* Röd bakgrund: svart rubrik (markerade ord vita) och vit brödtext */
.bw-intro--red {
    background: var(--bw-red);
}

.bw-intro--red .bw-title {
    color: #000;
}

.bw-intro--red .bw-title .colored-text {
    color: #fff;
}

.bw-intro--red .bw-subtitle {
    color: #fff;
}

/* Produkter */
.bw-products__grid > [class*="col-"] {
    margin-bottom: 30px;
}

.bw-products.bw-section--dark {
    background: #000;
}

/* .card-product har width: 25% globalt (popup-varukorgen) – här styr kolumnen bredden */
.bw-products .card-product {
    width: 100%;
    height: 100%;
    padding: 24px;
    background: #fff;
    border: 1px solid #ddd;
}

/* Kvadratiska produktbilder; bilder som inte är kvadratiska beskärs från mitten */
.bw-products .card-product-image {
    display: block;
    aspect-ratio: 1;
    padding-bottom: 0;
    margin-bottom: 16px;
    overflow: hidden;
}

.bw-products .card-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bw-products .card-product-title {
    font-size: 20px;
}

.bw-products .card-product-price {
    font-size: 18px;
}

.bw-products .card-product-title {
    display: block;
    color: #000;
}

.bw-products .card-product-button {
    margin-top: 16px;
}

/* Reapris */
.bw-products .card-product-price ins {
    color: #ef2614;
}

/* "Se erbjudande"-knappen */
.bw-products .bw-product-link {
    margin-top: 20px;
    text-decoration: none;
}

/* Temats hover blir svart och försvinner mot svart bakgrund – behåll röd kant */
.bw-products .btn-add:hover,
.bw-products .btn-add:focus-visible {
    border-color: #ef2614;
}

/* Mörk bakgrund: produktkorten utan vit ruta */
.bw-products.bw-section--dark .card-product {
    background: transparent;
    border-color: #2a2a2a;
}

.bw-products.bw-section--dark .card-product-title {
    color: #fff;
}

.bw-products.bw-section--dark .card-product-price {
    color: #fff;
}

/* Text / villkor */
.bw-text__inner {
    max-width: 860px;
}

.bw-text__title {
    font-size: 36px;
    font-weight: 400;
    letter-spacing: -1px;
    line-height: 1.2;
    margin: 0 0 24px;
}

.bw-text__content {
    font-size: 16px;
    line-height: 1.65;
}

/* Temat sätter p { font-size: 15px } globalt */
.bw-text__content p,
.bw-text__content li {
    font-size: 16px;
}

.bw-text__content a {
    color: var(--bw-red);
}

.bw-section--dark .bw-text__content {
    color: #d0d0d0;
}

/* Knappar */
.bw-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.bw-products .bw-actions {
    justify-content: center;
}

.bw-button {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 28px;
    border-radius: 999px;
    background: var(--bw-red);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s linear;
}

.bw-button:hover,
.bw-button:focus-visible {
    background: var(--bw-red-hover);
    color: #fff;
}

@media screen and (max-width: 991px) {
    .bw-section {
        padding: 40px 0 56px;
    }

    /* På mobil får texten inte plats ovanpå bilden – lägg den under */
    .bw-hero--behind.bw-hero--has-image {
        padding-bottom: 40px;
    }

    .bw-hero--behind.bw-hero--has-image .bw-hero__content {
        position: relative;
        padding-top: 32px;
    }

    /* Med kvadratisk mobilbild finns plats för texten ovanpå bilden */
    .bw-hero--behind.bw-hero--has-mobile-image {
        padding-bottom: 0;
    }

    .bw-hero--behind.bw-hero--has-mobile-image .bw-hero__content {
        position: absolute;
        padding-top: 0;
    }

    .bw-hero .bw-title {
        font-size: 34px;
    }

    .bw-hero__actions {
        margin-top: 20px;
    }

    .bw-hero--above .bw-hero__media {
        margin-bottom: 32px;
    }

    .bw-subtitle {
        margin-bottom: 28px;
    }

    .bw-text__title {
        font-size: 27px;
    }
}

/* TEST: Black Week-hero överst i webbshoppen (src/inc/black-week.php) – bara brödtexten, mindre text än på kampanjsidan */
.bw-shop-hero {
    position: relative;
    display: flex;
    align-items: center;
    /* Texten ligger till vänster, i bildens mörka del */
    justify-content: flex-start;
    /* Full kolumnbredd i bildens format; blir högre om texten inte får plats */
    width: 100%;
    aspect-ratio: 2000 / 667;
    min-height: 140px;
    margin-bottom: 32px;
    overflow: hidden;
    background: #101010;
}

.bw-shop-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bw-shop-hero__content {
    position: relative;
    z-index: 1;
    max-width: min(560px, 57%);
    padding: 24px 32px;
    text-align: left;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.bw-shop-hero__text {
    margin: 0;
    color: #fff;
    font-size: 20px;
    line-height: 1.6;
}

@media screen and (max-width: 991px) {
    /* Smalare skärm: visa bildens vänstra, mörka del och tona mörkt bakom texten */
    .bw-shop-hero__img {
        object-position: left center;
    }

    .bw-shop-hero::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 70%, rgba(0, 0, 0, 0) 100%);
    }

    .bw-shop-hero__content {
        max-width: 560px;
        padding: 20px;
    }

    .bw-shop-hero__text {
        font-size: 15px;
    }
}

@media screen and (max-width: 767px) {
    .bw-shop-hero__text {
        font-size: 14px;
    }
}

.bw-shop-hero__text strong {
    font-weight: 700;
}

.bw-shop-hero__text a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bw-shop-hero__text a:hover {
    color: var(--bw-red);
}

/* Produktsidor under kampanjen: kampanjtexten i stället för kortbeskrivningen (src/inc/black-week.php) */
.woocommerce-product-details__short-description.bw-campaign-message {
    background-color: #ef2614;
    color: #fff;
    padding: 20px;
    line-height: 1.7;
    box-shadow: 6px 6px 0 0 rgba(0, 0, 0, 1);
}

.single .woocommerce-product-details__short-description.bw-campaign-message p {
    margin: 0;
    color: #fff;
    font-size: 16px;
    line-height: 145%;
}

.bw-campaign-message strong {
    font-weight: 700;
}

.bw-campaign-message a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bw-campaign-message a:hover {
    color: #000;
}
