/* ============================================
   MODAL PRINCIPAL DE CHECKOUT - ESTILOS
   ============================================ */

/* Reset con scope al modal */
.modal-overlay *,
.modal-overlay *::before,
.modal-overlay *::after,
.discount-modal *,
.discount-modal *::before,
.discount-modal *::after,
.no-coverage-modal *,
.no-coverage-modal *::before,
.no-coverage-modal *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Overlay del modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: block;
    animation: modalOverlayIn 0.35s ease-out;
}

@keyframes modalOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Contenedor del modal */
.modal-container {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    height: auto;
    overflow: visible;
    position: relative;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    margin: 20px auto;
    transform: translate3d(0, 30px, 0) scale(0.97);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, height 0.5s ease-out;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.modal-overlay.active .modal-container {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
}

/* Estado de procesamiento */
.modal-container.processing {
    height: 260px;
    overflow: hidden;
}

.modal-container.processing .modal-header,
.modal-container.processing .modal-content,
.modal-container.processing .guarantee-section {
    display: none;
}

.modal-container.processing .loader-overlay {
    position: relative;
    height: 260px;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* ---- HEADER ---- */
.modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: headerSheen 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes headerSheen {
    0% { transform: translateX(-50%); }
    50% { transform: translateX(50%); }
    100% { transform: translateX(-50%); }
}

.modal-header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.modal-header-icon::before {
    content: '';
    display: none;
}

.modal-header-icon svg {
    width: 22px;
    height: 22px;
}

.modal-header-info {
    flex: 1;
    min-width: 0;
}

.modal-title {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.modal-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ff6f00, #ff8f00);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.modal-social-proof {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.modal-social-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: socialDotPulse 1.5s ease-in-out infinite;
}

@keyframes socialDotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0); }
}

.modal-social-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.modal-overlay .modal-close {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    font-size: 20px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    cursor: pointer;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 8px !important;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
    line-height: 1;
    box-shadow: none !important;
    text-decoration: none !important;
}

.modal-overlay .modal-close:hover,
.modal-overlay .modal-close:focus,
.modal-overlay .modal-close:active {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    box-shadow: none !important;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
}

/* ---- CONTENIDO ---- */
.modal-content {
    padding: 20px;
}

/* ---- OFERTAS ---- */
.offers-section {
    margin-bottom: 20px;
}

.offer-item {
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    background: #ffffff;
}

