.details {
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.07);
    background: var(--belyy);
    font-family: var(--font-family);
    color: var(--chernyy);
    padding: 15px;
}

.details__title {
    font-weight: 700;
    font-size: clamp(16px, 12.8px + 1vw, 30px);
    line-height: 150%;
    color: var(--chernyy);
}

.details__wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.details__summary {
    font-weight: 500;
    font-size: clamp(15px, 12.143px + 0.893vw, 23px);
    line-height: 140%;
    color: var(--chernyy);
}

.details__summary-value {
    margin-left: auto;
    flex: 1;
    display: flex;
}

/* Leader between label and value: light grey dots as in Figma, not a dark dash */
.details__summary-value::before {
    content: "";
    border-bottom: 1px dotted var(--seryy);
    margin: 0 8px;
    flex: 1;
}

.details__dropdown-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    background: transparent;
    font-weight: 500;
    font-size: clamp(15px, 12.143px + 0.893vw, 23px);
    line-height: 140%;
    color: var(--chernyy);
}

.details__summary-dropdown {
    margin-top: 10px;
    font-style: italic;
    font-weight: 500;
    font-size: clamp(11px, 8.5px + 0.781vw, 18px);
    line-height: 140%;
    color: var(--seryy);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.details__dropdown-icon {
    width: 10px;
    height: 6px;
}

.details__dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.details__dropdown-label {
    display: flex;
    flex: 1;
}

.details__dropdown-label::after {
    content: "";
    flex: 1;
    border-bottom: 1px dotted var(--seryy);
    margin: 0 8px;
}

.details__final {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 3px;
    margin-top: 15px;
}

.details__final-title {
    grid-area: 1/1/3/2;
    font-weight: 500;
    font-size: clamp(16px, 12.8px + 1vw, 30px);
    line-height: 150%;
    color: var(--chernyy);
}

.details__final-value {
    font-weight: 600;
    font-size: clamp(20px, 17.143px + 0.893vw, 30px);
    line-height: 120%;
    text-transform: uppercase;
    color: var(--firmennyy);
    text-align: end;
}

.details__final-points {
    font-weight: 500;
    font-size: 15px;
    line-height: 140%;
    color: var(--chernyy);
    text-align: end;
}

.details__confirm-btn {
    background: var(--firmennyy);
    padding: 15px;
    font-weight: 500;
    font-size: clamp(15px, 13.286px + 0.536vw, 18px);
    line-height: 140%;
    color: var(--belyy);
    width: 100%;
}

.details__installments-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1.5px solid var(--firmennyy);
    background: transparent;
    font-weight: 500;
    font-size: clamp(15px, 13.286px + 0.536vw, 18px);
    line-height: 140%;
}

.details__divider {
    display: none;
}

.details__confirm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.details__confirm-agree {
    font-weight: 400;
    font-size: clamp(11px, 8.5px + 0.781vw, 18px);
    line-height: 100%;
    text-align: center;
    color: var(--seryy);
}

.details__confirm-agree--red {
    color: var(--firmennyy);
}

.details__actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 30px 0;
}

.details__points-label {
    font-weight: 700;
    font-size: clamp(15px, 13.571px + 0.446vw, 20px);
    line-height: 140%;
    color: var(--chernyy);
}

.details__use-points {
    background: var(--svetlo-seryy);
    width: 100%;
    padding: 13px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
}

.details__points-label {
    font-weight: 700;
    line-height: 125%;
}

.details__points-count {
    font-weight: 500;
    font-size: clamp(15px, 13.929px + 0.335vw, 18px);
    line-height: 140%;
    color: var(--seryy);
}

.details__points-count--red {
    color: var(--firmennyy);
}

.details__use-promo {
    background: var(--svetlo-seryy);
    width: 100%;
    padding: 13px;
    display: flex;
    flex-direction: column;
}

.details__promo-label {
    font-weight: 500;
    font-size: clamp(15px, 13.929px + 0.335vw, 18px);
    line-height: 140%;
    color: var(--seryy);
}

.details__promo-input {
    font-weight: 500;
    font-size: clamp(15px, 13.929px + 0.335vw, 18px);
    line-height: 140%;
    background-color: var(--svetlo-seryy);
}

.details__switch {
    grid-area: 1/2/3/3;
    align-self: center;
    justify-self: end;
}

@media (min-width: 768px) {
    .details {
        padding: 20px;
    }

    .details__wrapper {
        gap: 15px;
    }

    .details__summary-btn {
        font-weight: 400;
    }

    .details__summary-dropdown {
        font-weight: 500;
        line-height: 140%;
    }

    .details__final {
        gap: 10px;
    }

    .details__final-title {
        font-weight: 500;
        line-height: 117%;
    }

    .details__final-value {
        font-weight: 500;
        line-height: 117%;
    }

    .details__final-points {
        font-weight: 400;
        font-size: 14px;
        line-height: 107%;
        color: var(--firmennyy);
    }

    .details__confirm-btn {
        padding: 20px;
    }

    .details__installments-btn {
        padding: 20px;
    }

    .details__actions {
        gap: 15px;
        flex-direction: row;
        margin: 15px 0;
    }

    .details__wrapper {
        gap: 10px;
    }
}

/* WooCommerce wraps the order total in <strong>: the weight comes from .details__final-value, as in Figma */
.details__final-value strong {
    font-weight: inherit;
}

/* Figma "Корзина" / "Оплата": "Детали заказа" 30px Medium, 35px line (phones keep 16px Bold) */
@media (min-width: 1200px) {
    .details__title {
        font-weight: 500;
        line-height: 35px;
    }

    /* the cart totals are not the .details grid: 30px under the title, rows 15px apart (Figma "Корзина") */
    .cart_totals .details__title {
        margin-bottom: 30px;
    }

    .cart_totals .details__wrapper {
        gap: 15px;
    }
}

/* The 5-row .details grid is the checkout layout; in the cart the card holds one block, and the empty rows' gaps
   left 120px of blank space under "Оформить в рассрочку" */
@media (min-width: 1300px) {
    .cart__details.details {
        display: block;
    }
}

@media (min-width: 1300px) {
    .details {
        max-width: 567px;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, auto);
        column-gap: 0;
        row-gap: 30px;
    }

    .details__divider {
        display: block;
        height: 1px;
        width: 100%;
        background: var(--seryy);
        margin: 10px 0;
    }
    .details__actions {
        gap: 20px;
        flex-direction: column;
        margin: 0;
    }
    .details__title {
        grid-area: 2 / 1 / 3 / 2;
    }

    .details__wrapper {
        grid-area: 3 / 1 / 4 / 2;
    }

    .details__final {
        grid-area: 4 / 1 / 5 / 2;
        margin: 0;
    }

    .details__actions {
        grid-area: 5 / 1 / 6 / 2;
        margin-top: 10px;
    }

    .details__confirm {
        grid-area: 1 / 1 / 2 / 3;
    }

    .details__use-points {
        padding: 20px;
        gap: 5px;
    }

    .details__use-promo {
        padding: 15px;
        gap: 5px;
    }
}
