/* ============================================================
   POPUP INFORMATIVO DE COMBINABLES — .dtpci-*
   App-like, liviano, sin librerías. Acento índigo/violeta
   (coherente con el badge "Combinable"). Microinteracciones
   sólo de opacity/transform (compositor) para no trabar.
   ============================================================ */

.dtpci-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(17, 24, 39, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .18s ease;
    padding: 0;
}

.dtpci-overlay.is-open {
    opacity: 1;
}

@media (min-width: 720px) {
    .dtpci-overlay {
        align-items: center;
        padding: 20px;
    }
}

.dtpci-modal {
    width: 100%;
    max-width: 760px;
    max-height: 92vh;
    background: #fff;
    border-radius: 22px 22px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(16px);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, .25);
}

.dtpci-overlay.is-open .dtpci-modal {
    transform: translateY(0);
}

@media (min-width: 720px) {
    .dtpci-modal {
        border-radius: 22px;
        max-height: 88vh;
        box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
        transform: translateY(0) scale(.97);
    }

    .dtpci-overlay.is-open .dtpci-modal {
        transform: translateY(0) scale(1);
    }
}

.dtpci-root {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

/* ---------- HEADER ---------- */
.dtpci-header {
    padding: 18px 18px 14px;
    background: linear-gradient(135deg, #6d5efc 0%, #8b5cf6 55%, #a855f7 100%);
    color: #fff;
    position: relative;
    flex-shrink: 0;
}

.dtpci-head-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dtpci-head-ic {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.dtpci-head-txt {
    flex: 1;
    min-width: 0;
}

.dtpci-eyebrow {
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    opacity: .9;
}

.dtpci-title {
    font-size: 1.18rem;
    font-weight: 800;
    margin: 2px 0 0;
    line-height: 1.2;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dtpci-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, transform .12s;
}

.dtpci-close:hover {
    background: rgba(255, 255, 255, .35);
}

.dtpci-close:active {
    transform: scale(.9);
}

/*.dtpci-lead {
    margin: 12px 0 0;
    font-size: .9rem;
    line-height: 1.5;
    opacity: .96;
}*/

.dtpci-lead {
    margin: 12px 0 0;
    font-size: .9rem;
    line-height: 1.5;
    opacity: 1;
    color: #f8fafc;
    font-weight: 600;
}

/* ---------- BODY ---------- */
.dtpci-body {
    padding: 4px 18px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
}

/* ---------- Reglas ---------- */
.dtpci-rules {
    list-style: none;
    margin: 14px 0 6px;
    padding: 14px;
    display: grid;
    gap: 9px;
    background: #f6f5ff;
    border: 1px solid #ece9ff;
    border-radius: 14px;
}

.dtpci-rule {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: .86rem;
    line-height: 1.4;
    color: #374151;
}

.dtpci-rule-ic {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1.3;
}

.dtpci-rule-tx b {
    color: #6d28d9;
    font-weight: 800;
}

/* ---------- Secciones ---------- */
.dtpci-sec {
    margin-top: 20px;
}

.dtpci-sec-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 11px;
}

.dtpci-sec-title {
    font-size: 1.02rem;
    font-weight: 800;
    margin: 0;
    color: #111827;
}

.dtpci-sec-hint {
    font-size: .74rem;
    color: #9ca3af;
    font-weight: 600;
}

/* ---------- Carrusel de ahorro ---------- */
.dtpci-carousel {
    display: flex;
    gap: 11px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 10px;
    margin: 0 -2px;
    scrollbar-width: thin;
}

.dtpci-carousel::-webkit-scrollbar {
    height: 6px;
}

.dtpci-carousel::-webkit-scrollbar-thumb {
    background: #d8d4f5;
    border-radius: 999px;
}

.dtpci-acard {
    scroll-snap-align: start;
    flex: 0 0 150px;
    width: 150px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    transition: transform .15s ease, box-shadow .15s ease;
    contain: layout style;
}

.dtpci-acard:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, .16);
}

.dtpci-acard-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(5, 150, 105, .35);
}

.dtpci-acard-thumb {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f7;
    position: relative;
}

.dtpci-acard-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dtpci-acard-fb {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: #c4b5fd;
    background: #f3f0ff;
}

