/* Generell styling for Tilbudsliste-siden */
.tilbudsliste-container {
    margin: 0 auto;
}

/* ============================================= */
/* To-kolonners layout                           */
/* ============================================= */

.tilbudsliste-container.to-kolonner {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}

.tilbudsliste-kolonne-venstre {
    flex: 1 1 55%;
    min-width: 320px;
}

.tilbudsliste-kolonne-hoyre {
    flex: 1 1 35%;
    min-width: 320px;
}

.product-quantity {
    display: none;
}
.quantity {
    display: none;
}

/* ============================================= */
/* Styling av produktlisten (venstre kolonne)    */
/* ============================================= */
.tilbudsliste-kolonne-venstre .shop_table {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-top: 0;
    width: 100%;
}
.tilbudsliste-kolonne-venstre .shop_table thead {
    background-color: #f9f9f9;
}
.tilbudsliste-kolonne-venstre .shop_table th {
    font-weight: 600;
    padding: 15px;
    text-align: left;
}
.tilbudsliste-kolonne-venstre .shop_table td {
    padding: 15px;
    vertical-align: middle;
}
.tilbudsliste-kolonne-venstre .woocommerce-cart-form__cart-item {
    border-top: 1px solid #e0e0e0;
}
.tilbudsliste-kolonne-venstre .product-thumbnail img {
    max-width: 80px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.tilbudsliste-kolonne-venstre .product-name a {
    font-weight: 600;
    color: #333;
    text-decoration: none;
}
.tilbudsliste-kolonne-venstre .product-name a:hover {
    color: #0056b3;
}
.tilbudsliste-kolonne-venstre .product-quantity .quantity .input-text {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.tilbudsliste-kolonne-venstre .product-remove .remove {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #999;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    text-decoration: none;
}
.tilbudsliste-kolonne-venstre .product-remove .remove:hover {
    background: #e04f4f;
    color: #fff;
    border-color: #d03d3d;
}
.tilbudsliste-kolonne-venstre .actions {
    padding-top: 20px;
}
.tilbudsliste-kolonne-venstre .actions .button {
    float: right;
    display: none;
}

/* ============================================= */
/* Styling av skjema (høyre kolonne)             */
/* ============================================= */
#tilbudsforesporsel-skjema {
    margin-top: 0;
    padding: 30px;
    background-color: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
#tilbudsforesporsel-skjema h2 {
    margin-top: 0;
}
#tilbudsforesporsel-skjema p {
    margin-bottom: 15px;
}
#tilbudsforesporsel-skjema label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}
#tilbudsforesporsel-skjema input[type="text"],
#tilbudsforesporsel-skjema input[type="tel"],
#tilbudsforesporsel-skjema input[type="email"],
#tilbudsforesporsel-skjema textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
}
#tilbudsforesporsel-skjema input:focus,
#tilbudsforesporsel-skjema textarea:focus {
    border-color: #0073e6;
    box-shadow: 0 0 5px rgba(0,115,230,0.1);
    outline: none;
}
#tilbudsforesporsel-skjema .required {
    color: #e04f4f;
}
#tilbudsforesporsel-skjema input[type="submit"] {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
}

/* ============================================= */
/* Styling for "Legg til/Se listen"-knapper      */
/* ============================================= */
.button.added.sm-lagt-til-knapp,
.button.disabled.sm-lagt-til-knapp {
    background-color: #e9e9e9 !important;
    color: #333 !important;
    cursor: pointer !important;
    border: 1px solid #ccc !important;
    opacity: 1 !important;
}
.button.added.sm-lagt-til-knapp:hover {
    background-color: #dcdcdc !important;
    color: #111 !important;
}

