/*
 * D2 Checkout — Shell styling
 *
 * Shared mellem /dit-koeb/, /checkout/, /tak-for-din-ordre/
 * (header, trust-bar, footer, base body, links, buttons)
 *
 * NB: Forventer d2-tokens.css er enqueued globalt fra digital2-childtheme
 * — alle var(--d2-xxx) defineres dér. Defensive fallbacks i kritiske
 * komponenter for sikkerhed.
 */

/* ========================================
   Page-scope reset (defensive)
   ======================================== */
body.d2-checkout-page,
body.d2-checkout-page * {
    box-sizing: border-box;
}

body.d2-checkout-page {
    background: var(--d2-surface-alt, #f7f7f7);
    color: var(--d2-ink-body, #292929);
    font-family: var(--d2-font-body, Arial, Helvetica, sans-serif);
    font-size: 16px;
    line-height: 1.55;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

body.d2-checkout-page h1,
body.d2-checkout-page h2,
body.d2-checkout-page h3,
body.d2-checkout-page h4 {
    font-family: var(--d2-font-display, 'Montserrat', Arial, sans-serif);
    color: var(--d2-ink, #222);
    margin: 0;
    letter-spacing: -0.015em;
}

body.d2-checkout-page a {
    color: var(--d2-orange, #fc8902);
    text-decoration: none;
}

body.d2-checkout-page a:hover {
    color: var(--d2-orange-hover, #e57a00);
}

/* Skjul theme-rester der måtte sive igennem */
body.d2-checkout-page #masthead,
body.d2-checkout-page .et-l--header,
body.d2-checkout-page .et-l--footer,
body.d2-checkout-page #colophon,
body.d2-checkout-page .et_pb_section {
    display: none !important;
}

/* ========================================
   Closed-checkout HEADER (sort baggrund — matcher digital2.dk brand)
   ======================================== */
.d2cc-header {
    background: var(--d2-ink-strong, #1a1a1a);
    border-bottom: none;
    padding: 20px 32px;
}

.d2cc-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.d2cc-logo {
    font-family: var(--d2-font-display, 'Montserrat', sans-serif);
    font-weight: 800;
    font-size: 26px;
    color: #fff !important;
    letter-spacing: -0.04em;
    text-decoration: none;
    line-height: 1;
}

.d2cc-logo span {
    color: var(--d2-orange, #fc8902) !important;
}

.d2cc-logo:hover,
.d2cc-logo:focus {
    color: #fff !important;
    text-decoration: none;
}

.d2cc-header__help {
    font-family: var(--d2-font-display, 'Montserrat', sans-serif);
    font-weight: 600;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    transition: color 0.15s var(--d2-ease, cubic-bezier(0.2, 0.8, 0.2, 1));
}

.d2cc-header__help:hover,
.d2cc-header__help:focus {
    color: var(--d2-orange, #fc8902) !important;
}

/* ========================================
   TRUST BAR
   ======================================== */
.d2cc-trust {
    background: var(--d2-surface, #fff);
    border-bottom: 1px solid var(--d2-line, #e8e8e8);
    padding: 12px 32px;
}

.d2cc-trust__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--d2-ink-muted, #444);
    font-weight: 500;
}

.d2cc-trust__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.d2cc-trust__item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.d2cc-trust__item--secure svg {
    color: #08c451;
}

.d2cc-trust__item--payment svg {
    color: var(--d2-ink-muted, #444);
}

.d2cc-trust__brands {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.d2cc-trust__brand {
    background: var(--d2-surface-alt, #f7f7f7);
    border: 1px solid var(--d2-line, #e8e8e8);
    border-radius: 3px;
    padding: 2px 6px;
    font-family: var(--d2-font-display, 'Montserrat', sans-serif);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--d2-ink, #222);
}

/* ========================================
   PAGE TITLE
   ======================================== */
.d2cc-page-title {
    max-width: 1200px;
    margin: 32px auto 24px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.d2cc-page-title h1 {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
}

.d2cc-page-title__meta {
    font-size: 14px;
    color: var(--d2-ink-faint, #666);
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.d2cc-main {
    max-width: 1200px;
    margin: 24px auto 60px;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   SECTION CARD (shared)
   ======================================== */
.d2cc-section {
    background: var(--d2-surface, #fff);
    border: 1px solid var(--d2-line, #e8e8e8);
    border-radius: var(--d2-radius-lg, 12px);
    padding: 36px 40px;
}

.d2cc-section__eyebrow {
    font-family: var(--d2-font-display, 'Montserrat', sans-serif);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--d2-orange, #fc8902);
    margin: 0 0 8px;
}

.d2cc-section__title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.2;
}

.d2cc-section__lead {
    font-size: 15px;
    color: var(--d2-ink-muted, #444);
    margin: 0 0 28px;
    max-width: 720px;
}

/* ========================================
   D2 BUTTON SYSTEM
   ======================================== */
.d2-btn,
body.d2-checkout-page .d2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--d2-font-display, 'Montserrat', sans-serif);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    border: 1.5px solid transparent;
    border-radius: var(--d2-radius-md, 6px);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s var(--d2-ease, cubic-bezier(0.2, 0.8, 0.2, 1));
    letter-spacing: 0.01em;
}

.d2-btn--primary {
    background: var(--d2-orange, #fc8902);
    color: #fff;
    border-color: var(--d2-orange, #fc8902);
}

.d2-btn--primary:hover {
    background: var(--d2-orange-hover, #e57a00);
    border-color: var(--d2-orange-hover, #e57a00);
    color: #fff;
}

.d2-btn--ghost-dark {
    background: transparent;
    color: var(--d2-ink, #222);
    border-color: var(--d2-line-strong, #d8d8d8);
}

.d2-btn--ghost-dark:hover {
    border-color: var(--d2-ink, #222);
    color: var(--d2-ink, #222);
}

.d2-btn--full {
    width: 100%;
    padding: 16px 28px;
    font-size: 16px;
}

/* ========================================
   TRUST ROW (bottom on cart/checkout)
   ======================================== */
.d2cc-trust-row {
    background: var(--d2-surface, #fff);
    border: 1px solid var(--d2-line, #e8e8e8);
    border-radius: var(--d2-radius-lg, 12px);
    padding: 22px 32px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    font-size: 13px;
    color: var(--d2-ink-muted, #444);
}

.d2cc-trust-row__item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.d2cc-trust-row__item svg {
    width: 22px;
    height: 22px;
    color: #08c451;
    flex-shrink: 0;
}

.d2cc-trust-row__item strong {
    display: block;
    font-family: var(--d2-font-display, 'Montserrat', sans-serif);
    font-weight: 700;
    color: var(--d2-ink, #222);
    font-size: 14px;
}

/* ========================================
   FOOTER
   ======================================== */
.d2cc-footer {
    background: var(--d2-surface, #fff);
    border-top: 1px solid var(--d2-line, #e8e8e8);
    padding: 24px 32px;
    margin-top: 0;
}

.d2cc-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--d2-ink-faint, #666);
}

.d2cc-footer__links {
    display: flex;
    gap: 24px;
}

.d2cc-footer__links a {
    color: var(--d2-ink-faint, #666);
    text-decoration: none;
    transition: color 0.15s;
}

.d2cc-footer__links a:hover {
    color: var(--d2-orange, #fc8902);
}

/* ========================================
   WOO NOTICES (consistent styling)
   ======================================== */
.woocommerce-notices-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.woocommerce-notices-wrapper:empty {
    display: none;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border: 1px solid var(--d2-line, #e8e8e8);
    border-radius: var(--d2-radius-md, 6px);
    padding: 14px 18px 14px 21px !important;
    margin-bottom: 12px;
    font-size: 14px;
}

/* Background gradients til stripe — bulletproof full-height */
.woocommerce-message {
    background:
        linear-gradient(#08c451, #08c451) left / 3px 100% no-repeat,
        var(--d2-surface, #fff);
}
.woocommerce-info {
    background:
        linear-gradient(var(--d2-orange, #fc8902), var(--d2-orange, #fc8902)) left / 3px 100% no-repeat,
        var(--d2-surface, #fff);
}
.woocommerce-error {
    background:
        linear-gradient(#cc0000, #cc0000) left / 3px 100% no-repeat,
        var(--d2-surface, #fff);
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-message {
    /* border-left fjernet — stripe leveres af ::before */
    background: #ecfbf2;
}
.woocommerce-error {
    background: #fef2f2;
    color: #7a1414;
}
/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 980px) {
    .d2cc-trust__inner {
        gap: 20px;
    }
    .d2cc-trust-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .d2cc-page-title h1 {
        font-size: 26px;
    }
    .d2cc-section {
        padding: 24px 20px;
    }
}

@media (max-width: 720px) {
    .d2cc-header {
        padding: 16px 20px;
    }
    .d2cc-trust {
        padding: 10px 20px;
    }
    .d2cc-trust__inner {
        font-size: 12px;
        gap: 14px;
    }
    .d2cc-main {
        padding: 0 16px;
    }
}
