/* ===================================== */
/* BASE LAYOUT */
/* ===================================== */
html,
body {
    overscroll-behavior: none;
}

.logo-wrap img {
    max-height: 150px;
}

.muted-hint {
    font-size: .92rem;
    color: #6c757d;
}

.text-hint {
    font-size: 1rem;
    color: #000000;
}

.muted-hint strong {
    color: #495057;
}

.form-section {
    border: 1px solid #eef1f4;
    border-radius: 16px;
    padding: 16px;
    background: #fff;
}

.req-star {
    color: #dc3545;
    font-weight: 700;
    margin-left: 3px;
}

.is-invalid {
    border-color: #dc3545 !important;
}

.invalid-feedback {
    display: block;
}


/* ===================================== */
/* DESKTOP STEPPER */
/* ===================================== */

.stepper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stepper .step {
    flex: 1;
    min-width: 170px;
    border: 1px solid #eef1f4;
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.stepper .dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ced4da;
    color: #6c757d;
    font-weight: 700;
}

.stepper .label .title {
    font-weight: 700;
}

.stepper .label .desc {
    font-size: .84rem;
    color: #6c757d;
}

.stepper .step.is-active {
    border-color: #194070;
}

.stepper .step.is-active .dot {
    border-color: #194070;
    color: #194070;
}

.stepper .step.is-done .dot {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}


/* ===================================== */
/* SERVICE CARDS (BASE) */
/* ===================================== */

.service-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all .2s ease;
    background: #fff;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}

.service-card.active {
    border-color: #194070;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
}

.service-card .icon-pill {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
}


/* ===================================== */
/* PRO UPGRADE: SERVICE CARDS (NO ROMPE NADA) */
/* ===================================== */
/* Esto mejora la estética del Step 1 sin obligarte a reescribir el Blade */
.service-card {
    border-radius: 14px;
}

.service-card .icon-pill {
    background: rgba(25, 64, 112, .08);
    color: #194070;
}

.service-card.active {
    background: rgba(25, 64, 112, .04);
    box-shadow: 0 0 0 3px rgba(25, 64, 112, .14);
}

.service-card .bi-chevron-right {
    transition: transform .15s ease, opacity .15s ease;
    opacity: .55;
}

.service-card:hover .bi-chevron-right {
    transform: translateX(2px);
    opacity: .8;
}

/* Alert de restricciones (se ve más “app”) */
#serviceRestrictionsWrap {
    border-radius: 14px;
    border: 1px solid rgba(220, 53, 69, .22);
    background: rgba(220, 53, 69, .06);
}


/* ===================================== */
/* COUNTRY PILL (BASE) */
/* ===================================== */

.country-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .6rem;
    border-radius: 999px;
    background: rgba(13, 110, 253, .08);
    color: #194070;
    font-weight: 600;
    font-size: .9rem;
    line-height: 1;
    white-space: nowrap;
}

.country-pill .dot {
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    background: #194070;
    display: inline-block;
}

.country-help {
    font-size: .85rem;
    color: rgba(0, 0, 0, .6);
}

.country-row {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: .75rem;
    padding: .75rem;
    background: rgba(0, 0, 0, .02);
}


/* ===================================== */
/* MOBILE APP MODE */
/* ===================================== */

