/* =================================================================== */
/* Global Font + Større Base Font
/* =================================================================== */
html {
    font-size: 106.25%; /* Setter base font til 17px */
    /* FIX 1: Prevent global horizontal scrolling (side scrolling) */
    overflow-x: hidden;
}

body {
    /* FIX 1: Prevent horizontal scrolling on the body too */
    overflow-x: hidden;
}

/* NY FIKS: Bruker Varela Round globalt */
body, h1, h2, h3, h4, h5, h6, button, input, textarea, select {
    font-family: 'Varela Round', sans-serif !important; /* !important is kept here as it's a global override */
}

/* =================================================================== */
/* STYLES FROM FOOTER.PHP (CART MODAL & FOOTER)
/* =================================================================== */

/* NY FIKS: Apply 3rem to ALL buttons globally */
.btn {
    border-radius: 3rem !important; /* Kept !important for global override */
    /* FIKS: Tvinger tekst til å holde seg på én linje i knapper */
    white-space: nowrap;
}

.modal-footer .btn {
    border-radius: 3rem !important; /* Kept !important for global override */
}

.modal#cart .modal-body {
    padding: 0;
    position: relative;
    /* FIX 1: Prevent side-scrolling inside the modal body itself */
    overflow-x: hidden; 
}

.modal#cart .cart-page {
    padding: 1.5rem 2rem 2rem 2rem;
    margin-top: 0 !important; /* Kept !important */
}

.cart-total-area {
    padding-left: 0;
    padding-right: 0;
    width: 100%;
}

.modal#cart .product-remove {
    /* Kept default for desktop/larger views */
    margin-top: 0.8rem !important; /* Kept !important */
    margin-left: 0.4rem !important; /* Kept !important */
}

/* =================================================================== */
/* CSS INKLUDERT FRA BISUM.CSS (FOR MODAL)
/* =================================================================== */

img {
    max-width: 100%;
}

/* Removed !important from button, .offcanvas */
button,
.offcanvas {
    border: none;
    outline: none;
    box-shadow: none;
}
/* Focus state for accessibility */
button:focus-visible,
.offcanvas:focus-visible {
    outline: 2px solid #0d6efd; /* Example focus ring */
    outline-offset: 2px;
}


input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0; /* Added to reset appearance */
}

input[type="number"] {
    -moz-appearance: textfield;
}

.heading_18,
.text_16,
.text_14,
.text_12 {
    margin-bottom: 0;
    font-weight: 500;
    font-size: 24px;
    line-height: 1.2;
    color: #000;
}

.heading_18 {
    font-size: 18px;
    line-height: 1.5;
}

/* === IMAGE SIZE: DEFAULT (>= 768px) -> 100px === */
.mini-img-wrapper {
    width: 100px;
    overflow: hidden;
    position: relative;
}

.mini-img {
    min-width: 100px;
    height: auto;
    object-fit: cover;
    object-position: top;
    border-radius: 4px;
}
/* ============================================== */

.product-title,
.product-title a {
    font-size: 16px;
    line-height: 1.3;
    font-weight: var(--title-font-weight);
    font-family: var(--title-font-family);
    color: var(--title-color);
}

.product-vendor,
.quantity input,
.product-price {
    font-size: 14px;
    line-height: 1.3; /* Adjusted line height */
    color: var(--body-color);
    font-weight: var(--body-font-weight);
    font-family: var(--title-font-family);
    font-family: 'Nunito Sans', sans-serif;
}

.product-remove {
    display: block;
    margin-top: 3px;
    font-size: 0.8rem;
    text-decoration: underline;
    color: var(--body-color);
    font-weight: var(--body-font-weight);
    font-family: 'Nunito Sans', sans-serif;
}

.product-title:hover,
.product-title a:hover,
.product-remove:hover {
    color: var(--secondary-color);
}

.qty-btn,
.qty-input {
    width: 50px;
    text-align: center;
    border: none;
    outline: none;
    background: transparent;
}