/* ==================================================================== */
/* DEN ENDELIGE OG PERFEKTE MOBIL-LAYOUTEN (MED TEKSTBRYTING)          */
/* ==================================================================== */
@media (max-width: 800px) {
    /* Generell kolonnelayout for mobil */
    .tilbudsliste-container.to-kolonner {
        flex-direction: column;
        gap: 30px;
    }
    .tilbudsliste-kolonne-venstre,
    .tilbudsliste-kolonne-hoyre {
        flex-basis: 100%;
    }
    .tilbudsliste-kolonne-hoyre h2 {
        margin-top: 10px;
    }

    /* Strømlinjeformet produktliste */
    .woocommerce-cart-form__contents {
        border-collapse: separate;
        border-spacing: 0;
    }
    .woocommerce-cart-form__contents thead {
        display: none;
    }
    .woocommerce-cart-form__contents tr.woocommerce-cart-form__cart-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 15px 0;
        border-bottom: 1px solid #e0e0e0;
    }
    .woocommerce-cart-form .woocommerce-cart-form__cart-item:first-of-type {
        border-top: 1px solid #e0e0e0;
    }
    .woocommerce-cart-form__contents td {
        padding: 0;
        border: none;
        display: flex;
        align-items: center;
        background: none;
    }

    /* 1. Bilde */
    .woocommerce-cart-form__contents td.product-thumbnail {
        flex: 0 0 60px;
    }
    .woocommerce-cart-form__contents td.product-thumbnail img {
        max-width: 60px;
    }

    /* 2. Produktnavn (Fikset med tekstbryting) */
    .woocommerce-cart-form__contents td.product-name {
        flex: 1 1 auto;
        text-align: left;
        min-width: 0;
    }
    .woocommerce-cart-form__contents td.product-name a {
        white-space: normal; /* VIKTIG: Lar teksten brytes til ny linje */
    }

    .product-quantity {
        display: none !important;
    }

    /* 3. Antall */
    .woocommerce-cart-form__contents td.product-quantity {
        flex: 0 0 auto;
    }
    .woocommerce-cart-form__contents .quantity {
        margin: 0;
    }
    .woocommerce-cart-form__contents .quantity .input-text {
        width: 50px;
        height: 40px;
        padding: 5px;
    }

    /* 4. Fjern-knapp */
    .woocommerce-cart-form__contents td.product-remove {
        flex: 0 0 auto;
    }
    .woocommerce-cart-form__contents td.product-remove .remove {
        width: 30px;
        height: 30px;
        line-height: 28px;
    }

    /* Oppdater-knapp */
    .woocommerce-cart-form__contents tr:not(.woocommerce-cart-form__cart-item) {
        display: block;
    }
    .woocommerce-cart-form__contents td.actions {
        display: block;
        padding: 20px 0 0 0;
    }
    .tilbudsliste-kolonne-venstre .actions .button {
        width: 100%;
        text-align: center;
        display: none !important;
    }
    .sm-menu-link { 
            font-weight: 500 !important;
    font-size: 23px !important;
}
}
.guide-ikon-v2 svg {
width: 30px;
height: 30px;
}