.offer-item:hover {
    border-color: #c0c0c0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.offer-item.selected {
    border-color: #ff5722;
    background: linear-gradient(135deg, #fff8f6 0%, #fff1ec 100%);
    box-shadow: 0 4px 16px rgba(255, 87, 34, 0.15), 0 0 0 1px rgba(255, 87, 34, 0.1);
    transform: scale(1.01);
    animation: offerSelect 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes offerSelect {
    from { transform: scale(0.97); opacity: 0.8; }
    to { transform: scale(1.01); opacity: 1; }
}

.offer-variations {
    animation: variationsSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes variationsSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.offer-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.offer-image {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.offer-details {
    flex: 1;
    min-width: 0;
}

.offer-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 3px;
    line-height: 1.3;
}

.offer-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: #4CAF50;
    margin-top: 3px;
    letter-spacing: 0.2px;
}

.offer-price {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    white-space: nowrap;
}

.offer-original-price {
    font-size: 13px;
    color: #b0b0b0;
    text-decoration: line-through;
    margin-bottom: 2px;
    text-align: right;
}

/* Variaciones dentro de ofertas */
.offer-variations {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.variation-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.variation-number {
    font-size: 18px;
}

.modal-overlay .variation-select-offer {
    flex: 1;
    padding: 10px 12px !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    color: #333 !important;
    background: #fafafa !important;
    transition: all 0.25s ease;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
    padding-right: 40px !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

.modal-overlay .variation-select-offer:focus {
    outline: none !important;
    border-color: #ff5722 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1) !important;
}

.modal-overlay .variation-select-offer.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* ---- DESCUENTO APLICADO ---- */
.discount-banner {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 1.5px solid #f9a825;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: none;
    animation: bannerSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.discount-banner.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.discount-banner-text {
    flex: 1;
    font-weight: 600;
    color: #e65100;
    font-size: 14px;
}

@keyframes bannerSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.discount-banner.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

/* ---- TOTALES ---- */
.totals-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #475569;
}

.total-row.discount {
    color: #e65100;
    font-weight: 700;
}

.total-row.main {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    padding-top: 12px;
    border-top: 2px solid #e2e8f0;
    margin-top: 10px;
    margin-bottom: 0;
}

.delivery-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* ---- FORMULARIO ---- */
.form-section {
    margin-bottom: 20px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 12px;
    padding-bottom: 0;
    border-bottom: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    letter-spacing: 0.5px;
}

.form-section-title svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

.modal-overlay .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-overlay .form-group {
    margin-bottom: 12px;
}

.modal-overlay .form-group label {
    display: block !important;
    margin-bottom: 4px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
    line-height: 1.4 !important;
}

.modal-overlay .form-group label .required {
    color: #ef4444 !important;
}

.modal-overlay .form-group input,
.modal-overlay .form-group select {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #1a1a1a !important;
    background: #ffffff !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.4 !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.modal-overlay .form-group input::placeholder {
    color: #b0b0b0 !important;
}

.modal-overlay .form-group select {
    background-color: #fafafa !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

.modal-overlay .form-group input:focus,
.modal-overlay .form-group select:focus {
    outline: none !important;
    border-color: #ff5722 !important;
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(255, 87, 34, 0.1) !important;
}

.modal-overlay .form-group input.error,
.modal-overlay .form-group select.error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08) !important;
}

.validation-message {
    font-size: 12px;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

.validation-message.show {
    display: flex;
    align-items: center;
    gap: 4px;
}

.validation-message.success {
    color: #16a34a;
}

.validation-message.error {
    color: #dc2626;
}

.validation-message.loading {
    color: #6b7280;
}

/* ---- UPSELL ---- */
.upsell-section {
    background: #fafafa;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upsell-section::before {
    content: 'OFERTA LIMITADA';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #ff6f00, #ff8f00);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    padding: 2px 0;
    letter-spacing: 1px;
}

.upsell-section .upsell-content {
    margin-top: 8px;
}

.upsell-section:hover {
    border-color: #ff8f00;
    box-shadow: 0 2px 12px rgba(255, 143, 0, 0.12);
}

.upsell-section.selected {
    border-color: #16a34a;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    box-shadow: 0 2px 12px rgba(22, 163, 74, 0.12);
}

.upsell-section.selected::before {
    background: linear-gradient(90deg, #16a34a, #22c55e);
    content: 'AGREGADO';
}

.upsell-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Custom checkbox para upsell */
.upsell-checkbox {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: #fff;
}

.upsell-checkbox:checked {
    background: #16a34a;
    border-color: #16a34a;
}

.upsell-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.upsell-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.upsell-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
}

/* ---- ENVIO PRIORITARIO ---- */
.priority-shipping {
    position: relative;
    background: #fafafa;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px 14px 14px 18px;
    margin-bottom: 20px;
    display: none;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.priority-shipping.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.priority-shipping:hover {
    border-color: #f97316;
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.1);
}

.priority-shipping.selected {
    border-color: #16a34a;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    box-shadow: 0 2px 12px rgba(22, 163, 74, 0.12);
}

.priority-shipping.selected .priority-accent {
    background: #16a34a;
}

.priority-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #f97316;
    border-radius: 12px 0 0 12px;
    transition: background 0.3s ease;
}

.priority-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.priority-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.priority-label {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.priority-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 6px;
}

.priority-shipping.selected .priority-badge {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.priority-benefit {
    font-size: 13px;
    font-weight: 400;
    color: #475569;
    line-height: 1.4;
}

.priority-price {
    font-weight: 700;
    color: #f97316;
}

.priority-shipping.selected .priority-price {
    color: #16a34a;
}

.priority-zone {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    line-height: 1.3;
}

/* Custom checkbox para priority */
.priority-checkbox {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: #fff;
    margin-top: 2px;
}

.priority-checkbox:checked {
    background: #16a34a;
    border-color: #16a34a;
}

.priority-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* ---- BOTONES DE PAGO ---- */
.payment-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
    padding: 8px;
}

.payment-security-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.payment-security-item svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

.modal-overlay .btn-payment {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    line-height: 1.3;
    min-height: 54px;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-cod-icon,
.btn-card-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.modal-overlay .btn-cod {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
    animation: codBtnPulse 2.5s ease-in-out infinite;
}

@keyframes codBtnPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35); }
    50% { box-shadow: 0 6px 24px rgba(22, 163, 74, 0.45); }
}

/* Shimmer en boton COD */
.modal-overlay .btn-cod::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: codShimmer 3s ease-in-out infinite;
}

