/* TICKET-11894 — overlay Flujo Cristales (mockup cliente) */

:root {
    --tos-cx-ink: #111111;
    --tos-cx-muted: #6b6b6b;
    --tos-cx-line: #e6e6e6;
    --tos-cx-soft: #f5f5f3;
    --tos-cx-white: #ffffff;
    --tos-cx-radius: 2px;
    --tos-cx-font: 'FuturaLux-Book', 'FuturaStd-Book', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --tos-cx-font-med: 'FuturaLux-Medium', 'FuturaStd-Bold', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body.tos-cx-open {
    overflow: hidden !important;
}

.tos-cx {
    position: fixed;
    inset: 0;
    z-index: 10050;
    font-family: var(--tos-cx-font);
    color: var(--tos-cx-ink);
    -webkit-font-smoothing: antialiased;
}

.tos-cx *,
.tos-cx *::before,
.tos-cx *::after {
    box-sizing: border-box;
}

.tos-cx__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(2px);
}

.tos-cx__dialog {
    position: relative;
    z-index: 1;
    width: min(1440px, 98vw);
    height: min(96vh, 980px);
    margin: 2vh auto;
    background: var(--tos-cx-white);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    animation: tosCxIn 0.28s ease;
}

@keyframes tosCxIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tos-cx__close {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 5;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--tos-cx-ink);
}

.tos-cx__close:hover {
    background: var(--tos-cx-soft);
}

.tos-cx__shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.tos-cx__top {
    flex: 0 0 auto;
    padding: 22px 40px 8px;
    border-bottom: 1px solid var(--tos-cx-line);
    background: var(--tos-cx-white);
}

.tos-cx__steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 18px;
}

.tos-cx__step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #b0b0b0;
}

.tos-cx__step.is-active {
    color: var(--tos-cx-ink);
}

.tos-cx__step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-family: var(--tos-cx-font-med);
    background: var(--tos-cx-white);
}

.tos-cx__step.is-current .tos-cx__step-dot,
.tos-cx__step.is-active .tos-cx__step-dot {
    background: var(--tos-cx-ink);
    border-color: var(--tos-cx-ink);
    color: #fff;
}

.tos-cx__step-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--tos-cx-font-med);
}

.tos-cx__step-line {
    width: 42px;
    height: 1px;
    background: #d5d5d5;
}