.dtpci-acard-nom {
    font-size: .82rem;
    font-weight: 700;
    color: #1f2937;
    margin-top: 8px;
    line-height: 1.25;
    min-height: 2.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dtpci-acard-prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.dtpci-acard-normal {
    font-size: .78rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.dtpci-acard-promo {
    font-size: .98rem;
    font-weight: 800;
    color: #059669;
}

.dtpci-acard-ahorro {
    margin-top: 6px;
    font-size: .74rem;
    font-weight: 700;
    color: #047857;
    background: #ecfdf5;
    border-radius: 8px;
    padding: 4px 7px;
    text-align: center;
}

.dtpci-noahorro {
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    border-radius: 14px;
    padding: 14px;
    font-size: .88rem;
    color: #0369a1;
    line-height: 1.45;
}

/* ---------- Chips de tipo de ejemplo ---------- */
.dtpci-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 12px;
    margin: 0 -2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.dtpci-chips::-webkit-scrollbar {
    display: none;
}

.dtpci-chip {
    flex: 0 0 auto;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    font-size: .82rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s ease;
}

.dtpci-chip:hover {
    border-color: #c4b5fd;
}

.dtpci-chip.is-active {
    background: linear-gradient(135deg, #6d5efc, #8b5cf6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 10px rgba(124, 58, 237, .3);
}

/* ---------- Tarjeta de ejemplo ---------- */
.dtpci-ej {
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
    animation: dtpci-fade .2s ease;
}

@keyframes dtpci-fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dtpci-ej-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    border-bottom: 1px solid #f0ebff;
}

.dtpci-ej-tag {
    font-size: .9rem;
    font-weight: 800;
    color: #6d28d9;
}

.dtpci-ej-use {
    border: none;
    background: linear-gradient(135deg, #6d5efc, #8b5cf6);
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(124, 58, 237, .35);
    transition: transform .12s ease, box-shadow .15s ease;
}

.dtpci-ej-use:hover {
    box-shadow: 0 5px 14px rgba(124, 58, 237, .45);
    transform: translateY(-1px);
}

.dtpci-ej-use:active {
    transform: scale(.95);
}

.dtpci-ej-items {
    padding: 6px 14px;
}

.dtpci-eji {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.dtpci-ej-items .dtpci-eji:last-child {
    border-bottom: none;
}

.dtpci-eji-thumb {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    overflow: hidden;
    background: #f5f5f7;
    position: relative;
    flex-shrink: 0;
}

.dtpci-eji-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dtpci-eji-fb {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 800;
    color: #c4b5fd;
    background: #f3f0ff;
}

.dtpci-eji-nom {
    flex: 1;
    min-width: 0;
    font-size: .86rem;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dtpci-eji-qty {
    font-size: .9rem;
    font-weight: 800;
    color: #6d28d9;
    flex-shrink: 0;
}

.dtpci-ej-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 11px 14px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.dtpci-ej-tot {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dtpci-ej-tot-lbl {
    font-size: .68rem;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.dtpci-ej-tot-normal {
    font-size: .92rem;
    font-weight: 700;
    color: #6b7280;
}

.dtpci-ej-tot-normal.dtpci-strike {
    text-decoration: line-through;
    color: #9ca3af;
}

.dtpci-ej-tot-combo {
    font-size: .98rem;
    font-weight: 800;
    color: #111827;
}

.dtpci-ej-ahorro {
    margin-left: auto;
    font-size: .82rem;
    font-weight: 800;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 5px 12px;
}

/* ---------- Estado vacío ---------- */
.dtpci-empty {
    text-align: center;
    padding: 36px 20px;
}

.dtpci-empty-ic {
    font-size: 2.6rem;
    color: #c4b5fd;
}

.dtpci-empty-tx {
    margin-top: 10px;
    font-size: .95rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ---------- FOOTER ---------- */
.dtpci-footer {
    padding: 13px 18px calc(13px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #f0f0f0;
    background: #fff;
    flex-shrink: 0;
}

.dtpci-howto {
    margin: 0 0 10px;
    font-size: .82rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.45;
}

.dtpci-howto b {
    color: #6d28d9;
    font-weight: 800;
}

.dtpci-cta {
    width: 100%;
    border: none;
    background: linear-gradient(135deg, #6d5efc, #8b5cf6);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    padding: 14px;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(124, 58, 237, .35);
    transition: transform .12s ease, box-shadow .15s ease;
}

.dtpci-cta:hover {
    box-shadow: 0 6px 18px rgba(124, 58, 237, .45);
    transform: translateY(-1px);
}

.dtpci-cta:active {
    transform: scale(.99);
}

/* ---------- Loading / mensaje ---------- */
.dtpci-loading {
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dtpci-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #ece9ff;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: dtpci-spin .8s linear infinite;
}

@keyframes dtpci-spin {
    to {
        transform: rotate(360deg);
    }
}

.dtpci-msg {
    padding: 30px 22px;
    text-align: center;
}

.dtpci-msg-ic {
    font-size: 2.2rem;
}

.dtpci-msg-tx {
    margin: 12px 0 18px;
    font-size: .95rem;
    color: #374151;
    line-height: 1.5;
}

.dtpci-msg-ok {
    border: none;
    background: linear-gradient(135deg, #6d5efc, #8b5cf6);
    color: #fff;
    font-weight: 800;
    padding: 11px 28px;
    border-radius: 12px;
    cursor: pointer;
}

/* ---------- Dark mode (fallback legacy, sin JS de contraste) ---------- */
@media (prefers-color-scheme: dark) {
    html:not(.dtp-contrast-ready) .dtpci-modal {
        background: #1c1c22;
    }

    html:not(.dtp-contrast-ready) .dtpci-rules {
        background: #26222f;
        border-color: #342d44;
    }

    html:not(.dtp-contrast-ready) .dtpci-rule {
        color: #d6d3e0;
    }

    html:not(.dtp-contrast-ready) .dtpci-sec-title,
    html:not(.dtp-contrast-ready) .dtpci-acard-nom,
    html:not(.dtp-contrast-ready) .dtpci-ej-tot-combo {
        color: #f3f4f6;
    }

    html:not(.dtp-contrast-ready) .dtpci-acard,
    html:not(.dtp-contrast-ready) .dtpci-ej {
        background: #24232b;
        border-color: #34323d;
    }

    html:not(.dtp-contrast-ready) .dtpci-eji-nom {
        color: #cbd5e1;
    }

    html:not(.dtp-contrast-ready) .dtpci-ej-foot,
    html:not(.dtp-contrast-ready) .dtpci-footer,
    html:not(.dtp-contrast-ready) .dtpci-chip {
        background: #1f1e26;
    }

    html:not(.dtp-contrast-ready) .dtpci-chip {
        color: #cbd5e1;
        border-color: #3a3947;
    }
}