@media (max-width: 768px) {

    /* Fondo general tipo app */
    .mobile-app-wrapper {
        background: #f5f7fa;
        min-height: 100dvh;
        padding: 12px;
    }

    .mobile-app-container {
        background: #fff;
        border-radius: 20px;
        padding: 20px 16px 110px 16px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    }

    /* Logo reducido */
    .logo-wrap img {
        max-height: 90px;
        margin-bottom: 15px;
    }

    /* Ocultar stepper clásico */
    .stepper {
        display: none;
    }

    /* Cada step como pantalla */
    .js-step {
        min-height: 65vh;
        padding-bottom: 20px;
    }

    /* Quitar cajas visuales */
    .card,
    .card-body {
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
    }

    .form-section {
        border: none;
        background: transparent;
        padding: 0;
    }

    /* --------- PRO: Inputs más “app” --------- */
    .form-control,
    .form-select {
        border-radius: 14px;
        padding: 12px 14px;
    }

    .form-control:focus,
    .form-select:focus {
        border-color: rgba(25, 64, 112, .45);
        box-shadow: 0 0 0 .2rem rgba(25, 64, 112, .12);
    }

    /* Service cards estilo app */
    .service-card {
        border-radius: 18px;
        padding: 16px;
        border: 1px solid rgba(0, 0, 0, .08);
    }

    .service-card.active {
        border: 2px solid #194070;
        box-shadow: 0 6px 18px rgba(25, 64, 112, .14);
    }

    .service-card .icon-pill {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    /* Botones estilo app */
    .btn {
        border-radius: 999px;
        font-weight: 700;
        padding: 14px 16px;
    }

    /* ===================================== */
    /* PRO: Sticky actions realmente “pro” */
    /* - 2 botones en grid (mitad y mitad)
     - no se pisan
     - separador superior suave
     - safe-area para iPhone */
    /* ===================================== */

    .sticky-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, .94);
        backdrop-filter: none;
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(0, 0, 0, .08);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, .10);
        z-index: 100;
    }

    /* si hay 2 botones: atrás + siguiente */
    .sticky-actions.two {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        align-items: center;
    }

    /* si hay 1 botón (ej step1) */
    .sticky-actions.one {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sticky-actions .btn {
        width: 100%;
        font-size: 1rem;
        padding: 14px 14px;
    }

    .sticky-actions .btn-outline-secondary {
        background: #fff;
        border-color: rgba(25, 64, 112, .18);
        color: #194070;
    }

    .sticky-actions .btn-outline-secondary:active {
        transform: scale(.99);
    }

    .sticky-actions .btn-primary {
        background: #194070;
        border-color: #194070;
    }

    .sticky-actions .btn-primary:active {
        transform: scale(.99);
    }

    /* input-group (prefijo teléfono) más redondo */
    .input-group .input-group-text {
        border-radius: 14px 0 0 14px;
    }

    .input-group .form-control {
        border-radius: 0 14px 14px 0;
    }

}


/* ===================================== */
/* MOBILE PROGRESS BAR */
/* ===================================== */

.mobile-progress-bar {
    margin-bottom: 20px;
}

.mobile-progress-track {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
}

.mobile-progress-fill {
    height: 100%;
    width: 33.33%;
    background: linear-gradient(90deg, #194070, #0d6efd);
    border-radius: 999px;
    transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

.mobile-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.mobile-progress-steps span {
    width: 10px;
    height: 10px;
    background: #dee2e6;
    border-radius: 50%;
    transition: all .3s ease;
}

.mobile-progress-steps span.active {
    background: #194070;
    transform: scale(1.2);
}


/* ===================================== */
/* STEP SLIDE ANIMATION */
/* ===================================== */

.js-step {
    transition: transform .35s cubic-bezier(.4, 0, .2, 1),
        opacity .25s ease;
}

.step-enter {
    transform: translateX(100%);
    opacity: 0;
}

.step-enter-active {
    transform: translateX(0);
    opacity: 1;
}

.step-exit {
    transform: translateX(0);
    opacity: 1;
}

.step-exit-active {
    transform: translateX(-100%);
    opacity: 0;
}

/* ===================================== */
/* CURRENCY SELECTOR COMPACT */
/* ===================================== */

.cash-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.currency-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.currency-option {
    width: 34px;
    height: 32px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 0;
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .18s ease;
    margin: 0;
}

.currency-option input {
    display: none;
}

.currency-option:hover {
    border-color: rgba(25, 64, 112, .35);
    background: rgba(25, 64, 112, .03);
}

.currency-option.active {
    border-color: #194070;
    background: rgba(25, 64, 112, .06);
    box-shadow: 0 0 0 2px rgba(25, 64, 112, .12);
}

.currency-flag-img-wrap {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

.currency-flag-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Bandera activa dentro del input-group */
.cash-stepper .input-group-text.cash-currency-symbol {
    width: 42px;
    justify-content: center;
    padding: 0;
    background: rgba(25, 64, 112, .05);
}

.cash-stepper .input-group-text.cash-currency-symbol img {
    width: 19px;
    height: 19px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

@media (max-width: 768px) {
    .cash-field-head {
        gap: 8px;
    }

    .currency-option {
        width: 32px;
        height: 30px;
        border-radius: 9px;
    }

    .currency-flag-img-wrap {
        width: 17px;
        height: 17px;
    }

    .cash-stepper .input-group-text.cash-currency-symbol {
        width: 40px;
    }

    .cash-stepper .input-group-text.cash-currency-symbol img {
        width: 18px;
        height: 18px;
    }
}

.transfer-summary {
    border: 1px solid #dbe7f3;
    background: #f8fbff;
    border-radius: 10px;
    padding: 12px;
    margin-top: 10px;
    color: #1f2937;
}

.transfer-summary-title {
    font-size: .98rem;
}

.transfer-breakdown {
    border-top: 1px solid #e5edf5;
    padding-top: 8px;
}

.transfer-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: .9rem;
    padding: 4px 0;
}

.transfer-breakdown-row span {
    color: #6b7280;
}

.transfer-breakdown-total {
    border-top: 1px solid #dbe7f3;
    margin-top: 6px;
    padding-top: 8px;
    font-size: .95rem;
}

.transfer-breakdown-note {
    font-size: .78rem;
    color: #6b7280;
}

/* ===================================== */
/* MARITIME LAYOUT */
/* ===================================== */

/*
 * En escritorio, cuando el servicio es marítimo,
 * Provincia y datos marítimos dejan de compartir
 * una fila 50 / 50.
 */
@media (min-width: 769px) {

    #shipmentServiceDataRow.is-maritime #deliveryStateColumn,
    #shipmentServiceDataRow.is-maritime #serviceSpecificColumn {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    /*
     * Provincia compacta.
     * No necesitamos un select enorme.
     */
    #shipmentServiceDataRow.is-maritime #deliveryStateColumn .form-section {
        height: auto !important;
    }

    #shipmentServiceDataRow.is-maritime #deliveryStateColumn .form-select {
        max-width: 520px;
    }

    /*
     * El bloque marítimo utiliza todo el ancho.
     */
    #shipmentServiceDataRow.is-maritime #serviceSpecificColumn .form-section {
        height: auto !important;
    }

    #shipmentServiceDataRow.is-maritime #blockMaritime,
    #shipmentServiceDataRow.is-maritime #maritimeCustomDimensions {
        width: 100%;
    }
}


