/* ============================================================
 * D2 Design v1.0.0
 *
 * Layer 1 — Distribuerbare D2 tokens (markeret kopi)
 * TODO: Flyttes til digital2-childtheme/css/d2-tokens.css når
 *       central tokens-fil oprettes.
 * ============================================================ */

:root {
    --d2-orange:        #fc8902;
    --d2-orange-hover:  #e57a00;
    --d2-orange-tint:   rgba(252, 137, 2, 0.12);

    --d2-ink-strong:    #292929;
    --d2-ink:           #222222;
    --d2-ink-body:      #292929;
    --d2-ink-muted:     #444444;
    --d2-ink-faint:     #666666;

    --d2-surface:       #ffffff;
    --d2-surface-alt:   #f7f7f7;
    --d2-line:          #e8e8e8;
    --d2-line-strong:   #d8d8d8;

    --d2-font-display:  'Montserrat', Arial, Helvetica, sans-serif;
    --d2-font-body:     Arial, Helvetica, sans-serif;

    --d2-radius-sm:     4px;
    --d2-radius-md:     6px;
    --d2-radius-lg:     12px;
    --d2-radius-xl:     16px;

    --d2-ease:          cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ============================================================
 * Divi Theme Builder wrapper-override
 *
 * Tvinger Theme Builder header/footer-wrappers til fullbleed
 * (100% bredde, 0 padding/margin) så .d2d-header og .d2d-footer
 * kan fylde hele viewport. Bruger !important fordi Divi's
 * globale stylesheet bliver indsat efter vores og ellers vinder.
 *
 * Targetter kun TB header/footer (.et-l--header / .et-l--footer)
 * — ikke andre Divi-sektioner andre steder på sitet.
 * ============================================================ */

.et-l--header .et_pb_section,
.et-l--header .et_pb_row,
.et-l--header .et_pb_column,
.et-l--header .et_pb_module,
.et-l--header .et_pb_code_inner,
.et-l--footer .et_pb_section,
.et-l--footer .et_pb_row,
.et-l--footer .et_pb_column,
.et-l--footer .et_pb_module,
.et-l--footer .et_pb_code_inner {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Sikkerhedsnet: Divi tilføjer floats på kolonner. Når vi har én
   kolonne i fuld bredde må float ikke begrænse layouten. */
.et-l--header .et_pb_column,
.et-l--footer .et_pb_column {
    float: none !important;
}

/* ============================================================
 * Layer 2 — d2d-header feature
 *
 * Override af Divi/tema-CSS. Vi bruger høj specificitet
 * (.d2d-header foran child-selectors) for at vinde over Divi's
 * #main-header, .et_pb_module osv. uden !important hvor muligt.
 * ============================================================ */

/* ----- Theme Builder wrappers: tving fullbleed -----
 * Divi pakker [d2_header]/[d2_footer] i 7 niveauer wrappers,
 * hvor flere har default max-width fra temaet. Vi target dem
 * specifikt så vores layout kan fylde hele viewporten.
 */
.et-l--header .et_builder_inner_content,
.et-l--footer .et_builder_inner_content,
.et_pb_section_0_tb_header,
.et_pb_section_0_tb_footer,
.et_pb_row_0_tb_header,
.et_pb_row_0_tb_footer,
.et_pb_column_0_tb_header,
.et_pb_column_0_tb_footer,
.et_pb_code_0_tb_header,
.et_pb_code_0_tb_footer,
.et_pb_code_0_tb_header > .et_pb_code_inner,
.et_pb_code_0_tb_footer > .et_pb_code_inner {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.et_pb_section_0_tb_header,
.et_pb_section_0_tb_footer {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.d2d-header,
.d2d-header * {
    box-sizing: border-box;
}

.d2d-header {
    background: var(--d2-surface);
    font-family: var(--d2-font-body);
    border-bottom: 1px solid var(--d2-line);
    position: relative;
    z-index: 100;
    width: 100%;
    text-align: left;
}

/* Reset Divi's potentielle list-styling (bullets/discs/floats). */
.d2d-header ul,
.d2d-header li {
    list-style: none !important;
    list-style-type: none !important;
    background: none !important;
    padding-left: 0 !important;
    margin: 0;
}
.d2d-header ul li::before,
.d2d-header ul li::marker {
    content: none !important;
    display: none !important;
}

.d2d-header__top {
    border-bottom: 1px solid var(--d2-line);
}

.d2d-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    width: 100%;
    text-align: left;
}

.d2d-header__bottom .d2d-header__inner {
    height: 36px;
    min-height: 0;
    justify-content: flex-start;
    align-items: center;
    padding: 0 24px;
}

/* Hvis Divi pakker vores header i .et_pb_code/.et_pb_text wrappers,
   må de ikke begrænse bredde eller centrere indholdet. */
.et_pb_code .d2d-header,
.et_pb_text .d2d-header,
.et_pb_module .d2d-header,
.et_pb_row .d2d-header,
.et_pb_section .d2d-header {
    max-width: none;
    width: 100%;
    text-align: left;
}

/* ----- Logo (tekst) ----- */

.d2d-header-logo {
    font-family: var(--d2-font-display);
    font-weight: 800;
    font-size: 36px;
    line-height: 1;
    color: var(--d2-ink-strong);
    text-decoration: none;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    display: inline-block;
}
.d2d-header-logo:hover,
.d2d-header-logo:focus { color: var(--d2-ink-strong); text-decoration: none; }
.d2d-header-logo__accent { color: var(--d2-orange); }

/* ----- Actions group ----- */

.d2d-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ----- Icon button (base) ----- */

.d2d-header-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--d2-ink);
    background: transparent;
    border: none;
    border-radius: var(--d2-radius-md);
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    transition: background 0.18s var(--d2-ease), color 0.18s var(--d2-ease);
    position: relative;
    flex-shrink: 0;
}
.d2d-header-icon-btn:hover,
.d2d-header-icon-btn:focus {
    background: var(--d2-surface-alt);
    color: var(--d2-orange);
    text-decoration: none;
}
.d2d-header-icon-btn:focus-visible {
    outline: 2px solid var(--d2-orange);
    outline-offset: 2px;
}

/* ----- Cart badge ----- */

.d2d-header-cart-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    background: var(--d2-orange);
    color: #fff;
    font-family: var(--d2-font-display);
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
    box-sizing: border-box;
}
.d2d-header-cart-badge[hidden] { display: none; }