.tos-cx__title {
    margin: 0 0 14px;
    text-align: center;
    font-size: clamp(22px, 2.2vw, 30px);
    font-family: var(--tos-cx-font-med);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tos-cx__layout {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.tos-cx__main {
    flex: 1 1 68%;
    overflow-y: auto;
    padding: 28px 36px 48px;
    background: var(--tos-cx-white);
    scroll-behavior: smooth;
}

.tos-cx__side {
    flex: 0 0 340px;
    overflow-y: auto;
    padding: 28px 24px 32px;
    background: #fafaf8;
    border-left: 1px solid var(--tos-cx-line);
}

.tos-cx__section {
    margin: 0 0 36px;
}

.tos-cx__section.is-dimmed {
    opacity: 0.45;
    pointer-events: none;
}

.tos-cx__section-title {
    margin: 0 0 18px;
    font-size: 18px;
    font-family: var(--tos-cx-font-med);
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--tos-cx-ink);
}

.tos-cx__hint {
    margin: -8px 0 16px;
    font-size: 13px;
    color: var(--tos-cx-muted);
}

.tos-cx__warn {
    font-size: 12px;
    line-height: 1.4;
    margin: 0 0 16px;
    padding: 10px 12px;
    background: #fff6e5;
    color: #7a5200;
}

.tos-cx__side .tos-cx__msg,
.tos-cx__msg {
    display: block;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.45;
    margin: 10px 0 0;
    padding: 10px 12px;
    background: #fff5f5;
    border: 1px solid #c62828;
    border-radius: 4px;
    color: #c62828 !important;
    font-weight: 600;
}

.tos-cx__cards--cristales {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.tos-cx__card {
    position: relative;
    background: var(--tos-cx-white);
    border: 1px solid var(--tos-cx-line);
    border-radius: var(--tos-cx-radius);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tos-cx__card--cristal {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 16px 14px 14px;
    cursor: pointer;
}

.tos-cx__card--cristal:hover {
    border-color: #bdbdbd;
}

.tos-cx__card--cristal.is-selected {
    border-color: var(--tos-cx-ink);
    box-shadow: inset 0 0 0 1px var(--tos-cx-ink);
}

.tos-cx__card-head {
    margin-bottom: 12px;
    min-height: 58px;
}

.tos-cx__card-title {
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.25;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--tos-cx-font-med);
}

.tos-cx__card-price {
    margin: 0;
    font-size: 18px;
    font-family: var(--tos-cx-font-med);
    font-weight: 500;
}

.tos-cx__card-media {
    margin: 0 0 14px;
    background: linear-gradient(180deg, #f7f7f5 0%, #eeeeea 100%);
    border: 1px solid #ecece8;
    aspect-ratio: 4 / 2.6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tos-cx__card-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tos-cx__features {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    flex: 1 1 auto;
}

.tos-cx__features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.35;
    color: #333;
}

.tos-cx__info {
    position: relative;
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    margin-top: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    text-align: center;
    font: 700 11px/15px Arial, sans-serif;
    cursor: help;
    color: #555;
}

.tos-cx__info:focus-visible {
    outline: 2px solid var(--tos-cx-ink);
    outline-offset: 2px;
}

.tos-cx__tooltip {
    display: none;
    position: absolute;
    z-index: 10;
    bottom: calc(100% + 8px);
    left: 50%;
    width: min(230px, 70vw);
    padding: 9px 11px;
    transform: translateX(-50%);
    background: var(--tos-cx-ink);
    color: #fff;
    font: 12px/1.4 Arial, sans-serif;
    text-align: left;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.tos-cx__info:hover .tos-cx__tooltip,
.tos-cx__info:focus .tos-cx__tooltip {
    display: block;
}

.tos-cx__check {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--tos-cx-ink);
    position: relative;
}

.tos-cx__check::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 2px;
    width: 4px;
    height: 7px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.tos-cx__card-cta {
    width: 100%;
    margin-top: auto;
    border: 1px solid var(--tos-cx-ink);
    background: var(--tos-cx-white);
    color: var(--tos-cx-ink);
    padding: 11px 12px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--tos-cx-font-med);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.tos-cx__card-cta.is-selected,
.tos-cx__card.is-selected .tos-cx__card-cta {
    background: var(--tos-cx-ink);
    color: #fff;
}

.tos-cx__cta-check {
    font-size: 12px;
}

.tos-cx__trata-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.tos-cx__card--trata {
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    cursor: pointer;
    min-height: 100%;
}

.tos-cx__card--trata.is-selected {
    border-color: var(--tos-cx-ink);
    box-shadow: inset 0 0 0 1px var(--tos-cx-ink);
}

.tos-cx__radio {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #bdbdbd;
    background: #fff;
    padding: 0;
    cursor: pointer;
}

.tos-cx__radio.is-selected {
    border-color: var(--tos-cx-ink);
    box-shadow: inset 0 0 0 6px var(--tos-cx-ink);
}

@keyframes tos-cx-fade-from-white {
    0% {
        opacity: 0;
        background-color: #ffffff;
        filter: brightness(1.35);
    }
    100% {
        opacity: 1;
        background-color: transparent;
        filter: none;
    }
}

/* Nunca dejar opacity:0 permanente: si falla la clase, igual se ve. */
.tos-cx__section--trata {
    opacity: 1;
}

.tos-cx__section--trata.is-fading-in {
    animation: tos-cx-fade-from-white 0.55s ease both;
}

.tos-cx__trata-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #ecece8;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tos-cx__trata-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.tos-cx__trata-body {
    padding: 16px 16px 18px;
}

.tos-cx__trata-head {
    margin-bottom: 14px;
}

.tos-cx__trata-head .tos-cx__card-price {
    margin-top: 4px;
    font-size: 15px;
}

.tos-cx__colors-label {
    margin: 0 0 10px;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tos-cx-muted);
}

.tos-cx__color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tos-cx__swatch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #ddd;
    background: #fff;
    padding: 6px 10px 6px 7px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 11px;
    color: #333;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.tos-cx__swatch:hover {
    border-color: #999;
}

