/* ==========================================================================
   VFO Handel - Dark B2B Industrial Theme (CLEANED + RE-ORDERED)
   NOTE: Ingenting er fjernet funksjonelt – kun ryddet, samlet, og fikset vars.
   ========================================================================== */

/* ==========================================================================
   1) ROOT VARIABLES
   ========================================================================== */
:root {
    --primary: #3477b0;
    --primary-hover: #2c6699;
    --primary-light: #60a5fa;

    --header-bg: #000000;   /* Beksvart header som konkurrenten */
    --topbar-bg: #0a0a0a;   /* Ørlite lysere svart for topplinjen */
    --nav-border: #262626;  /* Mørkegrå skillelinjer */

    --dark-nav: #0f172a;        /* Brukes i badges, totals, knapper */
    --border-color: #e5e7eb;    /* Manglet i original */

    --bg-light: #f8fafc;
    --text-main: #1e293b;
    --text-header: #ffffff;
    --text-muted: #a3a3a3;
}

/* ==========================================================================
   2) BASE / LAYOUT
   ========================================================================== */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    background: var(--bg-light);
    color: var(--text-main);
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.container.content-area {
    padding: 40px 20px;
    min-height: calc(100vh - 240px);
}

/* ==========================================================================
   3) HEADER (Desktop)
   ========================================================================== */
.site-header {
    background: var(--header-bg);
    color: var(--text-header);
    position: relative;
    z-index: 100;
}

/* --- 3.1 TOPPLINJE (Info & Utilities) --- */
.header-top-bar {
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--nav-border);
    font-size: 0.85rem;
    padding: 8px 0;
}

.header-top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.top-link:hover { color: white; }

.top-divider {
    color: #404040;
    margin: 0 5px;
}

/* --- 3.2 MIDTSEKSJON (Logo, Søk, Kurv) --- */
.header-main { padding: 25px 0; position: relative; }

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    position: relative;
    z-index: 1; /* Løfter innhold over fiber-canvas */
}

/* Hvis logoen din har svart tekst, legger vi en hvit boks bak den i den svarte headeren */
.logo-wrapper {
    padding: 5px 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.logo-wrapper img {
    height: 125px;
    object-fit: contain;
}

/* --- SØK (gigantisk B2B) --- */
.search-wrapper {
    flex-grow: 1;
    max-width: 700px;
    position: relative;
}

/* Sikrer at formen fyller wrapperen */
.search-wrapper .header-search { max-width: 100%; }

.header-search {
    flex-grow: 1;
    max-width: 700px;
    position: relative;
    display: flex;
}

.header-search input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid transparent;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}

.header-search input:focus { border-color: var(--primary); }

.header-search button {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 15px;
    font-size: 1.2rem;
    color: #525252;
}

/* --- LIVE SEARCH DROPDOWN --- */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-top: 5px;
    z-index: 2000;
    overflow: hidden;
    display: none;
    border: 1px solid var(--nav-border);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-main);
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.search-result-item:hover { background: #f8fafc; }

.search-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
}

.search-info { display: flex; flex-direction: column; }

.search-name { font-weight: bold; font-size: 0.9rem; }

.search-price { font-size: 0.8rem; color: var(--text-muted); }

.search-all-btn {
    display: block;
    text-align: center;
    padding: 12px;
    background: #f1f5f9;
    color: var(--primary);
    font-weight: bold;
    text-decoration: none;
    font-size: 0.85rem;
}

.search-all-btn:hover { background: #e2e8f0; }

/* --- HANDLEKURV-KNAPP --- */
.header-cart-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
}

.header-cart-btn:hover .cart-icon { color: var(--primary-light); }

.cart-icon {
    font-size: 1.8rem;
    position: relative;
    transition: color 0.2s;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 20px;
    border: 2px solid var(--header-bg);
}

/* --- 3.3 BUNNLINJE (Kategorier) --- */
.header-bottom-nav {
    border-top: 1px solid var(--nav-border);
    padding: 0;
}

.header-bottom-nav .container {
    display: flex;
    gap: 30px;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}

.header-bottom-nav .container::-webkit-scrollbar { display: none; }

.cat-link {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 20px 0;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.cat-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.cat-link.all-products {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hamburger-icon {
    font-size: 1.2rem;
    font-weight: normal;
}

/* ==========================================================================
   4) FIBER CANVAS (Header Background Animation)
   ========================================================================== */
#fiberCanvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none; /* Klikk gjennom animasjon */
}

/* ==========================================================================
   5) BREADCRUMBS (Industrial Tech)
   ========================================================================== */
.tech-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    margin-bottom: 30px;
    gap: 8px;
}

