/* Mobile presentation only. No visibility, ordering, calculations or navigation logic.
   The layout opts in approved Razor Pages. Payment/cart pages never load this file.
   Embedded payment modals, cart launcher and pickup payment step are protected below. */
@media screen and (max-width: 767px) {
    .liberty-mobile-refresh :is(.card, .card-header, .card-body, .card-footer):not(:where(.modal, .modal *, #navShoppingCart, #navShoppingCart *, .card:has(#navShoppingCart))) {
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    .liberty-mobile-refresh .card:not(:where(.modal *, .card:has(#navShoppingCart))) {
        border: 0 !important;
        background-color: #fff;
        margin-left: 0 !important;
        margin-right: 0 !important;
        min-width: 0;
    }
    .liberty-mobile-refresh :is(.card-header, .card-body, .card-footer):not(.modal *) {
        padding: 16px 0 !important;
        background: #fff !important;
    }
    .liberty-mobile-refresh .card-header:not(.modal *) {
        border: 0 !important;
        border-bottom: 1px solid #dce6ef !important;
        color: #00365f !important;
    }
    .liberty-mobile-refresh .card-header :is(h2,h3,h4,h5,h6,.text-white):not(.modal *) { color: #00365f !important; }
    .liberty-mobile-refresh .card-footer:not(.modal *) { border-top: 1px solid #dce6ef; }
    .liberty-mobile-refresh :is(.form-control, .rt-input):not(:where(.modal *, [type=hidden], [type=checkbox], [type=radio])) {
        min-height: 48px;
        font-size: 16px !important;
        border-radius: 6px !important;
        max-width: 100%;
    }
    .liberty-mobile-refresh :is(.btn, .rt-primary, .rt-back, .tr-other):not(:where(.modal *, #navShoppingCart *, .account-password-toggle, .btn-action-icon)) {
        min-height: 44px;
        border-radius: 6px !important;
        white-space: normal;
    }
    .liberty-mobile-refresh :is(.encabezado, .rt-header) img.img-fluid:not(.modal *) {
        width: 120px !important; max-width: 100%; height: auto; margin-left: 0 !important;
    }
    /* Labelled back controls only: icon-only disclosure/action controls are untouched. */
    .liberty-mobile-refresh .encabezado button[onclick="history.back()"] > svg:not(.modal *),
    .liberty-mobile-refresh .rt-back > svg:not(.modal *),
    .liberty-mobile-refresh .tr-other > span[aria-hidden=true]:not(.modal *) { display: none; }
    .liberty-mobile-refresh .mobile-back-label { display: inline !important; }
    .liberty-mobile-refresh .mobile-back-caption,
    .liberty-mobile-refresh a:has(> .mobile-back-label) > img { display: none; }

    /* Inicio: retain every action, including app entry links until equivalence is verified. */
    .liberty-mobile-refresh .iqp-home { margin-top: 0; }
    .liberty-mobile-refresh .iqp-home > header > .card:first-child { padding: 12px 0 !important; }
    .liberty-mobile-refresh .iqp-home .encabezado[slug=inicio] > div { gap: 10px; }
    .liberty-mobile-refresh .iqp-home .encabezado[slug=inicio] > div > div:first-child { flex-basis: 120px; }
    .liberty-mobile-refresh .iqp-home .encabezado[slug=inicio] div[style*="border: 2px solid red"] {
        border: 0 !important; border-radius: 0 !important; background: transparent; padding: 4px 0 !important;
    }
    .liberty-mobile-refresh .iqp-home .los_envios { border: 0 !important; border-radius: 0; margin-top: 16px !important; }
    .liberty-mobile-refresh .iqp-home .los_envios > .card-header { gap: 16px; padding: 12px 0 !important; }
    .liberty-mobile-refresh .iqp-home .iqp-list-title h1 { font-size: 28px; }
    .liberty-mobile-refresh .iqp-home .los_envios > .card-header > ul.nav-pills {
        padding: 0; gap: 0; background: transparent; border: 0; border-radius: 0; width: 100%;
    }
    .liberty-mobile-refresh .iqp-home .los_envios > .card-header > ul.nav-pills .nav-item > a {
        min-height: 48px; border-radius: 0 !important; border-bottom: 3px solid transparent;
        background: transparent !important; box-shadow: none; padding: 8px 6px;
    }
    .liberty-mobile-refresh .iqp-home .los_envios > .card-header > ul.nav-pills .nav-item > a.disabled {
        border-bottom-color: #bd1737; color: #00365f !important;
    }
    .liberty-mobile-refresh .iqp-home .los_envios > .card-header > ul.nav-pills .nav-item > a.disabled small { color: #00365f !important; }
    .liberty-mobile-refresh .iqp-home .los_envios > .card-header > ul.nav-pills .nav-item > a.disabled img { filter: brightness(0); opacity: .7; }
    .liberty-mobile-refresh .iqp-home #divDataTable { padding: 12px 0 !important; }
    .liberty-mobile-refresh .iqp-home .dataTables_filter { margin-bottom: 16px; }
    /* DataTables retains its responsive child rows, ordering, pagination and action columns. */
    .liberty-mobile-refresh :is(.dataTables_filter input, .dataTables_length select):not(.modal *) { min-height: 44px; font-size: 16px; }

    /* Search and tracking: one continuous surface, real event history stays intact. */
    .liberty-mobile-refresh .search-guide { margin: 0; }
    .liberty-mobile-refresh .search-guide .rt-product { border: 0; border-radius: 0; background: #fff; }
    .liberty-mobile-refresh .search-guide .rt-header { padding: 16px 0; }
    .liberty-mobile-refresh .search-guide .rt-header img { width: 120px; height: auto; }
    .liberty-mobile-refresh .search-guide .rt-main { padding: 16px 0; }
    .liberty-mobile-refresh .search-guide .rt-layout { gap: 16px; }
    .liberty-mobile-refresh .search-guide .rt-form-card { border: 0; border-radius: 0; padding: 18px 0; box-shadow: none; }
    .liberty-mobile-refresh .search-guide .rt-shipment-photo { max-height: 130px; object-fit: cover; border-radius: 0; }
    .liberty-mobile-refresh .tracking-page :is(.tr-summary, .tr-contact, .tr-history) {
        border: 0; border-radius: 0; box-shadow: none; background: #fff; padding: 18px 0;
    }
    .liberty-mobile-refresh .tracking-page .tr-summary { border-top: 1px solid #dce6ef; border-bottom: 1px solid #dce6ef; color: #00365f; }
    .liberty-mobile-refresh .tracking-page .tr-summary :is(h2,p,.tr-label) { color: #00365f; }
    .liberty-mobile-refresh .tracking-page .tr-status-icon { background: transparent; border: 0; padding: 0; }
    .liberty-mobile-refresh .tracking-page .tr-contact { border-left: 3px solid #bd1737; padding-left: 14px; }

    /* Forms and document flows. Existing validation/readonly/hidden rules stay in charge. */
    .liberty-mobile-refresh :is(.detail-page, .prealert-page, .invoice-page, .authorization-page, .pickups-page, .liberty-flow, .register-page) {
        margin-top: 0; padding-left: 0 !important; padding-right: 0 !important;
    }
    .liberty-mobile-refresh .detail-page { background: #fff !important; }
    .liberty-mobile-refresh .detail-page .card-body:not(.modal *) { overflow-wrap: anywhere; }
    .liberty-mobile-refresh .prealert-page #viewGridUpdated > .card { padding: 16px 0 !important; }
    .liberty-mobile-refresh .prealert-page .pa-heading { margin-bottom: 16px; padding-bottom: 16px; }
    .liberty-mobile-refresh .prealert-page #frmNewPreAlert .form-check {
        background: transparent; border: 0; border-bottom: 1px solid #dce6ef; border-radius: 0; padding: 12px 0 12px 1.25rem;
    }
    .liberty-mobile-refresh .liberty-flow.liberty-flow-notice { border: 0; border-radius: 0; background: #fff; padding: 20px 0; }
    .liberty-mobile-refresh .liberty-flow-notice > .row { margin-left: 0; margin-right: 0; }
    .liberty-mobile-refresh .liberty-flow-auth .abs-center { margin: 0 !important; }
    .liberty-mobile-refresh .liberty-flow-auth .container { padding-left: 0; padding-right: 0; }
    .liberty-mobile-refresh .liberty-flow :is(.card-img-top, .card-img-bottom):not(.modal *) { border-radius: 0; }
    .liberty-mobile-refresh .register-page :is(.rg-section, .rg-header) { border-radius: 0; box-shadow: none; }
    .liberty-mobile-refresh .register-page .rg-body { padding: 16px 0 !important; }
    .liberty-mobile-refresh .register-page .rg-grid { grid-template-columns: minmax(0,1fr); }
    .liberty-mobile-refresh .register-page .rg-shell { border: 0; border-radius: 0; }
    .liberty-mobile-refresh .register-page :is(.rg-header,.rg-intro) { padding: 16px 0; background: #fff; }
    .liberty-mobile-refresh .authorization-existing > .card { padding: 16px 0 !important; }
    .liberty-mobile-refresh .authorization-page .bg-light { border: 0; border-radius: 0 !important; border-left: 3px solid #bd1737; background: #fff !important; }
    .liberty-mobile-refresh .invoice-page .upload-area { border-radius: 0; padding: 20px 12px; background: #fff; }
    .liberty-mobile-refresh .preguide-result { border: 0; border-radius: 0; box-shadow: none; padding: 20px 0; }
    .liberty-mobile-refresh .preguide-result .pd-card { border: 0; border-radius: 0; padding: 20px 0; text-align: left; }
    .liberty-mobile-refresh .pickups-page > header > .card { padding: 12px 0 !important; }
    .liberty-mobile-refresh .pickups-page > header .nav-item > a.boton.index { border-radius: 0 !important; box-shadow: none; background: #fff !important; border-width: 0 0 1px !important; }

    /* Calculator preserves its existing tab/selection CSS and input events. */
    .liberty-mobile-refresh div#mainCalculator.calc-redesign { padding: 0; margin-top: 0; }
    .liberty-mobile-refresh div#mainCalculator.calc-redesign .pantalla:not(.miVistaPrevia) { padding: 16px 0; }
    .liberty-mobile-refresh div#mainCalculator.calc-redesign .miResultado .tabla { border: 0; border-radius: 0; }
    .liberty-mobile-refresh div#mainCalculator.calc-redesign .pantalla .bloque > div > input[type=radio] + label {
        border: 0; border-radius: 0; border-bottom: 1px solid #dce6ef; background: #fff; min-height: 48px;
    }
    .liberty-mobile-refresh div#mainCalculator.calc-redesign .pantalla .bloque > div > input[type=radio]:checked + label {
        background: #edf3f8; box-shadow: inset 3px 0 #00365f;
    }

    /* Account navigation is local to these pages, not a duplicate native bottom menu. */
    .liberty-mobile-refresh .account-settings { margin: 0; }
    .liberty-mobile-refresh .account-settings-heading { padding: 16px 0; border: 0; border-radius: 0; margin-bottom: 12px; }
    .liberty-mobile-refresh .account-settings-heading h1 { font-size: 28px; }
    .liberty-mobile-refresh .account-settings-grid { gap: 16px; }
    .liberty-mobile-refresh .account-settings-nav { border: 0; border-radius: 0; padding: 0; }
    .liberty-mobile-refresh .account-settings-nav .nav { gap: 0; }
    .liberty-mobile-refresh .account-settings-nav .nav-item { flex: 1 1 140px; }
    .liberty-mobile-refresh .account-settings-nav .nav-link { border-radius: 0; border-bottom: 3px solid transparent !important; padding: 12px 8px !important; }
    .liberty-mobile-refresh .account-settings-nav .nav-link.active { background: #fff; color: #00365f; border-bottom-color: #bd1737 !important; }
    .liberty-mobile-refresh .account-settings-content #delete-user { padding: 16px 0; border: 0; border-radius: 0; }
    .liberty-mobile-refresh .account-settings-content .table-responsive:not(.modal *) { border-radius: 0; }
    /* Explicit non-payment dialogs; do not generalize to .modal-content. */
    .liberty-mobile-refresh :is(#addressModal,#AnularTMPModal,[id^="preGuiaModal_"]) .modal-content {
        border-radius: 0; box-shadow: none; border: 0;
    }
    .liberty-mobile-refresh :is(#addressModal,#AnularTMPModal,[id^="preGuiaModal_"]) :is(.modal-header,.modal-body,.modal-footer) {
        border-radius: 0; padding: 16px; background: #fff;
    }
    .liberty-mobile-refresh #addressModal .form-control { min-height: 48px; font-size: 16px; border-radius: 6px; }

    /* Pickup: touch ONLY steps 1–4. No ancestors, payment step, provider, loader or overlay rules. */
    .liberty-mobile-pickup :is(#recogidaStep1,#recogidaStep2,#recogidaStep3,#recogidaStep4) :is(.recogida-card,.recogida-cost-card) {
        border: 0; border-radius: 0; box-shadow: none; padding: 18px 0; background: #fff;
    }
    .liberty-mobile-pickup :is(#recogidaStep1,#recogidaStep2,#recogidaStep3,#recogidaStep4) :is(.recogida-btn-next,.recogida-btn-back,.recogida-btn-add-pieza) { border-radius: 6px; min-height: 48px; }
    .liberty-mobile-pickup :is(#recogidaStep1,#recogidaStep2,#recogidaStep3,#recogidaStep4) .recogida-field :is(input,select,textarea) { border-radius: 6px; font-size: 16px; }
}
