/* ======== FORMULARIO COMPACTO ======== */
@media (min-width: 768px) {
    #tipoPortesContainer {
        display: flex;
        gap: 1rem;
        align-items: flex-end;
    }
}
.select2-container .select2-selection--single { height: 31px !important; }
.row.g-2.mb-1 { margin-bottom: 1rem !important; }
.row.g-2 > [class*=col] { margin-top: 0 !important; }
#formEnvioCompacto .form-control,
#formEnvioCompacto .form-select { padding: .25rem .5rem; font-size: .875rem; }
#formEnvioCompacto .form-label { margin-bottom: .25rem; }
#selectorDestinatario .form-select-sm { padding: .20rem .35rem; font-size: .80rem; line-height: 1.25; }
.btn-icon { padding: .25rem .45rem; line-height: 1; }
.table-sm td, .table-sm th { font-size: .78rem; vertical-align: middle; padding: .4rem .55rem; }
.td-ellipsis { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#spinnerCalculo { vertical-align: -0.25em; }

/* ======== TOGGLE TIPO ENVÍO ======== */
#tipoEnvioToggleWrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
    padding: 0vh 3vh;
}

.zb-mode-toggle {
    width: 100%;
}

.zb-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    width: 100%;
    align-items: stretch;
}

.zb-mode-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    min-height: 46px;
    padding: 7px 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-align: left;
    cursor: pointer;
    user-select: none;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        background-color .16s ease,
        border-color .16s ease,
        color .16s ease,
        opacity .16s ease;
}

.zb-mode-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(15, 23, 42, .13);
}

.zb-mode-icon {
    font-size: 1.32rem;
    line-height: 1;
    flex-shrink: 0;
}

.zb-mode-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.zb-mode-text strong {
    font-size: .96rem;
    font-weight: 700;
    letter-spacing: .03em;
}

.zb-mode-text small {
    font-size: .72rem;
    margin-top: 2px;
    opacity: .9;
}

.zb-mode-card-envio {
    color: #0d6efd;
}

#opt_envio:checked + .zb-mode-card-envio {
    background: linear-gradient(135deg, #0d6efd, #0857d8);
    border-color: #0d6efd;
    color: #fff;
}

.zb-mode-card-recogida {
    color: #f26f03;
}

#opt_recogida:checked + .zb-mode-card-recogida {
    background: linear-gradient(135deg, #ff9800, #f26f03);
    border-color: #f26f03;
    color: #fff;
}

.zb-mode-card-interciudad {
    min-width: 165px;
    color: #9aa3af;
    background: #f8f9fa;
    box-shadow: none;
}

.zb-mode-badge {
    font-size: .62rem;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    background: #adb5bd;
    color: #fff;
    margin-left: 2px;
}

#tipoEnvioToggleWrapper .btn-check:disabled + .zb-mode-card {
    opacity: .48;
    pointer-events: none;
}

@media (max-width: 768px) {
    .zb-mode-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .zb-mode-card {
        min-height: 44px;
        justify-content: flex-start;
    }

    .zb-mode-card-interciudad {
        min-width: 0;
    }
}
#tipoEnvioToggleWrapper .btn-check:disabled + .btn {
    opacity: .45;
    pointer-events: none;
}

/* ======== OVERLAY ETIQUETA ======== */
#etiquetaOverlay {
    position: fixed; inset: 0; z-index: 99999;
    display: grid; place-items: center;
    background: rgba(15,16,20,.65); backdrop-filter: blur(3px);
}
#etiquetaOverlay .card {
    background: #fff; border-radius: 14px;
    padding: 1.25rem 1.5rem; width: min(640px, 92vw);
    box-shadow: 0 20px 45px rgba(0,0,0,.25);
}
#etiquetaOverlay .head {
    display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem;
}
#etiquetaOverlay .badge-agencia {
    background: #f3f4f6; border-radius: 999px; padding: .25rem .6rem; font-size: .8rem;
}
#etiquetaOverlay h4 { margin: 0; font-size: 1.15rem; }
#etiquetaOverlay p { margin: .35rem 0 0; color: #444; font-size: .95rem; }
#etiquetaOverlay .footer {
    display:flex; justify-content: space-between; align-items:center; margin-top: .9rem;
}
#etiquetaOverlay .help { font-size: .85rem; color: #555; }

/* ======== TABLA AGENCIAS ======== */
.modern-table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.modern-table td {
    font-size: 0.8rem;
    vertical-align: middle;
    padding: 0.35rem 0.6rem;
}
.agencia-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
}
.agencia-cell img {
    width: 38px; height: 38px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #eee;
}
.agencia-cell span { line-height: 1.1; }
.modern-table td.text-center { font-weight: 500; }
.modern-table tbody tr:hover { background-color: #f7faff; transition: background-color 0.2s; }
.precio-minimo { color: #28a745 !important; font-weight: bold !important; }

/* ======== COLUMNA ACCIÓN ======== */
.accion-agencia {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    white-space: nowrap;
}
.btn-etiqueta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 5px 12px;
    min-width: 135px;
    height: 30px;
    border-radius: 6px;
    font-weight: 600;
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(13, 110, 253, 0.25);
}
.btn-etiqueta i { font-size: 0.95rem; }
.btn-etiqueta:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.35);
}
.retorno-opcion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
    padding: 0 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #333;
    font-weight: 500;
    min-width: 135px;
}
.retorno-opcion label { margin-bottom: 0; cursor: pointer; }
.retorno-opcion .form-check-input { width: 1em; height: 1em; }
.retorno-opcion i { font-size: 0.85rem; color: #0d6efd; }
.table-info {background-color: #e6f3ff !important; }
#tablaAgenciasDisponibles.hide-reembolso-col th:nth-child(4),
#tablaAgenciasDisponibles.hide-reembolso-col td:nth-child(4) {
    display: none !important;
}
#tablaAgenciasDisponibles thead th.th-reembolso{
    width: 100px;
    white-space: normal;
    line-height: 1.05;
    letter-spacing: 0.01em;
    font-size: 0.78rem;
}

/* ======== BOX DESTINO RECOGIDA ======== */
#destinoRecogidaBox {
    border-left: 3px solid #0dcaf0;
}