.crumb-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crumb-link:hover {
    background: #eff6ff;
    color: var(--primary);
    border-color: #bfdbfe;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.tech-breadcrumbs .crumb-link:last-child {
    color: var(--dark-nav);
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.crumb-icon {
    width: 14px;
    height: 14px;
    opacity: 0.9;
}

.crumb-separator {
    width: 16px;
    height: 16px;
    color: #cbd5e1;
    flex-shrink: 0;
}

/* ==========================================================================
   6) PRODUCT GRID & CARDS (B2B Industrial)
   ========================================================================== */
.page-header {
    border-bottom: 2px solid var(--nav-border);
    padding-bottom: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    margin: 0;
    color: var(--text-main);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.search-badge {
    background: var(--dark-nav);
    color: var(--primary-light);
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    border: 1px solid var(--nav-border);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.product-img-wrapper {
    height: 220px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-bottom: 1px solid #f8fafc;
    position: relative;
}

.product-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img-wrapper img { transform: scale(1.05); }

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-meta {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.product-title {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 700;
}

.product-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.product-card:hover .product-title a { color: var(--primary); }

.product-bottom {
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark-nav);
}

.price-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.product-card-btn {
    display: block;
    width: 100%;
    background: var(--dark-nav);
    color: #e2e8f0;
    text-align: center;
    padding: 12px 15px;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid #1e293b;
    box-sizing: border-box;
}

.product-card-btn:hover {
    background: #1e293b;
    color: #ffffff;
    border-color: #334155;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ==========================================================================
   7) CATEGORY PAGE & HORIZONTAL FILTERS
   ========================================================================== */
.category-page-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
    margin-bottom: 50px;
}

.category-sidebar {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    position: sticky;
    top: 100px;
}

.category-sidebar h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--dark-nav);
    padding-bottom: 10px;
    font-weight: 800;
}

/* Kategoritre */
.category-tree-list, .category-sub-list { list-style: none; padding: 0; margin: 0; }

.category-sub-list {
    padding-left: 15px;
    border-left: 2px solid var(--border-color);
    margin-left: 15px;
    display: none;
    margin-top: 5px;
}

.category-sub-list.open { display: block; }

.tree-node { margin-bottom: 4px; }

.tree-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px;
    transition: all 0.2s;
}

.tree-item-row:hover { background: #f8fafc; }

.tree-link {
    flex-grow: 1;
    padding: 8px 12px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s, padding-left 0.2s;
}

.tree-link:hover { color: var(--primary); padding-left: 15px; }

.tree-link.active {
    background: var(--dark-nav) !important;
    color: #ffffff !important;
    border-radius: 4px;
    font-weight: 800;
}

.tree-link.active:hover {
    padding-left: 12px !important;
    color: #ffffff !important;
}

.tree-toggle-btn {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: bold;
    font-size: 1.1rem;
    transition: 0.2s;
    margin-right: 5px;
}

.tree-toggle-btn:hover {
    color: var(--primary);
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* Filter-bar */
.horizontal-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    background: white;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 25px;
    align-items: center;
}

.filter-label {
    font-weight: 800;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-right: 5px;
}

.filter-dropdown { position: relative; }

.filter-btn {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: 0.2s;
}

.filter-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.filter-btn.active {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
}

.filter-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    width: 250px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    padding: 10px;
}

.filter-dropdown-content.show { display: block; }

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    border-radius: 4px;
    transition: 0.2s;
}

.filter-checkbox-label:hover { background: #f8fafc; }

.filter-checkbox-label input { width: 16px; height: 16px; cursor: pointer; }

/* Skjuler mobil-skuff elementer på desktop */
.mobile-filter-btn { display: none; }
.sidebar-close-btn { display: none; }
.sidebar-overlay { display: none; }

/* ==========================================================================
   8) SINGLE PRODUCT PAGE (Classic B2B)
   ========================================================================== */
.product-page-wrapper { margin-bottom: 40px; }

.product-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: start;
}

.main-image-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: white;
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.thumbnails::-webkit-scrollbar { display: none; }

.thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 5px;
    transition: 0.2s;
    background: white;
}

.thumbnails img:hover { border-color: var(--primary); }