.qty-btn:hover, .qty-btn:focus, .qty-btn:active,
.qty-input:hover,
.qty-input:focus,
.qty-input:active {
    border: none;
    outline: none;
    background: transparent;
}

.qty-btn::-webkit-inner-spin-button,
.qty-input::-webkit-inner-spin-button {
    display: none;
}

.quantity {
    width: 100px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.quantity .qty-btn {
    width: 25px;
    padding: 4px 5px 6px;
    cursor: pointer;
}

.quantity .qty-btn img {
    max-width: 12px;
    pointer-events: none;
}

.quantity .qty-btn.dec-qty {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.quantity .qty-btn.inc-qty {
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* === IMAGE LAYOUT: DEFAULT (>= 768px) -> 120px === */
.cart-item-media {
    width: 120px;
}
/* ================================================== */


.cart-item td {
    vertical-align: middle;
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.cart-item td:first-child {
    padding-left: 0;
}
.cart-item td:last-child {
    /* FIX: Added space to the right of the totals column */
    padding-right: 1rem;
}


.cart-table th {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.cart-table .product-vendor {
    margin-bottom: 0;
}

.cart-total-title {
    font-weight: 500;
    font-size: 24px;
    line-height: 27px;
    color: #000000;
    padding: 28px 0px 0px 0px;
    text-align: center;
}

.cart-total-title i {
    cursor: pointer;
}

.shipping_text,
.subtotal-value,
.subtotal-title {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.69;
    letter-spacing: 0.5px;
    color: #000000;
    margin-bottom: 0;
}

.shipping_text {
    font-size: 12px;
}

.subtotal-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.4rem;
}

.subtotal-title {
    flex-basis: 180px;
    flex-shrink: 0;
}
.subtotal-value {
    text-align: left;
}

.cart-total-box {
    border-radius: 4px;
    padding: 0;
}

/* =================================================================== */
/* FIKS FOR MODAL-HØYDE
/* =================================================================== */

.modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-body {
    overflow-y: auto;
    flex-grow: 1;
}

/* =================================================================== */

.cart-table {
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
}

.cart-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal#cart .cart-table thead {
    background-color: #fff;
}

.cart-table thead tr {
    display: table-row;
}

.cart-table th {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1rem;
}

.cart-table th:first-child {
    padding-left: 0;
}
.cart-table th:last-child {
    padding-right: 0;
}


/* --- STILER FOR FOOTER TOTAL (SENTRERT) --- */

.modal-footer {
    flex-wrap: wrap;
    padding: 0;
    border-top: none;
    position: relative;
}

.modal-footer .cart-total-area {
    background-color: #f8f9fa;
    /* ADJUSTED: Less top/bottom padding for totals area */
    padding: 2rem 1.5rem 1rem 1.5rem;
    border-bottom: 0px solid #dee2e6;
    text-align: center;
}

.modal-footer .cart-total-box table {
    display: inline-block;
    text-align: left;
    margin: 0;
}

.modal-footer .cart-total-box td {
    /* ADJUSTED: Less vertical padding for table rows */
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
    padding-left: 0.5rem;
    /* FIX: Added extra space on the right side of the numbers column */
    padding-right: 1rem; 
    white-space: nowrap;
}
.modal-footer .cart-total-box .subtotal-title {
    padding-right: 1rem;
    text-align: left; /* Removed !important */
}
.modal-footer .cart-total-box .subtotal-value {
    text-align: right;
    padding-left: 1rem;
    /* FIX: Added extra space on the right side of the numbers column */
    padding-right: 1.5rem;
}

.modal-footer .d-flex.justify-content-center {
    padding: 1.5rem;
    /* ADJUSTED: Reduced top padding for button area */
    padding-top: 0.5rem;
    margin-top: 1rem;
}

/* TARGETING THE FINAL TOTAL ROW */
.modal-footer .total-box td {
    font-size: 1.2rem;
    font-weight: 700;
    color: #212529;
}

/* === NYE STILER FOR RESTYLING === */

.modal#cart .modal-header {
    border-bottom: 1px solid #dee2e6;
}

tr.cart-item {
    border-bottom: 1px solid #f0f0f0;
}
.cart-table tbody tr.cart-item:last-child {
    border-bottom: none;
}

/* === NYE STILER FOR RULLE-PILER === */
.scroll-arrows {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: row;
    justify-content: center;
    z-index: 20;
    width: 100%;
    padding: 0;
}

.modal-body.is-overflowing + .modal-footer .scroll-arrows {
    display: flex;
}

.scroll-arrow {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}
.scroll-arrow:hover {
    background-color: #f8f9fa;
    transform: scale(1.05);
}
.scroll-arrow svg {
    width: 20px;
    height: 20px;
    color: #333;
}

/* =================================================================== */
/* STYLER KUN FOR bulk_products_to_cart.php SIDEN
/* =================================================================== */

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(+2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(+4px, 0, 0); }
}
.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}
.cart-total-warning {
    color: #dc3545;
    font-weight: 600;
    margin-top: 0.5rem;
    height: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.cart-total-warning.show {
    opacity: 1;
}

/* FIX: Force display flex when jQuery's .show() is called for Firefox/browser compatibility */
.empty-cart-action.show_for_firefox_fix {
    display: flex !important;
}

/* Overskriv fonter KUN for .main-cart-page */
.main-cart-page .product-title,
.main-cart-page .product-title a {
    font-size: 1.2rem;
}

.main-cart-page .product-vendor,
.main-cart-page .quantity input,
.main-cart-page .product-price {
    font-size: 1rem;
}

/* Stil for empty state button */
.empty-cart-action {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
}


/* =================================================================== */
/* START: MODERN PRODUCT SELECT MODAL (STYLES FOR #InquiryGetterModel)
/* =================================================================== */

#InquiryGetterModel .product_checkbox_wrapper {
    position: relative;
    display: block !important; /* Kept !important */
}