/* ===================================== */
/* MARITIME PACKAGES */
/* ===================================== */

.maritime-package-row {
    background: #fff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 16px !important;
    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.maritime-package-row:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .04);
}

.maritime-package-row+.maritime-package-row {
    margin-top: 10px;
}


/*
 * Botón añadir caja.
 */
#addMaritimePackage {
    white-space: nowrap;
}


/*
 * Volumen individual de cada caja.
 */
.js-maritime-package-volume {
    padding-top: 4px;
}


/* ===================================== */
/* MARITIME MOBILE */
/* ===================================== */

@media (max-width: 768px) {

    /*
     * En móvil ya estamos a una columna,
     * por lo que no necesitamos ninguna
     * modificación especial de anchura.
     */
    #shipmentServiceDataRow.is-maritime #deliveryStateColumn,
    #shipmentServiceDataRow.is-maritime #serviceSpecificColumn {
        width: 100%;
    }

    .maritime-package-row {
        padding: 14px !important;
        border-radius: 14px !important;
    }

    #addMaritimePackage {
        width: 100%;
    }
}

/* ===================================== */
/* MARITIME SUMMARY / FINAL PRICE */
/* ===================================== */

#maritimeCalculationPreview {
    background: #f8fafc;
    border-color: #dfe6ee !important;
    border-radius: 14px;
}

.maritime-summary-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.maritime-final-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 14px;
    padding-top: 14px;

    border-top: 1px solid #dde5ed;
}

.maritime-final-total-label {
    font-size: 1rem;
    font-weight: 700;
    color: #172033;
}

.maritime-final-total-hint {
    margin-top: 2px;

    font-size: .82rem;
    color: #6c757d;
}

.maritime-final-total-amount {
    flex-shrink: 0;

    font-size: 1.55rem;
    line-height: 1;
    font-weight: 800;

    color: #194070;
}

.maritime-total-pending {
    margin-top: 14px;
    padding-top: 12px;

    border-top: 1px solid #dde5ed;

    color: #6c757d;
    font-size: .85rem;
}


/* MOBILE */

@media (max-width: 768px) {

    .maritime-final-total {
        align-items: flex-end;
    }

    .maritime-final-total-amount {
        font-size: 1.35rem;
    }
}