.product-info-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.product-artnr {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.product-detail-title {
    margin: 0 0 20px 0;
    font-size: 2rem;
    color: var(--text-main);
    font-weight: 800;
    line-height: 1.2;
}

.discount-badge {
    background: #ecfdf5;
    color: #059669;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: bold;
    margin-bottom: 25px;
    display: inline-block;
    border: 1px solid #a7f3d0;
}

.files-section {
    background: #f8fafc;
    padding: 15px 20px;
    border-radius: 6px;
    margin-top: 30px;
    border: 1px solid var(--border-color);
}

.files-section h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: var(--text-main);
}

.files-list { list-style: none; padding: 0; margin: 0; }

.files-list li { margin-bottom: 8px; }

.files-list a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.files-list a:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Variants-table */
.variants-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.variants-section h2 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-main);
    font-weight: 800;
}

.compact-variant-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.compact-variant-table th {
    background: #f8fafc;
    padding: 12px 15px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

.compact-variant-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.compact-variant-table tr:last-child td { border-bottom: none; }

.compact-variant-table tr:hover td { background: #f8fafc; }

.sku-col { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }

.primary-attr-col { font-size: 1rem; font-weight: 800; color: var(--primary); }

.stock-in { color: #059669; font-size: 0.85rem; font-weight: 600; }

.stock-out { color: #ef4444; font-size: 0.85rem; }

.price-col {
    text-align: right;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.original-price {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.8rem;
    display: block;
    font-weight: normal;
}

.buy-form { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

.buy-input {
    width: 60px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: bold;
}

/* Tabell-Kjøpsknapp (Svart B2B Design) */
.dark-buy-btn {
    background: var(--dark-nav);
    color: #e2e8f0;
    padding: 10px 15px;
    font-weight: 800;
    font-size: 0.85rem;
    border: 1px solid #1e293b;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dark-buy-btn:hover:not(:disabled) {
    background: #1e293b;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.dark-buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   9) CHECKOUT / KASSE (B2B Industrial)
   ========================================================================== */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

.checkout-section {
    background: white;
    padding: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    margin-bottom: 30px;
}

.checkout-section-title {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    color: var(--text-main);
    font-weight: 800;
    border-bottom: 2px solid var(--dark-nav);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.checkout-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: rgba(214, 215, 216, 0.2);
}

.checkout-input:focus {
    border-color: var(--primary);
    outline: none;
    background: rgba(212, 218, 255, 0.47);
}

.shipping-method-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

.shipping-method-card:hover { border-color: #cbd5e1; }

.shipping-method-card.active {
    border-color: var(--dark-nav);
    background: #f8fafc;
}

.order-summary-sidebar {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 120px;
}

.summary-total-box {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    color: white;
    font-weight: 900;
    background: var(--dark-nav);
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #000;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.1);
}

/* ==========================================================================
   10) CART DRAWER
   ========================================================================== */
#cartOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#cartDrawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 400px;
    max-width: 90%;
    height: 100vh;
    background: var(--bg-light);
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    border-left: 1px solid var(--nav-border);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    color: var(--text-main);
}

.cart-content {
    padding: 25px;
    flex-grow: 1;
    overflow-y: auto;
    color: var(--text-main);
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pop-anim { animation: pop 0.2s ease-in-out; }

/* ==========================================================================
   11) FOOTER
   ========================================================================== */
footer {
    background: #000;
    color: #a3a3a3;
    padding: 40px 0;
    text-align: center;
    font-size: 0.875rem;
    border-top: 1px solid var(--nav-border);
}

/* ==========================================================================
   12) TERMS & LEGAL PAGES (B2B Layout)
   ========================================================================== */
.legal-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 50px;
}

/* Venstre: Sticky Innholdsfortegnelse */
.legal-toc {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 100px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.legal-toc h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--dark-nav);
    padding-bottom: 10px;
    font-weight: 800;
}
.legal-toc ul { list-style: none; padding: 0; margin: 0; }
.legal-toc li { margin-bottom: 8px; }
.legal-toc a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
}
.legal-toc a:hover {
    color: var(--primary);
    background: #f8fafc;
    padding-left: 12px;
}

/* Høyre: Selve lovteksten */
.legal-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    color: var(--text-main);
    line-height: 1.7;
}
.legal-content h2 {
    margin: 40px 0 15px 0;
    font-size: 1.5rem;
    color: var(--dark-nav);
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
    scroll-margin-top: 100px; /* Sørger for at overskriften ikke havner under headeren ved klikk */
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content ul { margin-bottom: 20px; color: #4b5563; }

/* ==========================================================================
   12) MOBILE NAV (Off-canvas) - Default hidden on desktop
   ========================================================================== */
.mobile-menu-toggle { display: none; }
.mobile-nav-drawer { display: none; }

#mobileMenuOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#mobileMenuDrawer {
    position: fixed;
    top: 0;
    left: -350px;
    width: 300px;
    max-width: 80%;
    height: 100vh;
    background: var(--header-bg);
    z-index: 2000;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--nav-border);
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid var(--nav-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-content {
    padding: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.mobile-menu-content a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid var(--nav-border);
    font-weight: bold;
}

.mobile-menu-content a:hover { background: var(--primary); }

.legal-layout { grid-template-columns: 1fr; gap: 20px; }
.legal-toc { position: static; }
.legal-content { padding: 20px; }


/* ==========================================================================
   13) MOBILE (max-width: 992px) – samlet
   ========================================================================== */
@media (max-width: 992px) {

    /* --- HEADER: Skjul desktop-linjer --- */
    .header-top-bar, .header-bottom-nav { display: none; }

    /* --- HEADER: Bygg om layout --- */
    .header-main .container {
        flex-wrap: wrap;
        gap: 15px;
        padding: 15px 20px;

        display: grid;
        grid-template-columns: auto 1fr auto auto;
        align-items: center;
    }

    .logo-wrapper { padding: 5px; background: transparent; }
    .logo-wrapper img { height: 100px; }

    /* Søk tar full bredde i bunn */
    .search-wrapper {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 5px;
        grid-column: 1 / -1;
    }

    /* Handlekurv: skjul tekst */
    .header-cart-btn span { display: none; }
    .header-cart-btn { gap: 0; }

    /* Vis hamburger */
    .mobile-menu-toggle {
        display: block;
        background: transparent;
        border: none;
        color: white;
        font-size: 2rem;
        cursor: pointer;
        padding: 0 10px;
    }

    /* --- SINGLE PRODUCT: mobil --- */
    .product-top-grid { grid-template-columns: 1fr; gap: 20px; }
    .main-image-container { height: 300px; padding: 10px; }
    .product-info-card { padding: 20px; }
    .variants-section { padding: 15px; }

    /* Tabell -> kort */
    .compact-variant-table thead { display: none; }
    .compact-variant-table,
    .compact-variant-table tbody,
    .compact-variant-table tr,
    .compact-variant-table td { display: block; width: 100%; }

    .compact-variant-table tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    .compact-variant-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid #f1f5f9;
        padding: 12px 20px;
        box-sizing: border-box;
        gap: 15px;
    }

    .compact-variant-table td:last-child {
        border-bottom: none;
        background: #f8fafc;
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }

    .compact-variant-table td::before {
        display: block;
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.8rem;
        color: var(--text-muted);
        text-transform: uppercase;
        flex-shrink: 0;
    }

    .compact-variant-table td > * {
        max-width: 65%;
        word-wrap: break-word;
    }

    .buy-form { width: 100%; justify-content: space-between; }

    /* --- CATEGORY: mobil skuff --- */
    .category-page-layout { grid-template-columns: 1fr; }

    .mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        background: var(--dark-nav);
        color: white;
        padding: 12px;
        font-size: 1rem;
        font-weight: 800;
        border-radius: 6px;
        border: none;
        margin-bottom: 20px;
        cursor: pointer;
        text-transform: uppercase;
    }

    .category-sidebar {
        position: fixed;
        top: 0;
        left: -380px;
        width: 320px;
        max-width: 85%;
        height: 100vh;
        z-index: 2500;
        background: white;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        margin: 0;
        padding: 20px;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }

    .category-sidebar.open { left: 0; }

    .sidebar-close-btn {
        display: block;
        background: none;
        border: none;
        font-size: 2rem;
        color: var(--text-muted);
        cursor: pointer;
        position: absolute;
        top: 15px;
        right: 15px;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.7);
        z-index: 2499;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .horizontal-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-dropdown-content { width: 100%; }
    .filter-btn { justify-content: space-between; width: 100%; }

    /* --- CHECKOUT: mobil --- */
    .checkout-layout { grid-template-columns: 1fr; gap: 20px; }
    .order-summary-sidebar { position: static; padding: 20px; }
    .checkout-section { padding: 20px; }
}