#InquiryGetterModel .product-select-card .product_checkbox {
    display: none;
}

#InquiryGetterModel .product-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

#InquiryGetterModel .product-select-card {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    background-color: #fff;
    min-height: 80px;
}

#InquiryGetterModel .product-select-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    border: 1px solid #f8f9fa;
}

#InquiryGetterModel .product-select-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-grow: 1;
}

#InquiryGetterModel .product-select-title {
    font-weight: 600;
    color: #212529;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

#InquiryGetterModel .product-select-details {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

#InquiryGetterModel .product-select-check {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 20px;
    height: 20px;
    color: #0d6efd;
    opacity: 0;
    transform: scale(0.5) translate(20%, -20%);
    transition: all 0.2s ease-in-out;
    background-color: #fff;
    border-radius: 50%;
}

#InquiryGetterModel .product-select-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

#InquiryGetterModel .product_checkbox:checked + .product-select-card {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13,110,253,0.15);
    background-color: #f4f8ff;
}

#InquiryGetterModel .product_checkbox:checked + .product-select-card .product-select-check {
    opacity: 1;
    transform: scale(1) translate(0, 0);
}

#InquiryGetterModel .product-select-remover {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background-color: #ffffff;
    color: #212529;
    border-radius: 3rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem 0.35rem 0.75rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    z-index: 10;
    white-space: nowrap;
    cursor: pointer;

    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
}

#InquiryGetterModel .product-select-remover svg {
    width: 16px;
    height: 16px;
    color: #6c757d;
    transition: color 0.2s ease;
}

#InquiryGetterModel .product-select-remover:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: #dc3545;
}
#InquiryGetterModel .product-select-remover:hover svg {
    color: #dc3545;
}

#InquiryGetterModel .product_checkbox_wrapper.fade-out .product-select-card {
    opacity: 0.6;
    background-color: #f8f9fa;
    cursor: default;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

#InquiryGetterModel .product_checkbox_wrapper.fade-out .product-select-card:hover {
    border-color: #e9ecef;
}

#InquiryGetterModel .product_checkbox_wrapper.fade-out .product-select-remover {
    display: flex;
}


/* =================================================================== */
/* STILER FOR RESET & LUKK KNAPPER (#InquiryGetterModel)
/* =================================================================== */