/* ----- Contact button ----- */

.d2d-header-contact-btn {
    background: var(--d2-ink-body);
    color: #fff;
    padding: 11px 22px;
    border-radius: var(--d2-radius-md);
    font-family: var(--d2-font-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.18s var(--d2-ease);
    margin-left: 6px;
    white-space: nowrap;
}
.d2d-header-contact-btn:hover,
.d2d-header-contact-btn:focus {
    background: var(--d2-ink-strong);
    color: #fff;
    text-decoration: none;
}

/* ----- Bottom row (mørk navigation bar, fullbleed) -----
 * Kombinerer to teknikker:
 * 1. Wrapper-overrides ovenfor sikrer at containerne er full-width
 * 2. box-shadow + clip-path fortsætter baggrunden visuelt selv hvis
 *    en ydre wrapper alligevel begrænser bredden
 */

.d2d-header__bottom {
    background: var(--d2-ink-body);
    box-shadow: 0 0 0 100vmax var(--d2-ink-body);
    clip-path: inset(0 -100vmax);
}

/* ----- Nav menu ----- */

.d2d-header-nav-wrap {
    display: flex;
    align-items: center;
    width: 100%;
}
.d2d-header-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
}
.d2d-header-nav li { margin: 0; padding: 0; }
.d2d-header-nav a {
    font-family: var(--d2-font-display);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.4px;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.15s var(--d2-ease);
    padding: 4px 0;
    display: inline-block;
}
.d2d-header-nav a:hover,
.d2d-header-nav a:focus,
.d2d-header-nav .current-menu-item > a,
.d2d-header-nav .current_page_item > a,
.d2d-header-nav .current-menu-ancestor > a {
    color: var(--d2-orange);
    text-decoration: none;
}

/* ----- Mobile toggle ----- */

.d2d-header-mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: var(--d2-radius-md);
    cursor: pointer;
    padding: 11px 9px;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
}
.d2d-header-mobile-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.2s var(--d2-ease), opacity 0.2s var(--d2-ease);
}
.d2d-header__bottom.is-open .d2d-header-mobile-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.d2d-header__bottom.is-open .d2d-header-mobile-toggle span:nth-child(2) {
    opacity: 0;
}
.d2d-header__bottom.is-open .d2d-header-mobile-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
 * SEARCH OVERLAY
 * ============================================================ */

