/**
 * Consors Finanz – CCD2 information (PDP + Hyvä checkout).
 * Plain CSS on purpose: the module templates are not part of the theme's Tailwind purge paths.
 */

/* "Bitte beachten: Kredite kosten Geld" */
.cf-credit-notice {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0.25rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #374151;
}

.cf-credit-notice__icon {
    flex-shrink: 0;
    color: #00965e;
}

/* PDP teaser: centered below "Finanzieren Sie bequem mit Consors Finanz." */
.product-financing-example .cf-credit-notice {
    justify-content: center;
}

/* Checkout: headline */
.cf-ccd2-title strong {
    font-weight: 700;
}

/* Checkout: detail box of the selected method */
.cf-ccd2 {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1f2937;
}

.cf-ccd2__row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.cf-ccd2__pictogram {
    flex-shrink: 0;
    width: 1.5rem;
    height: auto;
    margin-top: 0.125rem;
}

.cf-ccd2__text p {
    margin: 0;
}

.cf-ccd2__text u {
    font-weight: 700;
}

.cf-ccd2__text strong,
.cf-ccd2__bullets strong {
    font-weight: 700;
}

.cf-ccd2__dash-list {
    margin: 0;
    padding-left: 0.75rem;
    list-style: none;
}

.cf-ccd2__dash-list li::before {
    content: "- ";
}

.cf-ccd2__bullets {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.cf-ccd2__bullets li + li {
    margin-top: 0.25rem;
}

.cf-ccd2 .cf-credit-notice {
    align-self: flex-end;
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background: #f3f4f6;
    font-size: 0.8125rem;
}

.cf-ccd2 .cf-credit-notice__icon {
    color: #111827;
}

/* "Konditionen und weitere Laufzeiten>" incl. hover information */
/* static on purpose: the tooltip spans the full detail box but keeps its vertical position below the link */
.cf-ccd2__conditions {
    position: static;
    align-self: flex-start;
    margin-left: 2.25rem;
}

.cf-ccd2__link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.cf-ccd2__link:hover,
.cf-ccd2__link:focus-visible {
    color: #00965e;
}

.cf-ccd2__tooltip {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    max-height: min(26rem, 60vh);
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    color: #1f2937;
}

.cf-ccd2__table {
    width: 100%;
    margin-bottom: 0.75rem;
    border-collapse: collapse;
    font-size: 0.8125rem;
    text-align: center;
}

.cf-ccd2__table th,
.cf-ccd2__table td {
    padding: 0.5rem 0.375rem;
    border-bottom: 1px solid #e5e7eb;
}

.cf-ccd2__table th {
    background: #f3f4f6;
    font-weight: 700;
}

.cf-ccd2__legal {
    font-size: 0.6875rem;
    line-height: 1.4;
}

.cf-ccd2__legal p {
    margin: 0 0 0.375rem;
}

/* Checkout: rate calculator dialog */
.cf-rate-calculator-dialog {
    width: min(64rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.5rem 2rem 2rem;
    box-sizing: border-box;
}

.cf-rate-calculator-dialog__header {
    position: sticky;
    top: -1.5rem;
    z-index: 1;
    margin-top: -1.5rem;
    padding-top: 1.5rem;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.cf-rate-calculator-dialog__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 400;
}

.cf-rate-calculator-dialog__close {
    padding: 0 0.25rem;
    border: 0;
    background: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 767px) {
    .cf-ccd2__conditions {
        margin-left: 0;
    }

    .cf-rate-calculator-dialog {
        padding: 1rem;
    }
}

/*
 * Rate calculator v2.5.4 layout (PDP tab + checkout dialog).
 * The vendor flex row squeezes the legal text into a narrow column; use a grid instead:
 * calculator on the left, table and legal text on the right, stacked on narrow containers.
 */
.calculator-box {
    container-type: inline-size;
}

.calculator-box .calculator {
    display: grid;
    grid-template-columns: minmax(16rem, 18.75rem) minmax(0, 1fr);
    grid-template-areas:
        "wrapper table"
        "wrapper legal";
    grid-template-rows: auto 1fr;
    gap: 1.5rem 2rem;
    align-items: start;
}

.calculator-box .calculator .calculator-wrapper {
    grid-area: wrapper;
    display: block;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.calculator-box .calculator .table-container {
    grid-area: table;
    padding: 0;
}

.calculator-box .calculator .legal-text {
    grid-area: legal;
    order: 0;
    padding: 0;
    color: #2d2926;
}

.calculator-box .calculator .legal-text .mm-headline2,
.calculator-box .table-container .mm-headline2 {
    display: block;
    margin: 0 0 0.625rem;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.25;
    color: #2d2926;
}

.calculator-box .calculator .legal-text > div,
.calculator-box .calculator .legal-text .legal-text > div {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.45;
}

.calculator-box .calculator .legal-text .legal-text {
    padding: 0;
}

.calculator-box #value-table {
    margin-bottom: 0;
}

.calculator-box #value-table th,
.calculator-box #value-table td {
    padding: 0.75rem 0.5rem;
    color: #1d1d1b;
    vertical-align: middle;
}

.calculator-box #value-table th {
    background-color: #f2f2f2;
    font-weight: 700;
}

@container (max-width: 40rem) {
    .calculator-box .calculator {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "wrapper"
            "table"
            "legal";
        grid-template-rows: auto;
    }
}

/* PDP financing tab */
#cf-pdp-calculator {
    margin: 1rem 0;
}

.financing-description .cf-credit-notice {
    margin-bottom: 0.75rem;
}

.financing-description .description--link-to-long-description {
    display: inline-block;
    margin: 0.5rem 0;
    color: #00965e;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