@keyframes codShimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.modal-overlay .btn-cod:hover,
.modal-overlay .btn-cod:focus {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.45) !important;
    animation: none;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%) !important;
    color: white !important;
    border: none !important;
    outline: none !important;
}

.modal-overlay .btn-cod:active {
    transform: translateY(0) !important;
}

.modal-overlay .btn-cod:disabled {
    background: #d1d5db !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    animation: none;
}

.modal-overlay .btn-cod:disabled::before {
    display: none;
}

.modal-overlay .btn-card {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.modal-overlay .btn-card:hover,
.modal-overlay .btn-card:focus {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4) !important;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    color: white !important;
    border: none !important;
    outline: none !important;
}

.modal-overlay .btn-card:active {
    transform: translateY(0) !important;
}

.modal-overlay .btn-card .discount {
    font-size: 18px;
}

/* ============================================
   MODAL DE EXIT INTENT - DESCUENTO URGENTE
   ============================================ */

/* Overlay */
.discount-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.discount-modal.active {
    display: flex;
    animation: exitOverlayIn 0.3s ease-out;
}

@keyframes exitOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Contenedor principal */
.discount-modal-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: exitModalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes exitModalIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Barra superior de urgencia */
.exit-urgency-bar {
    background: linear-gradient(90deg, #d32f2f, #e53935, #ff5722, #e53935, #d32f2f);
    background-size: 200% 100%;
    animation: urgencyBarShimmer 2s linear infinite;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@keyframes urgencyBarShimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.exit-urgency-bar span {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Cuerpo del modal */
.exit-body {
    padding: 28px 24px 24px;
}

/* Headline */
.exit-headline {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 4px;
}

.exit-subheadline {
    font-size: 15px;
    color: #555555;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Countdown */
.exit-countdown-wrapper {
    margin-bottom: 20px;
}

.exit-countdown-label {
    font-size: 13px;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
}

.exit-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.exit-countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.exit-countdown-number {
    background: #1a1a1a;
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
    position: relative;
    overflow: hidden;
}

.exit-countdown-number::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.exit-countdown-unit-label {
    font-size: 10px;
    color: #999999;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.exit-countdown-separator {
    font-size: 24px;
    font-weight: 700;
    color: #d32f2f;
    margin-bottom: 16px;
    animation: exitCountdownBlink 1s steps(1) infinite;
}

@keyframes exitCountdownBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Barra de progreso de tiempo */
.exit-progress-bar {
    width: 100%;
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

.exit-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d32f2f, #ff6f00);
    border-radius: 2px;
    width: 100%;
    transition: width 1s linear;
}

/* Bloque del descuento */
.exit-discount-block {
    background: linear-gradient(135deg, #fff3e0 0%, #fce4ec 100%);
    border: 2px dashed #e53935;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    position: relative;
}

.exit-discount-amount {
    font-size: 48px;
    font-weight: 900;
    color: #d32f2f;
    line-height: 1;
    margin-bottom: 2px;
}

.exit-discount-label {
    font-size: 14px;
    color: #555555;
    font-weight: 500;
}

/* Social proof */
.exit-social-proof {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 8px;
}

.exit-social-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: exitSocialPulse 2s ease-in-out infinite;
}

@keyframes exitSocialPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.exit-social-text {
    font-size: 13px;
    color: #555555;
}

.exit-social-text strong {
    color: #1a1a1a;
}

/* Trust badges inline */
.exit-trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 12px;
    color: #777777;
}

.exit-trust-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.exit-trust-icon {
    font-size: 14px;
}

/* Boton CTA principal */
.discount-modal .btn-apply-discount {
    background: linear-gradient(135deg, #d32f2f 0%, #ff6f00 100%);
    color: #ffffff;
    padding: 18px 24px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
    animation: exitCtaPulse 2s ease-in-out infinite;
}

@keyframes exitCtaPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 6px 25px rgba(211, 47, 47, 0.5); }
}

.discount-modal .btn-apply-discount:hover,
.discount-modal .btn-apply-discount:focus {
    transform: scale(1.03) !important;
    box-shadow: 0 6px 25px rgba(211, 47, 47, 0.5) !important;
    animation: none;
    background: linear-gradient(135deg, #d32f2f 0%, #ff6f00 100%) !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
}

.discount-modal .btn-apply-discount:active {
    transform: scale(0.98) !important;
}

/* Shimmer effect en CTA */
.discount-modal .btn-apply-discount::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: exitBtnShimmer 3s ease-in-out infinite;
}

@keyframes exitBtnShimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Boton de rechazo (loss aversion) */
.discount-modal .btn-skip-discount {
    background: none !important;
    border: none !important;
    color: #aaaaaa !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 8px;
    box-shadow: none !important;
}

.discount-modal .btn-skip-discount:hover,
.discount-modal .btn-skip-discount:focus,
.discount-modal .btn-skip-discount:active {
    color: #777777 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* ============================================
   RESPONSIVO - EXIT INTENT MODAL
   ============================================ */

@media (max-width: 380px) {
    .exit-body {
        padding: 20px 16px 20px;
    }

    .exit-headline {
        font-size: 20px;
    }

    .exit-countdown-number {
        font-size: 24px;
        width: 48px;
        height: 48px;
    }

    .exit-discount-amount {
        font-size: 40px;
    }

    .discount-modal .btn-apply-discount {
        font-size: 15px;
        padding: 16px 20px;
    }
}

/* ============================================
   MODAL DE SIN COBERTURA - ESTILOS
   ============================================ */

/* Overlay */
.no-coverage-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.no-coverage-modal.active {
    display: flex;
    animation: noCoverageOverlayIn 0.3s ease-out;
}

@keyframes noCoverageOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Contenedor principal */
.no-coverage-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: noCoverageModalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes noCoverageModalIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Barra superior informativa */
.no-coverage-bar {
    background: linear-gradient(90deg, #1565c0, #1e88e5, #42a5f5, #1e88e5, #1565c0);
    background-size: 200% 100%;
    animation: noCoverageBarShimmer 3s linear infinite;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@keyframes noCoverageBarShimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.no-coverage-bar span {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.no-coverage-bar svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Cuerpo del modal */
.no-coverage-body {
    padding: 28px 24px 24px;
}

/* Icono */
.no-coverage-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #fff3e0 0%, #fce4ec 100%);
    border: 2px solid #ffcc80;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.no-coverage-icon svg {
    width: 32px;
    height: 32px;
}

/* Titulo */
.no-coverage-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

/* Texto */
.no-coverage-text {
    font-size: 15px;
    color: #555555;
    margin-bottom: 20px;
    line-height: 1.5;
}

.no-coverage-text strong {
    color: #1a1a1a;
}

/* Bloque de beneficio / descuento */
.no-coverage-benefit {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 2px dashed #4caf50;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    position: relative;
}

.no-coverage-benefit-amount {
    font-size: 36px;
    font-weight: 900;
    color: #2e7d32;
    line-height: 1;
    margin-bottom: 4px;
}

.no-coverage-benefit-label {
    font-size: 14px;
    color: #555555;
    font-weight: 500;
}

/* Trust badges */
.no-coverage-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 12px;
    color: #777777;
}

.no-coverage-trust-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.no-coverage-trust-item svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    flex-shrink: 0;
}

/* Boton CTA */
.no-coverage-modal .btn-pay-card-only {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    padding: 18px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    animation: noCoverageCtaPulse 2.5s ease-in-out infinite;
}

@keyframes noCoverageCtaPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 6px 25px rgba(37, 99, 235, 0.5); }
}

.no-coverage-modal .btn-pay-card-only:hover,
.no-coverage-modal .btn-pay-card-only:focus {
    transform: scale(1.03) !important;
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.5) !important;
    animation: none;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
}

