/* =========================================
   LADELØSNING OVERSIGT - CSS (Final: Image Fix, Font & Logo Fix)
   ========================================= */

.lader-wrapper {
    display: flex; gap: 30px; align-items: flex-start; width: 100%;
    font-family: 'Montserrat', sans-serif; box-sizing: border-box;
}
.lader-wrapper * { box-sizing: border-box; }

/* --- FONT FIX: TVING MONTSERRAT PÅ ALT (Også Elementor H4) --- */
.lader-wrapper select, 
.lader-wrapper input, 
.lader-wrapper button, 
.lader-wrapper textarea,
.lader-toggle-text,
.lader-sidebar-box h4 {
    font-family: 'Montserrat', sans-serif !important;
}

/* Specifik fix til overskrifter i sidebar for at undgå Elementor styles */
.lader-sidebar-box h4 {
    margin: 0 0 8px 0 !important; /* Mindre margin i bunden */
    font-size: 13px !important;   /* Lidt mindre skriftstørrelse for pænere look */
    text-transform: uppercase !important; 
    font-weight: 700 !important; 
    color: #1e293b !important;
    line-height: 1.4 !important;
}

/* SIDEBAR / FILTER */
.lader-sidebar-container { width: 280px; flex-shrink: 0; }
.lader-sidebar-box {
    background: #fff; border: 1px solid #e1e5ee; border-radius: 12px; padding: 20px; /* Lidt mindre padding */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-top: 13px;
}

/* --- MODERN TOGGLE SWITCH --- */
.lader-toggle-modern-wrapper {
    width: 100%;
    margin-bottom: 10px; /* Mindre afstand ned til linjen */
}
.lader-toggle-checkbox { display: none; }
.lader-toggle-track {
    display: flex; position: relative;
    background-color: #f1f5f9; 
    border-radius: 8px; 
    padding: 4px;
    cursor: pointer; user-select: none;
    border: 1px solid #e2e8f0;
}
.lader-toggle-text {
    flex: 1; text-align: center;
    font-size: 13px; font-weight: 600;
    color: #64748b; 
    z-index: 2; padding: 8px 0;
    transition: color 0.3s ease;
}
.lader-toggle-pill {
    position: absolute; top: 4px; left: 4px;
    width: calc(50% - 4px); height: calc(100% - 8px);
    background-color: #fff; border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1;
}
.lader-toggle-checkbox:checked + .lader-toggle-track .lader-toggle-pill {
    transform: translateX(100%);
}
.lader-toggle-text:first-child { color: #1e293b; } 
.lader-toggle-checkbox:checked + .lader-toggle-track .lader-toggle-text:first-child { color: #64748b; } 
.lader-toggle-checkbox:checked + .lader-toggle-track .lader-toggle-text:nth-child(2) { color: #1e293b; } 

/* SLIDER */
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 18px; width: 18px; border-radius: 50%;
    background: #FF8930; cursor: pointer; margin-top: -6px; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 6px; cursor: pointer; background: #eee; border-radius: 3px;
}
input[type=range]::-moz-range-thumb {
    height: 18px; width: 18px; border-radius: 50%; background: #FF8930; cursor: pointer; border: none;
}
input[type=range]::-moz-range-track {
    width: 100%; height: 6px; cursor: pointer; background: #eee; border-radius: 3px;
}

/* --- DROPDOWN STYLE --- */
.lader-period-select, #lader-sort-select {
    width: 100%; 
    padding: 8px 10px; /* Lidt strammere padding */
    border-radius: 8px; 
    border: 1px solid #ddd;
    font-size: 13px;
    background-color: #fff;
    cursor: pointer;
    color: #1e293b;
    outline: none;
}

/* LISTE & KORT */
.lader-list-container { display: flex; flex-direction: column; gap: 20px; width: 100%; }

.lader-card {
    background: #fff; border-radius: 5px; box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    position: relative; overflow: visible; display: flex; flex-direction: column;
    border: 1px solid #f0f0f0; border-left: 4px solid #2bb144;
    transition: transform 0.2s ease, box-shadow 0.2s ease; z-index: 1;
    margin-top: 15px;
}
.lader-card:not(.lader-card-passive):hover { 
    transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); 
}

.lader-badge-featured {
    position: absolute; top: -12px; left: 24px;
    background: #e5f3e8; color: #2bb144; font-size: 10px; font-weight: 800;
    text-transform: uppercase; padding: 6px 12px; border-radius: 6px;
    letter-spacing: 0.5px; z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.lader-row { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
    padding: 24px 24px 5px 24px; 
}

/* BILLEDE */
.lader-img-wrapper {
    position: relative; width: 110px; height: 110px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 0;
}
.lader-product-img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
    display: block;
    mix-blend-mode: multiply; /* FIX: Gør hvid baggrund på jpg/png transparent */
}