#InquiryGetterModel .modal-footer {
    justify-content: center !important; /* Kept !important */
    gap: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

#InquiryGetterModel .modal-footer .btn-reset-products {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3rem !important; /* Kept !important */
    color: #212529;
    font-weight: 500;
}

#InquiryGetterModel .modal-footer .btn-reset-products:hover {
    background-color: #e9ecef;
}

#InQueryGetterModel .modal-footer .btn-default {
    background-color: #ffffff;
    border: 1px solid #6c757d;
    border-radius: 3rem !important; /* Kept !important */
    color: #212529;
    font-weight: 500;
}

#InquiryGetterModel .modal-footer .btn-default:hover {
    background-color: #f8f9fa;
}


/* =================================================================== */
/* STILER FOR STICKY SUMMARY BAR (Shared with footer.php structure)
/* =================================================================== */

.sticky-summary-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    z-index: 1020;
    padding: 1rem 0;
}
/* Container for 10-kolonne logic */
.sticky-summary-bar__content {
    max-width: 83.3333%; /* col-10 */
    margin: 0 auto;
}

/* Base style for stacking/centering */
.sticky-summary-bar__vertical-stack {
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 1.5rem; /* Increased gap */
    width: 100%;
}

/* General Layout Elements (Shared) */
.sticky-summary__lines .summary-row {
    margin-bottom: 0;
    line-height: 1.4;
    display: flex;
    justify-content: space-between;
    min-width: 280px;
}

.sticky-summary__buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.sticky-summary-bar .subtotal-title,
.sticky-summary-bar .subtotal-value {
    font-size: 1rem;
    white-space: nowrap;
}
.sticky-summary-bar .final-total-row .subtotal-title,
.sticky-summary-bar .final-total-row .subtotal-value {
    font-size: 1.15rem;
    font-weight: 600;
}
.sticky-summary-bar .subtotal-title {
    flex-basis: auto;
    flex-shrink: 1;
    margin-right: 1.5rem;
}

.sticky-summary-bar .cart-total-warning {
    display: block;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

main.has-sticky-bar {
    padding-bottom: 200px;
}

/* =================================================================== */
/* RESPONSIVE MEDIA QUERIES (GROUPED)
/* =================================================================== */

/* * ADDED: New breakpoint for <p> tags
 */
@media (max-width: 1200px) {
    p {
        margin-top: 0;
        font-size: 1rem;
        margin-bottom: 14px;
    }
}


  .btn {
    font-size: 1rem;
  }
}

/*
 * Breakpoint: (min-width: 768px) and (max-width: 1280px)
 * Target: Larger tablets / Small laptops
 */
@media (min-width: 768px) and (max-width: 1280px) {
    .modal-dialog {
        max-width: 90%;
    }
}

/*
 * Breakpoint: (min-width: 768px)
 * Target: Tablets and larger
 */
@media (min-width: 768px) {
    .cart-item-quantity {
        text-align: center;
    }
    .cart-item-quantity .quantity {
        margin-left: auto;
        margin-right: auto;
    }
    .modal-footer .cart-total-box table {
        margin: 0 auto;
    }
}


/*
 * Breakpoint: (min-width: 992px)
 * Target: Desktops
 */
@media (min-width: 992px) {
    /* Bruker .main-cart-page for col-10-effekt + bg-light */
    .main-cart-page {
        max-width: 83.3333%; /* 10/12 kolonner */
        margin: 0 auto; /* sentrering */
        background-color: #f8f9fa; /* bg-light */
        padding: 2rem;
        border-radius: 0.5rem;
    }

    /* *** STICKY BAR LAYOUT FIXES *** */
    /* Ensure the overall container (which uses max-width 83.3333% or col-10) is flexed and centered */
    .sticky-summary-bar__content {
        display: flex;
        justify-content: center;
        width: 100%;
        max-width: 900px; /* Overall width control */
        margin: 0 auto; 
    }
    
    /* FIX: Ensure the content aligns on desktop */
    .sticky-summary-bar__vertical-stack {
        flex-direction: column; /* CHANGED: Was 'row' */
        justify-content: center; /* CHANGED: Was 'space-around' */
        align-items: center; /* Kept 'center' */
        width: 100%;
        gap: 1rem; /* ADDED: To create space between totals and buttons */
    }

    /* Constrain the actual totals column for better aesthetics */
    .sticky-summary__lines {
        max-width: 350px; /* Adjusted max width for totals */
        flex-shrink: 0;
        margin: 0; 
        width: 100%; /* ADDED: Ensure it takes its max-width */
    }
    
    /* Ensure button container is also contained and aligns right */
    .sticky-summary__buttons-wrapper {
        max-width: 320px; 
        flex-shrink: 0;
        margin: 0;
        width: 100%; /* ADDED: Ensure it takes its max-width */
    }
}