.no-coverage-modal .btn-pay-card-only:active {
    transform: scale(0.98) !important;
}

/* Shimmer effect en CTA */
.no-coverage-modal .btn-pay-card-only::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: noCoverageBtnShimmer 3s ease-in-out infinite;
}

@keyframes noCoverageBtnShimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Boton secundario de cerrar */
.no-coverage-modal .btn-no-coverage-close {
    background: none !important;
    border: none !important;
    color: #aaaaaa !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 8px;
    box-shadow: none !important;
}

.no-coverage-modal .btn-no-coverage-close:hover,
.no-coverage-modal .btn-no-coverage-close:focus,
.no-coverage-modal .btn-no-coverage-close:active {
    color: #777777 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* ============================================
   RESPONSIVO - NO COVERAGE MODAL
   ============================================ */

@media (max-width: 380px) {
    .no-coverage-body {
        padding: 20px 16px 20px;
    }

    .no-coverage-title {
        font-size: 20px;
    }

    .no-coverage-benefit-amount {
        font-size: 30px;
    }

    .no-coverage-modal .btn-pay-card-only {
        font-size: 14px;
        padding: 16px 20px;
    }
}

/* ---- GARANTIA ---- */
.guarantee-section {
    padding: 20px;
    border-top: 1.5px solid #f0f0f0;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-radius: 0 0 16px 16px;
}

.guarantee-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.guarantee-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #4b5563;
    font-weight: 600;
}