/* BRAND BADGE */
.lader-brand-badge {
    position: absolute; bottom: -10px; right: -10px; 
    width: 65px; height: 65px; 
    background: #fff; border-radius: 50%; padding: 2px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff; z-index: 5;
}
.lader-brand-badge img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }

/* --- OBS BADGE --- */
.lader-obs-wrapper {
    position: absolute;
    top: -12px; 
    left: 24px; 
    display: inline-block;
    cursor: pointer;
    z-index: 20;
    width: max-content;
}
.lader-badge-obs {
    display: inline-flex; align-items: center; gap: 4px;
    background-color: #fee2e2; border: 1px solid #fee2e2;
    color: #991b1b; padding: 3px 8px; border-radius: 99px; 
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; transition: all 0.2s ease; white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.lader-badge-obs:hover { background-color: #fca5a5; }
.lader-icon-warn { color: #d97706; font-size: 11px; margin-right: 1px; }

/* OBS TOOLTIP */
.lader-obs-tooltip {
    display: none; 
    position: absolute; 
    bottom: 100%; 
    left: 50%;
    transform: translate(-50%, 0); 
    width: 600px;      
    max-width: 90vw;   
    background: #fff; 
    border: 1px solid #ef4444; 
    border-radius: 8px; 
    padding: 12px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 100; 
    text-align: left; 
    font-size: 12px; 
    color: #7f1d1d; 
    background-color: #fef2f2; 
    margin-bottom: 8px;
    pointer-events: none;
}
.lader-obs-tooltip::after {
    content: ""; position: absolute; top: 100%; left: 50%; 
    transform: translateX(-50%); border-width: 5px; border-style: solid;
    border-color: #ef4444 transparent transparent transparent; 
}

@media (min-width: 901px) {
    .lader-obs-wrapper:hover .lader-obs-tooltip { 
        display: block; 
        animation: laderFadeInObs 0.2s ease-out forwards; 
    }
}
.lader-obs-wrapper.active .lader-obs-tooltip { 
    display: block; 
    animation: laderFadeInObs 0.2s ease-out forwards; 
}

/* INFO */
.lader-content-col {
    display: flex; flex-direction: column; justify-content: center;
    align-items: center; text-align: center; flex: 1; margin-bottom: 0;
}
.lader-info-header { display: none; } 
.lader-name { margin: 0; font-size: 18px; font-weight: 800; color: #1e293b; }

/* STATS DESKTOP */
.lader-stats-row {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 10px; 
    width: 100%;
}
.lader-stat-col { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    flex: 1;
}

/* Justeret bredde-fordeling for at give plads til "Estimeret pris 6 mdr" */
.lader-stat-col:nth-child(1) { width: 25%; } 
.lader-stat-col:nth-child(2) { width: 25%; } 
.lader-stat-col:nth-child(3) { width: 50%; } 

.lader-price-title {
    font-size: 11px; color: #64748b; text-transform: uppercase;
    letter-spacing: 0.6px; margin-bottom: 4px; font-weight: 700;
    white-space: nowrap; 
}
.lader-price-value {
    font-size: 19px; font-weight: 800; color: #2d3748; line-height: 1.2;
}
.lader-price-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; font-weight: 500; }

/* CTA */
.lader-cta-col { 
    text-align: center; 
    flex-shrink: 0; 
    padding-bottom: 0;
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    z-index: 5; 
    width: 200px;
}
.lader-btn {
    background: #FF8930; color: #fff !important; text-decoration: none !important;
    padding: 14px 28px; border-radius: 99px; font-weight: 600; font-size: 15px;
    display: inline-block; transition: 0.2s; box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important;
    border: none; cursor: pointer; white-space: nowrap;
}
.lader-btn:hover { background: #e67a29; transform: translateY(-1px); }

/* --- NO COLLAB TOOLTIP --- */
.lader-no-collab-wrapper {
    position: relative; cursor: pointer; z-index: 20; 
    display: flex; 
    justify-content: flex-end; 
}
.lader-no-collab-badge {
    display: inline-flex; align-items: center; gap: 6px;
    color: #4b5563; font-size: 10px; font-weight: 600;
    text-decoration: none; margin-top: 5px; white-space: nowrap; 
    max-width: 100%; text-align: left; line-height: 1.3;
}
.lader-no-collab-badge:hover { text-decoration: underline; }
.lader-no-collab-icon {
    background: #6b7280; color: #fff; border-radius: 50%;
    width: 14px; height: 14px; display: inline-flex;
    justify-content: center; align-items: center;
    font-size: 10px; font-weight: 700; flex-shrink: 0; 
}
.lader-no-collab-tooltip {
    display: none; position: absolute; bottom: 100%; right: 0; 
    width: 250px; background: #fff; border: 1px solid #e5e7eb; 
    border-radius: 8px; padding: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 100; text-align: left; font-size: 12px; color: #4b5563;
    line-height: 1.4; margin-bottom: 10px;
    pointer-events: none;
}
.lader-no-collab-tooltip::after {
    content: ""; position: absolute; top: 100%; right: 20px; 
    margin-left: -5px; border-width: 6px; border-style: solid;
    border-color: #fff transparent transparent transparent; 
}
.lader-no-collab-tooltip::before {
    content: ""; position: absolute; top: 100%; right: 20px;
    margin-left: -5px; border-width: 7px; border-style: solid;
    border-color: #e5e7eb transparent transparent transparent; 
}

/* Triggers for collab tooltip */
@media (min-width: 901px) {
    .lader-no-collab-wrapper:hover .lader-no-collab-tooltip { 
        display: block; 
        animation: laderFadeInSimple 0.2s ease-out forwards; 
    }
}
.lader-no-collab-wrapper.active .lader-no-collab-tooltip { 
    display: block; 
    animation: laderFadeInSimple 0.2s ease-out forwards; 
}

/* ANIMATIONER */
@keyframes laderFadeInObs { 
    from { opacity: 0; transform: translate(-50%, 10px); } 
    to { opacity: 1; transform: translate(-50%, 0); } 
}

@keyframes laderFadeInSimple { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@keyframes laderFadeInSimpleCentered { 
    from { opacity: 0; transform: translate(-50%, 10px); } 
    to { opacity: 1; transform: translate(-50%, 0); } 
}

@keyframes laderFadeIn { 
    from { opacity: 0; transform: translateY(-5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* --- PRISDETALJER LINK --- */
.lader-card-footer {
    padding: 0 24px 15px 24px;
    display: flex; justify-content: flex-end; 
    margin-top: -15px; position: relative; z-index: 5;
}
.lader-toggle-details {
    font-size: 10px; cursor: pointer; color: #6b7280; font-weight: 600;
    display: inline-flex; align-items: center; user-select: none;
    text-transform: uppercase; transition: color 0.2s;
}
.lader-toggle-details:hover { color: #111; }
.lader-toggle-details.open svg { transform: rotate(180deg); }
.lader-toggle-details svg { transition: transform 0.3s ease; margin-left: 4px; }

/* --- DETALJE BOKS --- */
.lader-details-wrapper {
    display: none; border-top: 1px solid #f3f4f6;
    background-color: #fff; padding: 20px 24px;
    border-radius: 0 0 5px 5px; animation: laderFadeIn 0.3s ease;
}

/* Headers */
.lader-detail-header {
    font-size: 11px; text-transform: uppercase; color: #111; font-weight: 700;
    margin-bottom: 6px; letter-spacing: 0.5px;
}

/* Rækker */
.lader-detail-row {
    display: flex; justify-content: space-between; align-items: flex-end; 
    padding: 8px 0; border-bottom: 1px solid #e5e7eb;
    font-size: 13px; color: #374151;
}
.lader-detail-row:last-of-type { border-bottom: none; }
.lader-detail-row span:last-child { 
    font-weight: 600; color: #1f2937; white-space: nowrap; line-height: 1.2; 
}

/* Venstre kolonne gruppe */
.lader-detail-label-group { display: flex; flex-direction: column; }
.lader-detail-sub { font-size: 11px; color: #9ca3af; margin-top: 1px; font-weight: 400; }

/* TOTAL LINJE */
.lader-total-row {
    display: flex; justify-content: space-between; align-items: flex-end; 
    padding: 10px 0; margin-top: 10px; font-weight: 800; font-size: 14px; color: #111;
}

/* =========================================
   MOBIL STYLING - JUSTERET LAYOUT (Split-View)
   ========================================= */

@media (max-width: 900px) {
    .lader-card:not(.lader-card-passive):hover { 
        transform: none; 
    }

    .lader-wrapper { flex-direction: column; gap: 20px; }
    .lader-sidebar-container { width: 100%; }
    
    .lader-card {
        border: none;
        margin-top: 15px;
        border-radius: 18px;
        box-shadow: 0 12px 32px rgba(0,0,0,0.14);
        border-left: none;
    }

    /* Centrer badges på mobil */
    .lader-badge-featured, .lader-obs-wrapper { 
        left: 50%; transform: translateX(-50%); top: -12px; 
    }

    /* MAGIC: Brug display:contents til at "ophæve" containere så vi kan flytte indholdet */
    .lader-content-col,
    .lader-stats-row {
        display: contents !important;
    }

    /* GRID SYSTEM FOR KORT - NYT LAYOUT */
    .lader-row {
        display: grid !important; 
        grid-template-columns: 1fr 1fr; /* To lige store kolonner */
        grid-template-areas:
            "logo total"     /* Top: Billede - Mindstepris */
            "setup service"  /* Midt: Oprettelse - Service */
            "btn btn";       /* Bund: Knap (Fuld bredde) */
        padding: 20px 15px;
        column-gap: 15px;
        row-gap: 15px; 
        align-items: center;
        text-align: center;
    }

    /* --- BILLEDE / LOGO (Top Venstre) --- */
    .lader-img-wrapper {
        grid-area: logo;
        justify-self: center;
        /* NUCLEAR OPTION: Tving dimensioner og layout */
        width: 110px !important;
        height: 90px !important;
        
        position: relative !important; /* VIGTIGT: Containeren er anker */
        overflow: visible !important;  /* RETTELSE: Tillad logo at stikke ud */
        
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-top: 5px !important; 
        margin-bottom: 0 !important;
    }

    .lader-product-img {
        /* VIGTIGT: Tag billedet ud af flowet så det ikke kan presse containeren */
        position: absolute !important;
        top: 0; left: 0;
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        z-index: 1; /* Sørg for at billedet ligger under logoet */
        
        max-width: none !important; /* Overskriv globale regler */
        max-height: none !important;
    }
    
    .lader-brand-badge {
        z-index: 10 !important; /* Tving logo øverst */
    }

    /* --- MINDSTEPRIS (Top Højre) --- */
    .lader-stat-col:nth-child(3) { 
        grid-area: total;
        width: auto !important; /* Nulstil desktop bredde */
        border: none !important;
        padding: 0 !important;
        display: flex; flex-direction: column; justify-content: center;
    }

    /* --- OPRETTELSE (Midt Venstre) --- */
    .lader-stat-col:nth-child(1) { 
        grid-area: setup;
        width: auto !important; 
        border-right: 1px solid #f0f0f0 !important; /* Lille separator */
        padding: 10px 0 !important;
    }

    /* --- SERVICEAFTALE (Midt Højre) --- */
    .lader-stat-col:nth-child(2) { 
        grid-area: service;
        width: auto !important;
        padding: 10px 0 !important;
    }
    
    .lader-stat-col {
        background: transparent;
        flex: none;
    }

    /* TOOLTIP FIX FOR MOBIL */
    .lader-no-collab-wrapper { justify-content: center; } 
    
    .lader-no-collab-tooltip {
        left: 50%;
        right: auto;
        transform: translate(-50%, 0);
        max-width: 85vw;
    }
    .lader-no-collab-tooltip::after, .lader-no-collab-tooltip::before {
        right: 50%;
        margin-right: -5px;
    }
    
    .lader-no-collab-wrapper.active .lader-no-collab-tooltip { 
        animation: laderFadeInSimpleCentered 0.2s ease-out forwards; 
    }

    .lader-price-title { font-size: 10px; font-weight: 700; color: #64748b; }
    
    /* GENEREL MOBIL FONT (18px) */
    .lader-price-value { font-size: 18px; font-weight: 800; }
    
    /* NY: SPECIFIKT FOR TOTALPRISEN (Kolonne 3) - Gør den større */
    .lader-stat-col:nth-child(3) .lader-price-value {
        font-size: 26px; /* Opjusteret fra 18px */
    }

    .lader-price-sub { font-size: 10px; }

    /* CTA KNAP (Bund) */
    .lader-cta-col {
        grid-area: btn;
        width: 100%;
        padding-top: 0;
        margin-top: 5px; 
    }
    .lader-btn {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        border-radius: 99px;
    }

    .lader-card-footer { 
        justify-content: center; margin-top: -5px; padding-bottom: 20px;
    }

    /* FIX: DYNAMISK BREDDE PÅ GRØN USP BOKS (Kun på mobil) */
    .lader-badge-featured {
        width: max-content;       /* Sørger for at boksen kun fylder tekstens bredde */
        max-width: 85%;           /* Sikrer at den aldrig går helt ud til kanten */
        white-space: normal;      /* Tillader teksten at knække til to linjer */
        text-align: center;       /* Centrerer teksten hvis den knækker */
        line-height: 1.25;        /* Pæn afstand mellem linjer */
        height: auto;             /* Tillader boksen at blive højere */
    }

} /* <--- HER LUKKER VI MOBIL REGLERNE (VIGTIGT!) */

/* Specifik lille justering til helt små skærme */
@media (max-width: 600px) {
    .lader-stat-col:nth-child(1) { border-right: 1px solid #f0f0f0 !important; }
}