/* ============================================================
   ECOVIAL360 — dgt-checkout.css
   Checkout con estilo DGT — cuadrado, azul, institucional
   ============================================================ */

/* ── Body checkout ──────────────────────────────────────────── */
.dgt-checkout-body {
    background: #F4F6F9;
    min-height: 100vh;
}

/* ── Header checkout ────────────────────────────────────────── */
.dgt-header--checkout .dgt-header__inner {
    justify-content: space-between;
}
.dgt-header__trust-mini {
    display: flex;
    gap: 1rem;
    font-size: .78rem;
    color: rgba(255,255,255,.7);
    font-weight: 600;
}

/* ── Pasos en header ────────────────────────────────────────── */
.dgt-checkout-steps-header {
    display: flex;
    align-items: center;
    gap: 0;
}
.dgt-step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    opacity: .45;
    transition: opacity .3s;
}
.dgt-step-dot--active { opacity: 1; }
.dgt-step-dot--done   { opacity: .8; }
.dgt-step-dot__num {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255,255,255,.5);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 800;
    color: rgba(255,255,255,.8);
    background: transparent;
    transition: all .3s;
}
.dgt-step-dot--active .dgt-step-dot__num {
    background: #009FDF;
    border-color: #009FDF;
    color: #fff;
}
.dgt-step-dot--done .dgt-step-dot__num {
    background: rgba(0,159,223,.3);
    border-color: #009FDF;
    color: #fff;
}
.dgt-step-dot__label {
    font-size: .6rem;
    font-weight: 600;
    color: rgba(255,255,255,.65);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.dgt-step-dot__line {
    width: 40px;
    height: 2px;
    background: rgba(255,255,255,.2);
    margin-bottom: 14px;
}

/* ── Layout principal ───────────────────────────────────────── */
.dgt-checkout-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}
.dgt-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: start;
}