.guarantee-item-icon {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guarantee-item-icon svg {
    width: 16px;
    height: 16px;
}

.guarantee-icon {
    display: none;
}

.guarantee-text {
    display: none;
}

.guarantee-stars {
    display: none;
}

/* ---- LOADER ---- */
.loader-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.97);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 16px;
}

.loader-overlay.show {
    display: flex;
}

.loader {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 0;
    animation: none;
    position: relative;
}

.loader::before,
.loader::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.loader::before {
    width: 48px;
    height: 48px;
    border: 3px solid #e5e7eb;
    border-top-color: #16a34a;
    border-right-color: #16a34a;
    animation: loaderSpin 0.8s ease-in-out infinite;
    top: 0;
    left: 0;
}

.loader::after {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-bottom-color: #6366f1;
    border-left-color: #6366f1;
    animation: loaderSpin 0.6s ease-in-out infinite reverse;
    top: 10px;
    left: 10px;
}

@keyframes loaderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.2px;
}

.loader-text::after {
    content: '';
    animation: loaderDots 1.5s steps(4, end) infinite;
}

@keyframes loaderDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Boton de abrir modal */
.open-modal-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.open-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.4);
}

/* Mensaje de sin cobertura (inline - legacy) */
.no-coverage-message {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.coverage-info h3 {
    color: #495057;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.coverage-info p {
    color: #6c757d;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.coverage-icon {
    font-size: 32px;
    margin-bottom: 15px;
}

.cities-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 25px;
}

.city-tag {
    background: #4CAF50;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.expanding-service {
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.expanding-service p {
    margin: 0;
    color: #2e7d32;
    font-size: 15px;
}

.dhl-logo {
    height: 18px;
    width: auto;
    margin: 0 4px;
    vertical-align: middle;
    border-radius: 4px;
    background: white;
    padding: 2px 4px;
}

/* Responsivo - Modal principal */
@media (max-width: 480px) {
    .modal-overlay {
        padding-top: 2%;
        padding-bottom: 2%;
    }

    .modal-container {
        height: auto;
        max-width: 96%;
        border-radius: 14px;
        margin: 8px auto;
        overflow: visible;
    }

    .modal-header {
        border-radius: 14px 14px 0 0;
        padding: 14px 16px;
    }

    .modal-title {
        font-size: 15px;
    }

    .modal-content {
        padding: 14px;
    }

    .modal-overlay .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .offer-image {
        width: 48px;
        height: 48px;
    }

    .offer-title {
        font-size: 13px;
    }

    .offer-price {
        font-size: 18px;
    }

    .modal-overlay .btn-payment {
        font-size: 13px;
        padding: 14px 12px;
        gap: 6px;
        min-height: 48px;
    }

    .btn-cod-icon,
    .btn-card-icon {
        width: 18px;
        height: 18px;
    }

    .payment-security {
        gap: 10px;
    }

    .guarantee-row {
        gap: 12px;
    }

    .guarantee-item {
        font-size: 11px;
    }

    .guarantee-section {
        border-radius: 0 0 14px 14px;
    }

    .discount-modal-content,
    .no-coverage-content {
        width: 95%;
    }
}

@media (max-width: 360px) {
    .modal-content {
        padding: 12px;
    }

    .modal-header-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .modal-social-proof {
        display: none;
    }

    .modal-overlay .btn-payment {
        font-size: 12px;
        padding: 12px 10px;
        letter-spacing: 0;
    }

    .btn-cod-icon,
    .btn-card-icon {
        width: 16px;
        height: 16px;
    }

    .payment-security {
        gap: 6px;
    }

    .payment-security-item {
        font-size: 10px;
    }

    .payment-security-item svg {
        width: 12px;
        height: 12px;
    }

    .guarantee-row {
        gap: 6px;
    }

    .guarantee-item {
        font-size: 10px;
        gap: 4px;
    }

    .guarantee-item-icon {
        width: 26px;
        height: 26px;
        border-radius: 6px;
    }

    .guarantee-item-icon svg {
        width: 14px;
        height: 14px;
    }
}