/*
 * Breakpoint: (max-width: 991.98px)
 * Target: Tablets and smaller
 */
@media (max-width: 991.98px) {
    .qty-input {
        font-size: 16px !important; /* Kept !important for iOS zoom fix */
    }

    /* NY FIKS: Font size set to 1rem on mobile */
    .product-title,
    .product-title a {
        font-size: 1rem;
        line-height: 1.2;
    }

    /* NY FIKS: Sette product-vendor til 0.8rem på mobil */
    .product-vendor,
    .quantity input,
    .product-price {
        font-size: 0.8rem;
    }

    /* Mobile-specific styles (retained) */
    .main-cart-page {
        background-color: transparent;
        padding: 0;
    }
    
    /* Mobile sticky bar stacking: ensure totals/buttons take full width and stack */
    .sticky-summary-bar__content {
        padding: 0 1rem;
    }
    .sticky-summary-bar__vertical-stack {
        flex-direction: column;
        align-items: stretch;
    }
    .sticky-summary__lines {
        margin: 0;
        width: 100%;
    }
    .sticky-summary__buttons-wrapper {
        margin: 0;
        width: 100%;
    }
    
    /* Ensure buttons are side-by-side on mobile */
    .sticky-summary__buttons {
        flex-direction: row; 
        justify-content: space-between;
    }
}


/*
 * Breakpoint: (max-width: 767px)
 * Target: Mobile
 */
