/**
 * DAT Vehicle Import - Warranty & GARAN Label Styles
 * Compliant with EU Directive 2024/825 (Empowering Consumers) & BGB
 */

/* ── Local Inter Font Definitions (GDPR / DSGVO Compliant) ── */
@font-face {
    font-family: 'Inter';
    font-weight: 400;
    font-style: normal;
    src: url('../fonts/Inter-Regular.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    font-weight: 700;
    font-style: normal;
    src: url('../fonts/Inter-Bold.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    font-weight: 800;
    font-style: normal;
    src: url('../fonts/Inter-ExtraBold.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'Inter-ExtraBold';
    font-weight: 800;
    font-style: normal;
    src: url('../fonts/Inter-ExtraBold.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'Inter-Regular';
    font-weight: 400;
    font-style: normal;
    src: url('../fonts/Inter-Regular.woff2') format('woff2');
    font-display: swap;
}

/* ── Base Container ── */
.dat-warranty-container {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 12px 0;
    clear: both;
}

.dat-warranty-container * {
    box-sizing: border-box;
}

/* ── Close Button & Dedicated Header Row ── */
.dat-warranty-close-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    margin-bottom: 6px;
}

.dat-warranty-close-row--modal {
    padding: 10px 14px 0 14px;
    margin-bottom: 0;
}

.dat-warranty-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #94a3b8 !important;
    font-size: 36px !important;
    line-height: 1 !important;
    font-weight: 300 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    cursor: pointer;
    border-radius: 50% !important;
    transition: color 0.15s ease, background-color 0.15s ease;
    text-decoration: none !important;
}

.dat-warranty-close-btn:hover,
.dat-warranty-close-btn:focus-visible {
    color: #475569 !important;
    background-color: rgba(0, 0, 0, 0.06) !important;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ── GARAN Label: Nested Display (Horizontal Banner) ── */
.dat-warranty-garan--nested {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.dat-garan-nested-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    cursor: pointer;
    position: relative;
    user-select: none;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dat-garan-nested-wrapper:hover {
    opacity: 0.98;
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dat-garan-nested-svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-width: 0;
    background: #ffffff;
}

.dat-garan-nested-svg rect.cls-4,
.dat-garan-nested-svg rect.dat-gn-cls-4,
.dat-garan-nested-svg .dat-garan-bg-white {
    fill: #ffffff !important;
}

/* ── GARAN Label: Full Display (Square Color SVG) ── */
.dat-garan-full-wrapper {
    display: block;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.dat-garan-full-svg {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.08));
    border-radius: 4px;
    background: #ffffff;
}

/* ── Tooltip Popover for GARAN Nested ── */
.dat-garan-tooltip {
    position: fixed;
    z-index: 9999999;
    display: none;
    pointer-events: auto;
    max-width: 440px;
    width: calc(100vw - 32px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 10px 14px 14px 14px;
    border: 1px solid #ddd;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.dat-garan-tooltip.dat-visible {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.dat-garan-tooltip .dat-garan-full-svg {
    box-shadow: none;
    filter: none;
}

/* ── Toggle Drawer for Nested Labels (Opened Box on Hover) ── */
.dat-warranty-toggle-drawer {
    display: none;
    position: relative;
    margin-top: 10px;
    padding: 10px 14px 14px 14px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: datFadeSlideDown 0.25s ease forwards;
    box-sizing: border-box;
    width: 100%;
}

.dat-warranty-toggle-drawer.dat-open {
    display: block;
}

.dat-warranty-toggle-drawer .dat-garan-full-wrapper {
    max-width: 440px;
    margin: 0 auto;
}

@keyframes datFadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Gesetzliche Gewährleistung: Nested Label / Box ── */
.dat-gewaehrleistung-nested {
    display: block;
    width: 100%;
}

.dat-gewaehrleistung-label,
.dat-gewaehrleistung-badge {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
    display: block;
    text-align: left;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    user-select: none;
}

.dat-gewaehrleistung-label:hover,
.dat-gewaehrleistung-label:focus-visible,
.dat-gewaehrleistung-badge:hover,
.dat-gewaehrleistung-badge:focus-visible {
    background-color: #f9f9f9;
    border-color: #ccc;
    outline: none;
}

.dat-gewaehrleistung-label__name,
.dat-gewaehrleistung-name {
    font-size: 24px;
    line-height: 1.6;
    font-weight: 600;
    color: #333;
}

/* ── Gesetzliche Gewährleistung: Full Unnested Notice (SVG) ── */
.dat-gewaehrleistung-full {
    display: block;
    width: 100%;
}

.dat-gewaehrleistung-full-wrapper {
    display: block;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.dat-gewaehrleistung-full-svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    background: #ffffff;
}

/* ── Full-Screen Legal Notice Modal ── */
.dat-warranty-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dat-warranty-modal-backdrop.dat-modal-active {
    opacity: 1;
    visibility: visible;
}

.dat-warranty-modal-window {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.dat-warranty-modal-backdrop.dat-modal-active .dat-warranty-modal-window {
    transform: scale(1);
}

.dat-warranty-modal-body {
    padding: 8px 16px 16px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    background: #ffffff;
}

.dat-warranty-modal-body .dat-gewaehrleistung-full-svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* ── Mobile responsiveness ── */
@media (max-width: 640px) {
    .dat-warranty-modal-backdrop {
        padding: 10px;
    }
    .dat-warranty-modal-window {
        max-height: 96vh;
        border-radius: 6px;
    }
    .dat-warranty-modal-body {
        padding: 6px 12px 12px 12px;
    }
    .dat-garan-tooltip {
        left: 16px !important;
        right: 16px !important;
        width: calc(100vw - 32px) !important;
        max-width: none !important;
    }
}
