/*
 * Ported 1:1 from a1-shop-2021's production CSS (consolidatedv2.css,
 * ".combo-popust-*" block) - colors, gradients, shadows, spacing and the
 * two responsive breakpoints (576px card-vs-fullscreen header, 575px
 * device-footer layout) match the live site.
 *
 * Two deliberate departures, both required by constraints of this task:
 * 1. No Bootstrap: the outer .modal/.modal-dialog/.modal-backdrop and the
 *    generic .close/.row/.col-4 utility classes aren't available, so
 *    their relevant declarations are inlined into combo-popust-content/
 *    combo-popust-close and a minimal .row/.col-4/.no-gutters/.px-2 subset
 *    is defined below instead of pulling in all of Bootstrap's grid.
 * 2. No Font Awesome Pro: the production close icon is `fal fa-times`
 *    (a paid icon set); a plain "×" character is used instead.
 */

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: #1a1a1a;
    background: transparent;
}

/* minimal Bootstrap-grid subset (only what this widget's totals row uses) */
.row {
    display: flex;
    flex-wrap: wrap;
}

.no-gutters {
    margin-left: 0;
    margin-right: 0;
}

.col-4 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
}

.px-2 {
    padding-left: .5rem;
    padding-right: .5rem;
}

/* entrance/exit animation standing in for Bootstrap's .modal.fade transform+opacity transition */
@keyframes comboFadeIn {
    from { opacity: 0; transform: translate(0, -25%); }
    to   { opacity: 1; transform: translate(0, 0); }
}

@keyframes comboFadeOut {
    from { opacity: 1; transform: translate(0, 0); }
    to   { opacity: 0; transform: translate(0, -25%); }
}

.combo-popust-content {
    border: 0;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
    background: #fff;
    animation: comboFadeIn .3s ease-out;
}

.combo-popust-content.closing {
    animation: comboFadeOut .3s ease-in forwards;
}

/* white body */
.combo-popust-body {
    background: #fff;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* sticky footer: device bar */
.combo-device-footer {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    box-shadow: 0px 8px 65.28px 30.72px rgba(0, 0, 0, 0.05), 0px 8px 53.76px 10.24px rgba(0, 0, 0, 0.05),
                0px 8px 29.44px 2.56px rgba(0, 0, 0, 0.15), 0px 6px 16px 0 rgba(0, 0, 0, 0.15),
                0px 4px 4px 0 rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.combo-field-group {
    margin-bottom: 16px;
}

.combo-label {
    display: block;
    color: #111;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: bold;
}

.combo-label-sub {
    color: #888;
    font-weight: normal;
}

.combo-hint {
    font-size: 12px;
    color: #888;
    margin: 0 0 10px;
}

.combo-select {
    width: 100%;
    padding: 9px 10px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    font-size: 13px;
    background: #fff;
}

.combo-select:focus {
    outline: none;
    border-color: #d43014;
    box-shadow: 0 0 0 3px rgba(212, 48, 20, 0.12);
}

/* tarifi stepper list */
.combo-tarifi-list {
    list-style: none;
    margin: 0;
    padding: 0;
    box-shadow: 0px 8px 65.28px 30.72px rgba(0, 0, 0, 0.05), 0px 8px 29.44px 2.56px rgba(0, 0, 0, 0.05),
                0px 4px 4px 0 rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    overflow: hidden;
}

.combo-tarifa-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.combo-tarifa-row:last-child {
    border-bottom: 0;
}

.combo-tarifa-row:hover {
    background: #fafafa;
}

.combo-tarifa-name {
    flex: 1;
    min-width: 0;
    padding-right: 10px;
    font-weight: 500;
}

.combo-tarifa-price {
    color: #888;
    font-weight: 400;
}

.combo-stepper {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.combo-step-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 5px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}

.combo-step-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

.combo-step-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

.combo-step-val {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    color: #111;
}

/* totals */
.combo-totals-row {
    margin-bottom: 14px;
}

.combo-total-box {
    border: 1px solid #d43014;
    border-radius: 5px;
    padding: 10px 12px;
}

.combo-total-label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: bold;
}

.combo-total-val {
    font-size: 20px;
    color: #d43014;
    line-height: 1;
    font-weight: bold;
}

/* device summary bar */
.combo-device-bar {
    background: #d43014;
    border-radius: 5px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.combo-device-thumb {
    max-width: 56px;
    max-height: 56px;
    width: auto;
    height: auto;
    flex-shrink: 0;
    object-fit: contain;
    object-position: center;
    display: block;
}

.combo-device-info {
    flex: 0 0 auto;
    min-width: 240px;
}

.combo-device-name {
    font-size: 14px;
    color: #fff;
    line-height: 1.3;
    font-weight: bold;
}

.combo-device-col {
    flex: 1 1 0;
    min-width: 80px;
}

.combo-device-col-label {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
    margin-bottom: 2px;
    font-size: 11px;
}

.combo-device-col-val {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.combo-device-col-sub {
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
    font-size: 11px;
}

.combo-device-footnote {
    margin: 10px 0 0;
    font-size: 11px;
    color: #999;
}

@media (max-width: 575px) {
    /* totals: one per row */
    .combo-totals-row .col-4 {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: 8px;
    }
    .combo-totals-row .col-4:last-child {
        margin-bottom: 0;
    }

    /* full-screen "modal" on mobile - the iframe already fills the host's screen-sized overlay */
    .combo-popust-content {
        border-radius: 0;
        max-height: 100vh;
    }

    /* strip red background; footer handles padding */
    .combo-device-bar {
        background: none;
        border-radius: 0;
        padding: 0;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0;
    }
    .combo-device-bar > img.combo-device-thumb {
        display: block;
        flex-shrink: 0;
    }
    .combo-device-info {
        display: block;
        flex: 1;
        min-width: 0;
    }
    .combo-device-name {
        color: #111;
    }
    .combo-device-col:first-child {
        margin-top: 10px;
    }
    /* each price col: full width, one line - borders span edge to edge */
    .combo-device-col {
        flex: 0 0 calc(100% + 32px);
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        border-top: 1px solid #efefef;
        padding-top: 7px;
        padding-bottom: 7px;
        margin-top: 0;
    }
    .combo-device-col-label {
        flex: 1;
        color: #555;
        margin-bottom: 0;
        padding-right: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .combo-device-col-val {
        font-size: 15px;
        color: #111;
        white-space: nowrap;
    }
    .combo-device-col-sub {
        color: #888;
        margin-top: 0;
        margin-left: 3px;
        white-space: nowrap;
    }
    .combo-device-footer {
        padding: 10px 16px;
    }
}