.d2d-header-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    background: rgba(41, 41, 41, 0.97);
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s var(--d2-ease);
    pointer-events: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.d2d-header-overlay[hidden] { display: none; }
.d2d-header-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.d2d-header-overlay__top {
    background: var(--d2-ink-strong);
    padding: 28px 32px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 1;
}

.d2d-header-overlay__inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.d2d-header-overlay__body { padding: 24px 32px 60px; }
.d2d-header-overlay__body .d2d-header-overlay__inner { display: block; }

.d2d-header-overlay__icon { flex-shrink: 0; }

.d2d-header-overlay__input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--d2-orange);
    color: #fff;
    font-family: var(--d2-font-display);
    font-weight: 600;
    font-size: 22px;
    padding: 8px 0;
    outline: none;
    -webkit-appearance: none;
    border-radius: 0;
    min-width: 0;
}
.d2d-header-overlay__input::placeholder { color: rgba(255,255,255,0.4); font-weight: 400; }
.d2d-header-overlay__input::-webkit-search-cancel-button { -webkit-appearance: none; }

.d2d-header-overlay__close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-family: var(--d2-font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--d2-radius-md);
    transition: color 0.15s var(--d2-ease), background 0.15s var(--d2-ease);
    flex-shrink: 0;
}
.d2d-header-overlay__close:hover,
.d2d-header-overlay__close:focus { color: #fff; background: rgba(255,255,255,0.08); }
.d2d-header-overlay__esc {
    border: 1px solid rgba(255,255,255,0.3);
    padding: 2px 6px;
    border-radius: var(--d2-radius-sm);
    font-size: 11px;
}

.d2d-header-overlay__hint,
.d2d-header-overlay__loading,
.d2d-header-overlay__empty {
    color: rgba(255,255,255,0.55);
    font-size: 14px;
    text-align: center;
    padding: 60px 0;
    font-family: var(--d2-font-body);
}

/* ----- Resultater ----- */

.d2d-header-results__section { margin-bottom: 28px; }
.d2d-header-results__heading {
    font-family: var(--d2-font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: var(--d2-orange);
    text-transform: uppercase;
    margin: 0 0 12px;
}

.d2d-header-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
    transition: background 0.12s var(--d2-ease);
    border-radius: var(--d2-radius-md);
    margin: 0 -12px;
}
.d2d-header-result:last-child { border-bottom: none; }
.d2d-header-result:hover,
.d2d-header-result:focus {
    background: rgba(255,255,255,0.05);
    color: #fff;
    text-decoration: none;
}

.d2d-header-result__thumb {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--d2-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    font-family: var(--d2-font-display);
    font-weight: 800;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}
.d2d-header-result__thumb img {
    width: 100%; height: 100%;
    object-fit: contain;
    background: #fff;
}

.d2d-header-result__body { flex: 1; min-width: 0; }
.d2d-header-result__title {
    font-size: 15px;
    color: #fff;
    margin: 0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.d2d-header-result__meta {
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    margin: 2px 0 0;
}
.d2d-header-result__price {
    font-family: var(--d2-font-display);
    font-weight: 700;
    color: var(--d2-orange);
    font-size: 14px;
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
}
.d2d-header-result__price del {
    opacity: 0.5;
    font-weight: 400;
    margin-right: 6px;
    color: rgba(255,255,255,0.5);
}
.d2d-header-result__price ins {
    text-decoration: none;
}

.d2d-header-results__see-all {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}
.d2d-header-results__see-all a {
    color: var(--d2-orange);
    font-family: var(--d2-font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
}
.d2d-header-results__see-all a:hover { color: var(--d2-orange-hover); }

body.d2d-header-overlay-open { overflow: hidden; }

/* ============================================================
 * MOBILE — header
 * ============================================================ */

@media (max-width: 980px) {
    .d2d-header__inner { padding: 0 16px; min-height: 60px; }
    .d2d-header__bottom .d2d-header__inner { padding: 0 16px; }
    .d2d-header-logo { font-size: 28px; }
    .d2d-header-contact-btn { display: none; }
    .d2d-header__actions { gap: 4px; }

    .d2d-header-mobile-toggle { display: flex; }

    .d2d-header-nav-wrap {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--d2-ink-body);
        border-bottom: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 8px 24px rgba(0,0,0,0.16);
        display: none;
        z-index: 100;
    }
    .d2d-header__bottom { position: relative; }
    .d2d-header__bottom.is-open .d2d-header-nav-wrap { display: block; }

    .d2d-header-nav {
        flex-direction: column;
        gap: 0;
        padding: 8px 24px 16px;
    }
    .d2d-header-nav li { border-bottom: 1px solid rgba(255,255,255,0.08); }
    .d2d-header-nav li:last-child { border-bottom: none; }
    .d2d-header-nav a { padding: 14px 0; display: block; }

    /* Overlay på mobil */
    .d2d-header-overlay__top { padding: 18px; }
    .d2d-header-overlay__body { padding: 18px 18px 40px; }
    .d2d-header-overlay__input { font-size: 18px; }
    .d2d-header-overlay__esc { display: none; }
    .d2d-header-overlay__close { padding: 6px; }
    .d2d-header-overlay__inner { gap: 12px; }
}

@media (max-width: 480px) {
    .d2d-header-logo { font-size: 24px; }
    .d2d-header__actions .d2d-header-icon-btn { width: 36px; height: 36px; }
    .d2d-header-result__price { font-size: 13px; }
    .d2d-header-result__title { font-size: 14px; }
}

/* Print: skjul header */
@media print {
    .d2d-header, .d2d-header-overlay { display: none !important; }
}

/* ============================================================
 * Layer 2 — d2d-footer feature
 * ============================================================ */

.d2d-footer {
    background: var(--d2-ink-strong);
    color: rgba(255, 255, 255, 0.72);
    font-family: var(--d2-font-body);
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 0 0 100vmax var(--d2-ink-strong);
    clip-path: inset(0 -100vmax);
}

.d2d-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.d2d-footer__main {
    padding: 64px 0 48px;
}

.d2d-footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
    align-items: start;
}

/* ----- Brand kolonne ----- */

.d2d-footer-col--brand .d2d-footer-logo {
    display: inline-block;
    margin-bottom: 18px;
    text-decoration: none;
    line-height: 0;
}
.d2d-footer-col--brand .d2d-footer-logo img {
    max-width: 180px;
    height: auto;
    display: block;
}

.d2d-footer-about {
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.65;
    margin: 0 0 20px;
    max-width: 360px;
}

.d2d-footer-social {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.d2d-footer-social__link {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border-radius: var(--d2-radius-sm);
    text-decoration: none;
    transition: background 0.18s var(--d2-ease), color 0.18s var(--d2-ease);
}
.d2d-footer-social__link:hover,
.d2d-footer-social__link:focus {
    background: var(--d2-orange);
    color: #fff;
    text-decoration: none;
}

/* ----- Menu kolonner ----- */

.d2d-footer-col__heading {
    color: #fff;
    font-family: var(--d2-font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 16px;
    line-height: 1.3;
}

.d2d-footer-menu-wrap { display: block; }

.d2d-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
.d2d-footer-menu li {
    margin: 0;
    padding: 0;
}
.d2d-footer-menu a {
    display: inline-block;
    color: var(--d2-orange);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    padding: 5px 0;
    transition: color 0.15s var(--d2-ease);
}
.d2d-footer-menu a:hover,
.d2d-footer-menu a:focus {
    color: #ebebeb;
    text-decoration: none;
}
.d2d-footer-menu .current-menu-item > a,
.d2d-footer-menu .current_page_item > a {
    color: #ebebeb;
}

/* ----- Bottom bar (copyright) ----- */

.d2d-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 22px 0;
}
.d2d-footer-copyright {
    margin: 0;
    text-align: center;
}
.d2d-footer-copyright small {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    letter-spacing: 0.01em;
}

/* ----- Mobile — footer ----- */

@media (max-width: 980px) {
    .d2d-footer__inner { padding: 0 18px; }
    .d2d-footer__main { padding: 48px 0 32px; }
    .d2d-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px 24px;
    }
    .d2d-footer-col--brand {
        grid-column: 1 / -1;
        margin-bottom: 8px;
    }
}

@media (max-width: 560px) {
    .d2d-footer__grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .d2d-footer-col--brand { margin-bottom: 4px; }
}

/* Print: skjul footer */
@media print {
    .d2d-footer { display: none !important; }
}