@media (max-width: 767px) {
    /* ADDED rule for bfrofinbra */
    .bfrofinbra {
        font-weight: 400;
        font-size: 1.4rem;
    }

    .heading_18 {
        font-size: 14px;
        line-height: 1.5;
    }

    /* === IMAGE SIZE: MOBILE -> 80px === */
    .mini-img-wrapper,
    .cart-item-media {
        width: 80px;
    }
    .mini-img {
        min-width: 80px;
    }
    /* =================================== */
    
    .quantity {
        width: 100px;
        float: left;
    }

    /* FIX: Clear float and use flex/grid alignment for Slett link and quantity */
    .cart-item-details > div { /* Target the div containing quantity and delete link for mobile view */
        display: flex;
        align-items: center;
        /* ADJUSTED: Increased gap for space between quantity input and "Slett" link */
        gap: 0.75rem; 
        /* ADJUSTED: Reduced vertical space for better text alignment */
        gap: 0.75rem; 
        /* ADJUSTED: Increased vertical space for details row */
        margin-top: 0.5rem !important; /* Was 0.2rem */
    }
    
    /* ADJUSTED: Reduced vertical line height for details text */
    .cart-item-details p {
        line-height: 1.1; 
    }
    
    /* ADJUSTED: Reduced vertical space for product title */
    .cart-item-details .product-title {
        margin-bottom: 0.25rem; /* Was 0.1rem */
    }

    .cart-item-quantity .product-remove {
        /* REVISED FIX: Rely on flex/grid alignment */
        display: block;
        padding-left: 0;
        vertical-align: middle; /* Removed !important */
        margin-top: 0 !important; /* Kept !important */
        margin-left: auto; 
        text-align: right; 
    }

    .cart-table,
    .cart-table thead,
    .cart-table tbody {
        display: block;
        width: 100%;
    }

    .cart-item td {
        padding: 0;
    }

    .cart-item {
        /* ADJUSTED: Grid template for 80px image */
        display: grid; /* Added display:grid */
        grid-template-columns: 80px 1fr auto;
        /* ADJUSTED: Reduced column gap to move text closer to picture */
        column-gap: 8px; 
        /* FIX 3: Increased vertical padding for more space BETWEEN products */
        padding: 1.25rem 0.5rem; /* Was 0.75rem 0.5rem */
        align-items: center;
        border-bottom: 1px solid #f0f0f0;
    }
    .cart-table tbody tr:last-child .cart-item {
        border-bottom: none;
    }

    .cart-item-media {
        grid-column: 1;
        grid-row: 1;
        width: 80px;
    }

    .cart-item-details {
        grid-column: 2;
        grid-row: 1;
    }

    .cart-item-quantity {
        grid-column: 3;
        grid-row: 1;
        padding-top: 0 !important; /* Kept !important */
        margin-left: auto; 
    }

    .cart-item-price {
        grid-column: 3;
        grid-row: 1;
    }

    .cart-table thead tr {
        display: flex;
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .cart-table thead th:first-child {
        text-align: left;
        flex-shrink: 0;
        flex-grow: 1 !important; /* Kept !important */
    }

    .cart-table thead th:nth-child(2),
    .cart-table thead th:nth-child(3),
    .cart-table thead th:nth-child(4) {
        display: none !important; /* Kept !important */
    }

    /* NY FIKS: Tvinger 'Total' headeren til høyre */
    .cart-table thead th:last-child {
        text-align: right !important; /* Kept !important */
        flex-grow: 0 !important; /* Kept !important */
        flex-shrink: 0 !important; /* Kept !important */
        margin-left: auto !important; /* Kept !important */
        padding-right: 0.5rem; /* ADDED: To align with cart-item padding */
    }

    .cart-table th {
        border-bottom: none;
    }

    .cart-total-box {
        padding: 0;
    }
    
    /* FIX 2: Ensure quantity input is 16px or more to prevent unwanted iOS zoom */
    .qty-input {
        font-size: 16px !important; /* Kept !important */
    }

    .price_wrapper {
        display: none;
    }
    .cart-center {
        text-align: center;
        margin-top: 20px;
    }
}

/*
 * Breakpoint: (max-width: 576px)
 * Target: Small mobile
 */
@media (max-width: 576px) {
    /* ADJUSTED: Less padding for smaller cart modal container */
    .modal#cart .cart-page {
        padding: 0.5rem 1rem; 
    }

    .cart-table th {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .cart-total-box {
        padding: 0;
        padding-left: 0;
        padding-right: 0;
    }
    .cart-item td {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .cart-item td:first-child {
        padding-left: 0;
    }
    .cart-item td:last-child {
        padding-right: 0;
    }
    
    /* FIX 2: Ensure quantity input is 16px or more to prevent unwanted iOS zoom */
    .qty-input {
        font-size: 16px !important; /* Kept !important */
    }

    .scroll-arrow {
        width: 35px;
        height: 35px;
    }
    .scroll-arrow svg {
        width: 16px;
        height: 16px;
    }
}


/*
 * Breakpoint: (max-width: 480px)
 * Target: Extra-small mobile
 */
@media (max-width: 480px) {
    /* FIX: Product Title size */
    .product-title,
    .product-title a,
    .main-cart-page .product-title,
    .main-cart-page .product-title a {
        font-size: 1rem !important; /* Kept !important */
    }

    /* FIX: Product Vendor and other small text size */
    .product-vendor,
    .quantity input,
    .product-price,
    .main-cart-page .product-vendor,
    .main-cart-page .quantity input,
    .main-cart-page .product-price {
        font-size: 0.8rem !important; /* Kept !important */
    }

    /* REMOVED rules that made buttons smaller */
}

/*
 * Breakpoint: (max-width: 400px)
 * Target: Very small mobile
 */
@media (max-width: 400px) {
    .offcanvas {
        max-width: 100vw;
    }
}