.tos-cx__swatch.is-selected {
    border-color: var(--tos-cx-ink);
    background: #111;
    color: #fff;
}

.tos-cx__swatch-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    display: inline-block;
}

.tos-cx__swatch.is-selected .tos-cx__swatch-dot {
    border-color: rgba(255, 255, 255, 0.35);
}

.tos-cx__swatch-name {
    line-height: 1;
}

.tos-cx__skip {
    margin-top: 16px;
    width: 100%;
    border: 1px dashed #cfcfcf;
    background: transparent;
    padding: 12px 14px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--tos-cx-muted);
    font-family: var(--tos-cx-font-med);
}

.tos-cx__skip:hover:not(:disabled),
.tos-cx__skip.is-active {
    border-style: solid;
    border-color: var(--tos-cx-ink);
    color: var(--tos-cx-ink);
}

.tos-cx__skip:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tos-cx__side-title {
    margin: 0 0 18px;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--tos-cx-font-med);
}

.tos-cx__product {
    margin-bottom: 18px;
}

.tos-cx__product-frame {
    background: #fff;
    border: 1px solid var(--tos-cx-line);
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.tos-cx__product-img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
    display: block;
}

.tos-cx__summary {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}

.tos-cx__summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tos-cx-line);
}

.tos-cx__summary-kicker {
    display: block;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tos-cx-muted);
    margin-bottom: 3px;
}

.tos-cx__summary-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    font-family: var(--tos-cx-font-med);
}

.tos-cx__summary-price {
    flex: 0 0 auto;
    font-size: 13px;
    font-family: var(--tos-cx-font-med);
    padding-top: 14px;
}

.tos-cx__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 14px 0 18px;
    padding-top: 4px;
}

.tos-cx__total span {
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--tos-cx-font-med);
}

.tos-cx__total strong {
    font-size: 28px;
    font-family: var(--tos-cx-font-med);
    letter-spacing: 0.01em;
}

.tos-cx__buy {
    width: 100%;
    border: 0;
    background: var(--tos-cx-ink);
    color: #fff;
    padding: 16px 18px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--tos-cx-font-med);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.tos-cx__buy:hover:not(:disabled) {
    transform: translateY(-1px);
}

.tos-cx__buy:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.tos-cx__buy-arrow {
    font-size: 16px;
    line-height: 1;
}

.tos-cx__trust {
    display: grid;
    gap: 10px;
    margin: 18px 0 14px;
}

.tos-cx__trust-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--tos-cx-muted);
}

.tos-cx__trust-ico {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin-top: 1px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    position: relative;
    opacity: 0.75;
}

.tos-cx__trust-ico--ship {
    border-radius: 2px;
}

.tos-cx__trust-ico--pay::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
}

.tos-cx__trust-ico--store {
    border-radius: 2px 2px 0 0;
    height: 12px;
    margin-top: 4px;
}

.tos-cx__trust-ico--store::after {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: -4px;
    height: 3px;
    border: 1.5px solid currentColor;
    border-top: 0;
}

.tos-cx__note {
    margin: 0;
    padding: 10px 12px;
    background: #f0f0ec;
    font-size: 11px;
    line-height: 1.4;
    color: #555;
}