/* ── Pasos del formulario ───────────────────────────────────── */
.dgt-checkout-paso {
    background: #fff;
    border: 1px solid #D0D9E6;
    margin-bottom: 2px;
    transition: border-color .2s;
}
.dgt-checkout-paso--active { border-color: #009FDF; border-left: 4px solid #009FDF; }
.dgt-checkout-paso--done   { border-left: 4px solid #00863E; }
.dgt-checkout-paso--locked { opacity: .5; pointer-events: none; }

.dgt-checkout-paso__header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #EEF2F7;
    cursor: pointer;
}
.dgt-checkout-paso__num {
    font-size: .65rem;
    font-weight: 900;
    letter-spacing: .1em;
    color: #fff;
    background: #003366;
    padding: .35em .8em;
    flex-shrink: 0;
}
.dgt-checkout-paso--done .dgt-checkout-paso__num { background: #00863E; }
.dgt-checkout-paso--active .dgt-checkout-paso__num { background: #009FDF; }

.dgt-checkout-paso__header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #1A2B3C;
    margin-bottom: 2px;
}
.dgt-checkout-paso__header p {
    font-size: .78rem;
    color: #6B7280;
}

.dgt-checkout-paso__body {
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Campos ─────────────────────────────────────────────────── */
.dgt-field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.dgt-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.dgt-field__label {
    font-size: .82rem;
    font-weight: 700;
    color: #1A2B3C;
}
.dgt-req { color: #CC2929; }

.dgt-field__input {
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    color: #1A2B3C;
    background: #fff;
    border: 2px solid #D0D9E6;
    border-radius: 0;
    padding: .75rem 1rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}
.dgt-field__input:focus {
    border-color: #005EA2;
    box-shadow: 0 0 0 3px rgba(0,94,162,.12);
}
.dgt-field__input.is-error { border-color: #CC2929; }
.dgt-field__input.is-valid { border-color: #00863E; }
.dgt-field__error {
    font-size: .75rem;
    color: #CC2929;
    min-height: 1.1em;
}

.dgt-field-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #005EA2;
    margin: .5rem 0;
}
.dgt-field-divider::before,
.dgt-field-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #D0D9E6;
}

/* ── Botones ─────────────────────────────────────────────────── */
.dgt-btn--full { width: 100%; }
.dgt-btn--pagar {
    font-size: 1.1rem;
    padding: 1.1rem 2rem;
    box-shadow: 0 4px 20px rgba(0,159,223,.3);
}

/* ── Resumen paso 4 ─────────────────────────────────────────── */
.dgt-checkout-resumen {
    border: 1px solid #D0D9E6;
    overflow: hidden;
}
.dgt-resumen-row {
    display: flex;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid #EEF2F7;
    font-size: .88rem;
}
.dgt-resumen-row:last-child { border-bottom: none; }
.dgt-resumen-label { color: #4A5D70; }
.dgt-resumen-val { font-weight: 600; color: #1A2B3C; }
.dgt-resumen-row--total {
    background: #003366;
    color: #fff;
    padding: 1rem;
}
.dgt-resumen-row--total .dgt-resumen-label { color: rgba(255,255,255,.8); }
.dgt-resumen-total { font-size: 1.2rem; font-weight: 800; color: #009FDF; }

/* ── Checkbox términos ───────────────────────────────────────── */
.dgt-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    cursor: pointer;
    font-size: .85rem;
    color: #4A5D70;
    line-height: 1.5;
}
.dgt-checkbox-label input { position: absolute; opacity: 0; pointer-events: none; }
.dgt-checkbox-box {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #D0D9E6;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    margin-top: 1px;
}
.dgt-checkbox-label input:checked + .dgt-checkbox-box {
    background: #005EA2;
    border-color: #005EA2;
}
.dgt-checkbox-label input:checked + .dgt-checkbox-box::after {
    content: '';
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
    display: block;
}
.dgt-checkbox-label a { color: #005EA2; text-decoration: underline; }

/* ── Seguridad ──────────────────────────────────────────────── */
.dgt-checkout-seguridad {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    font-size: .75rem;
    color: #6B7280;
    flex-wrap: wrap;
    padding-top: .5rem;
    border-top: 1px solid #EEF2F7;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */
.dgt-checkout-sidebar {
    position: sticky;
    top: 5.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dgt-sidebar-card {
    background: #fff;
    border: 1px solid #D0D9E6;
    overflow: hidden;
}
.dgt-sidebar-card__header {
    background: #003366;
    padding: 1rem 1.25rem;
}
.dgt-sidebar-card__header h3 {
    font-size: .88rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.dgt-sidebar-card__body { padding: 1.25rem; }

.dgt-sidebar-producto {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #EEF2F7;
    margin-bottom: 1rem;
}
.dgt-sidebar-producto img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: #EEF4FB;
    padding: 6px;
    flex-shrink: 0;
}
.dgt-sidebar-producto__name { font-size: .88rem; font-weight: 700; color: #1A2B3C; margin-bottom: 3px; }
.dgt-sidebar-producto__sub  { font-size: .75rem; color: #6B7280; }

.dgt-sidebar-lineas { display: flex; flex-direction: column; gap: 0; }
.dgt-sidebar-linea {
    display: flex;
    justify-content: space-between;
    padding: .5rem 0;
    border-bottom: 1px solid #F4F6F9;
    font-size: .82rem;
    color: #4A5D70;
}
.dgt-gratis { font-weight: 700; color: #00863E; font-size: .75rem; }

.dgt-sidebar-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #003366;
    font-weight: 700;
    font-size: .9rem;
    color: #1A2B3C;
}
.dgt-sidebar-total__amount { font-size: 1.4rem; font-weight: 900; color: #003366; }

/* Trust sidebar */
.dgt-sidebar-trust {
    background: #fff;
    border: 1px solid #D0D9E6;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.dgt-sidebar-trust__item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}
.dgt-sidebar-trust__item svg { color: #009FDF; flex-shrink: 0; margin-top: 2px; }
.dgt-sidebar-trust__item strong { display: block; font-size: .82rem; color: #1A2B3C; }
.dgt-sidebar-trust__item span  { font-size: .75rem; color: #6B7280; }

/* DGT logo sidebar */
.dgt-sidebar-dgt {
    background: #EEF4FB;
    border: 1px solid #D0D9E6;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.dgt-sidebar-dgt__logo { width: 80px; flex-shrink: 0; }
.dgt-sidebar-dgt p { font-size: .75rem; color: #4A5D70; font-weight: 600; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .dgt-checkout-layout { grid-template-columns: 1fr; }
    .dgt-checkout-sidebar { position: static; }
    .dgt-checkout-steps-header { display: none; }
    .dgt-header__trust-mini { display: none; }
}
@media (max-width: 540px) {
    .dgt-field-row { grid-template-columns: 1fr; }
    .dgt-checkout-main { padding: 1rem; }
}
/* ── Ocultar botón Continuar en pasos completados ───────────────────────── */
.dgt-checkout-paso--done .dgt-btn--cta {
    display: none !important;
}