/* ********************************** */
/*   Produktside - moderne utseende    */
/*   Alt er scopet til .product-modern */
/* ********************************** */

.product-modern {
    --pm-brand: #66d43d;
    --pm-brand-dark: #2f7d14;
    --pm-brand-soft: #eef9e9;
    --pm-ink: #1c1f1a;
    --pm-muted: #6b7166;
    --pm-line: #e4e8e1;
    --pm-surface: #f5f7f3;
    --pm-radius: 16px;
    --pm-shadow: 0 1px 2px rgba(28, 31, 26, .04), 0 8px 24px rgba(28, 31, 26, .06);
    color: var(--pm-ink);
}

    /* ---------- header ---------- */
    .product-modern .pm-header h1 {
        margin-bottom: 1rem;
    }

    .product-modern .pm-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 2.5rem;
    }

        .product-modern .pm-nav a.pm-nav__link {
            display: inline-flex;
            align-items: center;
            padding: 6px 14px;
            border-radius: 999px;
            background: var(--pm-surface);
            border: 1px solid var(--pm-line);
            color: var(--pm-ink);
            font-size: 13px;
            font-weight: 600;
            text-decoration: none;
            text-transform: none;
            transition: background-color .15s, border-color .15s, color .15s;
        }

            .product-modern .pm-nav a.pm-nav__link:hover {
                background: var(--pm-brand-soft);
                border-color: var(--pm-brand);
                color: var(--pm-brand-dark);
            }

    /* ---------- hero ---------- */
    .product-modern .pm-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* samme kolonner som .pm-details */
        gap: 24px;
        align-items: stretch; /* slider og kjøpsboks like høye side om side */
    }

    .product-modern .pm-hero__gallery {
        background: #fff;
        border: 1px solid var(--pm-line);
        border-radius: var(--pm-radius);
        padding: 24px 24px 16px;
        margin-bottom: 0;
    }

        /* avstand mellom hovedbilde og thumbs */
        .product-modern .pm-hero__gallery #product-article-slider .splide__track {
            padding-bottom: 14px !important;
        }

        /* ingen ekstra luft mellom thumbs og bunnen av boksen */
        .product-modern .pm-hero__gallery #secondary-slider .splide__track {
            padding-bottom: 0 !important;
        }

        .product-modern .pm-hero__gallery #secondary-slider .splide__slide {
            border-radius: 8px;
            overflow: hidden;
            background: #fff;
        }

    .product-modern .pm-hero__buy {
        position: relative;
        background: #fff;
        border: 1px solid var(--pm-line);
        border-radius: var(--pm-radius);
        box-shadow: var(--pm-shadow);
        padding: 28px;
        /* innholdet midtstilles vertikalt når boksen strekkes til samme høyde som slideren */
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

        /* med banner: banneret blir liggende i toppen, resten midtstilles i plassen under */
        .product-modern .pm-hero__buy--banner .pm-campaign-banner {
            margin-bottom: auto;
        }

        .product-modern .pm-hero__buy--banner .pm-buy__meta {
            margin-top: 20px;
        }

        .product-modern .pm-hero__buy--banner::after {
            content: "";
            margin-top: auto;
        }

    /* kampanjebanner i toppen av kjøpsboksen */
    .product-modern .pm-campaign-banner {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        margin: -28px -28px 20px;
        padding: 12px 28px;
        border-radius: var(--pm-radius) var(--pm-radius) 0 0;
        background: var(--campaign-color, #e8590c);
        color: var(--campaign-text, #fff);
    }

    .product-modern .pm-campaign-banner__text {
        font-size: 16px;
        text-align: center;
        line-height: 1.3;
    }

    /* kampanje som badge: "eksplosjon" (stjerneform) som stikker ut over øvre høyre hjørne */
    .product-modern .pm-campaign-badge {
        position: absolute;
        top: -38px;
        right: -26px;
        z-index: 2;
        width: 140px;
        height: 140px;
        display: flex;
        align-items: center;
        justify-content: center;
        transform: rotate(12deg);
        filter: drop-shadow(0 6px 10px rgba(28, 31, 26, .22));
        pointer-events: none;
    }

        .product-modern .pm-campaign-badge::before {
            content: "";
            position: absolute;
            inset: 0;
            background: var(--campaign-color, #e8590c);
            clip-path: polygon(50% 0%, 60.6% 10.4%, 75% 6.7%, 79% 21%, 93.3% 25%, 89.6% 39.4%, 100% 50%, 89.6% 60.6%, 93.3% 75%, 79% 79%, 75% 93.3%, 60.6% 89.6%, 50% 100%, 39.4% 89.6%, 25% 93.3%, 21% 79%, 6.7% 75%, 10.4% 60.6%, 0% 50%, 10.4% 39.4%, 6.7% 25%, 21% 21%, 25% 6.7%, 39.4% 10.4%);
        }

    .product-modern .pm-campaign-badge__text {
        position: relative;
        max-width: 92px;
        color: var(--campaign-text, #fff);
        font-size: 15px;
        font-weight: 900;
        line-height: 1.1;
        text-align: center;
        text-transform: uppercase;
        overflow-wrap: anywhere;
    }

    /* gi plass til badge så den ikke dekker svanemerket */
    .product-modern .pm-hero__buy--badge .pm-buy__meta {
        padding-right: 100px;
    }

    /* kampanje som ribbon: diagonalt bånd i øvre høyre hjørne */
    .product-modern .pm-campaign-ribbon {
        position: absolute;
        top: 0;
        right: 0;
        width: 150px;
        height: 150px;
        overflow: hidden;
        border-top-right-radius: var(--pm-radius);
        pointer-events: none;
    }

    .product-modern .pm-campaign-ribbon__text {
        position: absolute;
        top: 34px;
        right: -52px;
        width: 210px;
        padding: 7px 36px;
        transform: rotate(45deg);
        background: var(--campaign-color, #e8590c);
        color: var(--campaign-text, #fff);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: .04em;
        text-align: center;
        text-transform: uppercase;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-shadow: 0 3px 8px rgba(28, 31, 26, .18);
    }

    /* gi plass til ribbon så den ikke dekker svanemerket */
    .product-modern .pm-hero__buy--ribbon .pm-buy__meta {
        padding-right: 90px;
    }

    .product-modern .pm-buy__meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 18px;
        margin-bottom: 18px;
        border-bottom: 1px solid var(--pm-line);
    }

    .product-modern .pm-chip {
        display: inline-block;
        padding: 5px 12px;
        border-radius: 999px;
        background: var(--pm-brand-soft);
        color: var(--pm-brand-dark);
        font-size: 13px;
        font-weight: 700;
    }

    .product-modern .pm-buy__ecolabel {
        width: 50px;
        height: auto;
    }

    /* innhold fra AddToCart-komponenten */
    .product-modern .pm-hero__buy h3 {
        font-size: 13px;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--pm-muted);
        margin-bottom: 6px;
    }

        .product-modern .pm-hero__buy h3 + h3 {
            font-size: 30px;
            letter-spacing: 0;
            text-transform: none;
            color: var(--pm-ink) !important;
            margin-bottom: 18px;
        }

            .product-modern .pm-hero__buy h3 + h3 small {
                color: var(--pm-muted);
            }

    .product-modern .pm-hero__buy > p {
        font-size: 12px;
        color: var(--pm-muted);
        margin-bottom: 8px;
    }

    .product-modern .pm-hero__buy .product__footer {
        background: transparent;
    }

        .product-modern .pm-hero__buy .product__footer > .d-flex {
            padding: 0 !important;
            gap: 10px;
        }

    .product-modern .pm-hero__buy input[type=number] {
        height: 50px;
        width: 90px !important;
        border: 1px solid var(--pm-line);
        border-radius: 12px;
        background: var(--pm-surface);
        margin-right: 0 !important;
        text-align: center;
        font-weight: 700;
    }

    .product-modern .pm-hero__buy button[type=submit] {
        height: 50px;
        min-width: 64px;
        border-radius: 12px;
        flex: 1;
        max-width: 220px;
        justify-content: center;
        transition: transform .1s, background-color .15s;
    }

        .product-modern .pm-hero__buy button[type=submit]:hover {
            background-color: var(--pm-brand-dark);
        }

        .product-modern .pm-hero__buy button[type=submit]:active {
            transform: scale(.98);
        }

    .product-modern .pm-hero__buy .stock-status,
    .product-modern .pm-hero__buy .delivery-info {
        margin-left: 0;
    }

    .product-modern .pm-hero__buy .stock-status {
        margin-top: 16px;
    }

    .product-modern .pm-hero__buy .htmx-indicator:not(.htmx-request) {
        display: none;
    }

    .product-modern .pm-hero__buy .delivery-info {
        margin-bottom: 0;
    }

    /* varianter */
    .product-modern .pm-variants {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 18px;
    }

        .product-modern .pm-variants > a {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px 6px 6px;
            border: 1px solid var(--pm-line);
            border-radius: 12px;
            font-size: 13px;
            text-decoration: none;
            color: var(--pm-ink);
        }

            .product-modern .pm-variants > a img {
                width: 44px;
                height: 44px;
                object-fit: contain;
                border-radius: 8px;
            }

            .product-modern .pm-variants > a.prodVariantActiveItem {
                border-color: var(--pm-brand);
                background: var(--pm-brand-soft);
                font-weight: 700;
            }

    /* ---------- detaljer (teknisk data / produktinfo) ---------- */
    .product-modern .pm-details {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 24px;
        margin-top: 48px;
        align-items: start;
    }

    .product-modern .pm-card {
        background: #fff;
        border: 1px solid var(--pm-line);
        border-radius: var(--pm-radius);
        padding: 28px;
    }

    .product-modern .pm-details h2,
    .product-modern .pm-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem !important;
        border: 0;
    }

        .product-modern .pm-details h2::before,
        .product-modern .pm-section h2::before {
            content: "";
            display: inline-block;
            width: 5px;
            height: 1.05em;
            margin-right: 10px;
            vertical-align: -0.15em;
            border-radius: 3px;
            background: var(--pm-brand);
        }

    .product-modern .pm-docs__title {
        margin-top: 2rem;
    }

    /* teknisk data */
    .product-modern .pm-specs {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
        margin-bottom: 0 !important;
    }

        .product-modern .pm-specs tr {
            display: table-row;
            width: auto;
            background: transparent !important;
        }

            .product-modern .pm-specs tr:nth-child(odd) td {
                background: var(--pm-surface);
            }

        .product-modern .pm-specs td {
            display: table-cell;
            padding: 9px 12px;
            vertical-align: top;
        }

            .product-modern .pm-specs td:first-child {
                border-radius: 8px 0 0 8px;
            }

            .product-modern .pm-specs td:last-child {
                border-radius: 0 8px 8px 0;
            }

            .product-modern .pm-specs td.k {
                width: 48%;
                color: var(--pm-muted);
            }

            .product-modern .pm-specs td.v {
                font-weight: 700;
            }

    /* dokumentasjon */
    .product-modern .pm-docs {
        gap: 8px;
    }

        .product-modern .pm-docs .btn,
        .product-modern .pm-docs form .btn {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            margin: 0;
            padding: 11px 14px;
            border: 1px solid var(--pm-line);
            border-radius: 12px;
            background: #fff;
            color: var(--pm-ink);
            font-size: 14px;
            font-weight: 600;
            text-align: left;
            text-decoration: none;
            transition: background-color .15s, border-color .15s;
        }

            .product-modern .pm-docs .btn:hover {
                background: var(--pm-brand-soft);
                border-color: var(--pm-brand);
            }

            .product-modern .pm-docs .btn .btn__icon--left {
                margin: 0;
                flex: 0 0 auto;
            }

    /* produktinformasjon */
    .product-modern .pm-details__info #product-info > div {
        margin: 0 !important;
        padding: 0 !important;
    }

    .product-modern .pm-details__info #prod-txt-container {
        font-size: 15px;
        line-height: 1.7;
        color: #33372f;
    }

    /* ---------- tilbehør / reservedeler ---------- */
    .product-modern .pm-section {
        margin-top: 64px;
    }

        .product-modern .pm-section .row,
        .product-modern .pm-section .col-12 {
            padding: 0;
        }

        .product-modern .pm-section .products__grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 16px;
        }

        .product-modern .pm-section .products__grid__item--detailed {
            display: flex;
            flex-direction: column;
            margin: 0;
            padding: 0;
            background: #fff;
            border: 1px solid var(--pm-line);
            border-radius: var(--pm-radius);
            overflow: hidden;
            transition: box-shadow .2s, transform .2s, border-color .2s;
        }

            .product-modern .pm-section .products__grid__item--detailed:hover {
                box-shadow: var(--pm-shadow);
                border-color: #d3dacd;
                transform: translateY(-2px);
            }

            .product-modern .pm-section .products__grid__item--detailed > a:first-child {
                display: flex;
                align-items: center;
                justify-content: center;
                height: 160px;
                padding: 16px;
                background: var(--pm-surface);
            }

            .product-modern .pm-section .products__grid__item--detailed img {
                width: auto;
                max-width: 100%;
                max-height: 100%;
                margin: 0;
                float: none;
                mix-blend-mode: multiply;
            }

        .product-modern .pm-section .products__grid__item--detailed__content {
            margin: 0;
            padding: 16px 18px 12px;
            flex: 1;
        }

            .product-modern .pm-section .products__grid__item--detailed__content a {
                text-decoration: none;
                color: inherit;
            }

            .product-modern .pm-section .products__grid__item--detailed__content .h3 {
                font-size: 15px;
                line-height: 1.35;
                margin-bottom: 4px;
            }

            .product-modern .pm-section .products__grid__item--detailed__content .h4 {
                font-size: 13px;
                font-weight: 400;
                color: var(--pm-muted);
                margin: 0;
            }

        .product-modern .pm-section .products__grid__item--detailed__footer {
            background: transparent;
            border-top: 1px solid var(--pm-line);
            padding: 10px 12px;
        }

            .product-modern .pm-section .products__grid__item--detailed__footer form > div {
                display: flex;
                align-items: center;
                padding: 0 !important;
            }

            .product-modern .pm-section .products__grid__item--detailed__footer input[type=number] {
                height: 40px;
                width: 64px !important;
                border: 1px solid var(--pm-line);
                border-radius: 10px;
                background: var(--pm-surface);
                text-align: center;
            }

            .product-modern .pm-section .products__grid__item--detailed__footer button[type=submit] {
                height: 40px;
                border-radius: 10px;
            }

            .product-modern .pm-section .products__grid__item--detailed__footer a.btn--border-bottom {
                display: flex;
                align-items: center;
                justify-content: space-between;
                width: 100%;
                margin-top: 8px;
                padding: 0;
                border: 0;
                font-size: 14px;
                font-weight: 700;
                color: var(--pm-ink);
                text-decoration: none;
            }

/* ---------- responsivt ---------- */
@media screen and (max-width: 1400px) {
    .product-modern .pm-section .products__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 992px) {
    .product-modern .pm-hero,
    .product-modern .pm-details {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-modern .pm-hero {
        gap: 20px;
        align-items: start; /* under hverandre: høyde etter eget innhold */
    }
}

@media screen and (max-width: 576px) {
    .product-modern .pm-card,
    .product-modern .pm-hero__buy {
        padding: 20px;
    }

    .product-modern .pm-campaign-banner {
        margin: -20px -20px 16px;
        padding: 10px 20px;
    }

    .product-modern .pm-campaign-badge {
        top: -30px;
        right: -6px;
        width: 116px;
        height: 116px;
    }

    .product-modern .pm-campaign-badge__text {
        max-width: 76px;
        font-size: 13px;
    }

    .product-modern .pm-hero__gallery {
        padding: 12px 12px 4px;
    }

    .product-modern .pm-section .products__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