@media (max-width: 1200px) {
    .tos-cx__cards--cristales {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tos-cx__side {
        flex-basis: 300px;
    }
}

.tos-cx__mobile-bar {
    display: none;
}

.tos-cx__side-back {
    display: none;
}

@media (max-width: 900px) {
    .tos-cx__dialog {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        border-radius: 0;
    }

    .tos-cx__layout {
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 88px;
    }

    .tos-cx__main {
        flex: 0 0 auto;
        overflow: visible;
        padding: 20px 16px 28px;
        min-height: 0;
    }

    .tos-cx__top {
        padding: 18px 16px 8px;
    }

    /* Sidebar fijo no compite con el flujo: solo en resumen (paso 3). */
    .tos-cx__side {
        display: none;
        flex: 0 0 auto;
        border-left: 0;
        border-top: 1px solid var(--tos-cx-line);
        overflow: visible;
    }

    .tos-cx-step-3 .tos-cx__side {
        display: block;
    }

    .tos-cx-step-3 .tos-cx__side-back {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0 0 14px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--tos-cx-ink);
        font-size: 13px;
        font-family: var(--tos-cx-font-med);
        letter-spacing: 0.04em;
        text-transform: uppercase;
        cursor: pointer;
    }

    .tos-cx-step-3 .tos-cx__main {
        display: none;
    }

    .tos-cx-step-3 .tos-cx__layout {
        padding-bottom: 16px;
    }

    .tos-cx-step-1 [data-tos-cx-step="tratamiento"] {
        display: none !important;
    }

    .tos-cx-step-2 [data-tos-cx-step="cristal"] {
        display: none !important;
    }

    .tos-cx__product-frame {
        max-height: 180px;
    }

    .tos-cx__product-img {
        max-height: 180px;
        width: auto;
        margin: 0 auto;
        display: block;
    }

    .tos-cx__trata-grid {
        grid-template-columns: 1fr;
    }

    .tos-cx__steps {
        gap: 6px;
    }

    .tos-cx__step-line {
        width: 18px;
    }

    .tos-cx__step-label {
        display: none;
    }

    .tos-cx__mobile-bar {
        display: flex;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 4;
        align-items: center;
        gap: 10px;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.97);
        border-top: 1px solid var(--tos-cx-line);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    }

    .tos-cx__mobile-bar.is-hidden-step3 {
        display: none;
    }

    .tos-cx__mobile-back {
        display: none;
        width: 42px;
        height: 46px;
        border: 1px solid var(--tos-cx-line);
        background: #fff;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
        flex: 0 0 42px;
        color: var(--tos-cx-ink);
    }

    .tos-cx__mobile-back.is-visible {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .tos-cx__mobile-total {
        display: flex;
        flex-direction: column;
        min-width: 0;
        flex: 1 1 auto;
        line-height: 1.15;
    }

    .tos-cx__mobile-total span {
        font-size: 10px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--tos-cx-muted);
        font-family: var(--tos-cx-font-med);
    }

    .tos-cx__mobile-total strong {
        font-size: 18px;
        font-family: var(--tos-cx-font-med);
        color: var(--tos-cx-ink);
    }

    .tos-cx__mobile-next {
        flex: 0 0 auto;
        border: 0;
        background: var(--tos-cx-ink);
        color: #fff;
        min-height: 46px;
        padding: 0 16px;
        font-size: 11px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        font-family: var(--tos-cx-font-med);
        cursor: pointer;
        max-width: 52%;
    }

    .tos-cx__mobile-next.is-blocked {
        opacity: 0.85;
    }
}

@media (max-width: 560px) {
    .tos-cx__cards--cristales {
        grid-template-columns: 1fr;
    }

    .tos-cx__title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .tos-cx__section-title {
        font-size: 16px;
    }
}


.tos-cx__card-title--logo {
    margin: 0 0 0.25rem;
}

.tos-cx__brand-logo {
    display: block;
    max-width: 220px;
    width: auto;
    height: auto;
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
}

.tos-cx-hide {
    display: none !important;
}

.tos-cx__total-value {
    min-width: 4ch;
    color: var(--tos-cx-ink) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tos-cx__buy.is-blocked {
    opacity: 0.85;
}

.tos-cx__confirm {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 5;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.tos-cx__confirm.is-open,
.tos-cx__confirm[style*="display: block"] {
    display: flex !important;
}

.tos-cx__confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.45);
}

.tos-cx__confirm-card {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--tos-cx-line);
    border-radius: 4px;
    padding: 22px 20px 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.tos-cx__confirm-text {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.45;
    font-family: var(--tos-cx-font-med);
    color: var(--tos-cx-ink);
    text-align: center;
}

.tos-cx__confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tos-cx__confirm-btn {
    min-width: 120px;
    border: 1px solid var(--tos-cx-ink);
    padding: 12px 14px;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: var(--tos-cx-font-med);
}

.tos-cx__confirm-btn--ghost {
    background: #fff;
    color: var(--tos-cx-ink);
}

.tos-cx__confirm-btn--solid {
    background: var(--tos-cx-ink);
    color: #fff;
}