/* ============================================= */
/* Styling for menypunkt fra Shortcode           */
/* ============================================= */
.sm-menu-item-wrapper {
    position: relative;
    display: inline-block;
}
.sm-menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--global-palette-highlight-alt);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 17px;
    transition: all 0.2s ease-in-out;
}
.sm-menu-link:hover {
    background-color: #041c5a; /* Mørkere nyanse for hover */
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.sm-menu-icon svg {
    width: 20px;
    height: 20px;
    position: relative;
    top: 3px;
    stroke: currentColor;
}
.sm-menu-count {
    display: none;
    background-color: #ffffff;
    color: #062983;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 10px;
}
.sm-menu-item-wrapper.has-items .sm-menu-count {
    display: inline-block;
}

/* ============================================= */
/* Flytende informasjonsboks (nede til høyre)    */
/* ============================================= */
.sm-floating-box-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.sm-floating-box-link {
    display: flex;
    align-items: center;
    background-color: var(--global-palette-highlight-alt);
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-decoration: none;
    transition: all 0.2s ease;
}
.sm-floating-box-link:hover {
    background-color: var(--global-palette-highlight-alt);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: #fff;
    transform: translateY(-2px);
}
.sm-floating-box-text {
    font-size: 17px;
    font-weight: 600;
    margin-right: 12px;
}
.sm-floating-box-count {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    color: #2c3338;
    font-size: 14px;
    font-weight: bold;
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
}

/* ============================================= */
/* Styling for produkter lagt i listen           */
/* ============================================= */
.mitt-produkt-element.lagt-i-liste {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.mitt-produkt-element .knappe-container .button {
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    padding: 10px 5px;
    box-sizing: border-box;
}

/* ==================================================================== */
/* Forbedret "Lagt til i listen"-opplevelse                             */
/* ==================================================================== */
a.added_to_cart.wc-forward {
    display: none !important;
}
.sm-added-notice {
    display: block;
    color: #062983;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: center;
}

/* ==================================================================== */
/* NYTT: Styling for "Fjern fra listen"-knapp (OPPDATERT)               */
/* ==================================================================== */
.mitt-produkt-element .knappe-container {
    display: flex;
    align-items: stretch; /* <-- VIKTIG: Tvinger alle elementer til å ha lik høyde */
    gap: 5px;
}
.mitt-produkt-element .knappe-container .button.sm-lagt-til-knapp {
    flex-grow: 1;
}
a.sm-fjern-fra-liste {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px; /* Gir litt bredde */
    background-color: #f5f5f5;
    color: #999;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
a.sm-fjern-fra-liste:hover {
    background-color: #e04f4f;
    color: #fff;
}

/* ==============================================
Styling for egendefinert produktvisning (Oppdatert)
==============================================
*/

/* Hovedcontainer som lager et fleksibelt rutenett */
.min-egendefinerte-produktliste {
    display: flex;
    flex-wrap: wrap; 
    gap: 25px; 
    align-items: stretch;
    width: 100%; /* Sikrer at den fyller sin forelder-container */
}

/* Styling for hvert enkelt produktkort */
.mitt-produkt-element {
    /* * FORKLARING AV DEN NYE LINJEN:
     * flex-grow: 1 -> Tillater elementet å vokse for å fylle plassen.
     * flex-shrink: 1 -> Tillater elementet å krympe ved behov.
     * flex-basis: calc(...) -> Beregner den ideelle bredden.
     * * REGNESTYKKET for 6 kolonner:
     * 100% (total bredde) - 100px (5 mellomrom à 20px)
     * Resultatet deles på 6 (antall kolonner)
    */
    flex: 1 1 calc((100% - 100px) / 6);

    max-width: none; /* Fjerner gammel begrensning */
    display: flex;
    flex-direction: column;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Styling for selve bildet */
.produkt-bilde-bg {
    height: 150px; 
    width: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
}

/* Liten effekt når man holder musepekeren over bildet */
.mitt-produkt-element a:hover .produkt-bilde-bg {
    transform: scale(1.05);
}

/* Styling for tittel og pris */
.mitt-produkt-element h3 {
    padding: 10px 15px 5px 15px;
    margin: 0;
    font-size: 1.1rem;
}

.mitt-produkt-element h3 a {
    text-decoration: none;
    color: #333;
}

.mitt-produkt-element .pris {
    padding: 0 15px 15px 15px;
    font-weight: bold;
    color: #555;
}

/* Styling for knappen */
.mitt-produkt-element .knappe-container {
    margin-top: auto; /* Dytter knappen helt til bunnen */
    padding: 0 15px 15px 15px;
}

.button.se-produkt-knapp {
    font-weight: 600;
    font-size: 0.9rem;
    background: #ffffff;
    border: 1px solid #ccc;
    color:#333333;
}

/* ==============================================
   Responsivitet for nettbrett og mobil
==============================================
*/

/* For nettbrett (f.eks. iPad i portrettmodus) - 3 kolonner */
@media (max-width: 1024px) {
    .mitt-produkt-element {
        /* Regnestykke: (100% - 40px (2 mellomrom)) / 3 */
        flex-basis: calc((100% - 40px) / 3);
    }
}

/* For store mobiler - 2 kolonner */
@media (max-width: 767px) {
    .mitt-produkt-element {
        /* Regnestykke: (100% - 25px (1 mellomrom)) / 2 */
        flex-basis: calc((100% - 25px) / 2);
    }
}
/* For små mobiler - 1 kolonne */
@media (max-width: 480px) {
    .mitt-produkt-element {
        /* Regnestykke: (100% - 25px (1 mellomrom)) / 2 */
        flex-basis: calc((100% - 25px) / 2);
    }
}