/* ═══════════════════════════════════════════════════════════
   WC Modal Manual Payments - Estilos mejorados
   Versión: 2.0
   ═══════════════════════════════════════════════════════════ */

/* ───── BODY LOCK ───── */
body.wc-mmp-modal-open {
    overflow: hidden;
}

/* ───── OVERLAY ───── */
.wc-mmp-modal-overlay {
    position: fixed;
    z-index: 999999;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: wcMmpFadeIn 0.25s ease-out;
}

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

@keyframes wcMmpSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ───── MODAL CONTAINER ───── */
.wc-mmp-modal {
    position: relative;
    width: min(980px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
    border-radius: 20px;
    padding: 0;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: wcMmpSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Scrollbar personalizado */
.wc-mmp-modal::-webkit-scrollbar {
    width: 8px;
}
.wc-mmp-modal::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.wc-mmp-modal::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.wc-mmp-modal::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ───── HEADER ───── */
.wc-mmp-modal-header {
    background: linear-gradient(135deg, #e4f4f3 0%, #d1eceb 100%);
    color: #0d3b3a;
    padding: 32px 32px 28px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(13, 107, 106, 0.1);
}

.wc-mmp-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0d6b6a, #14b8a6, #0d6b6a);
    border-radius: 20px 20px 0 0;
}

.wc-mmp-modal-header .wc-mmp-logo-img {
    height: 52px;
    width: auto;
    margin-bottom: 12px;
    border-radius: 10px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
    transition: transform 0.3s ease;
}

.wc-mmp-modal-header .wc-mmp-logo-img:hover {
    transform: scale(1.05);
}

.wc-mmp-modal-header h2 {
    margin: 8px 0 6px;
    color: #0d3b3a;
    font-size: 1.45em;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.wc-mmp-modal-subtitle {
    margin: 0;
    font-size: 0.92em;
    color: #4a6b6a;
    font-weight: 500;
    line-height: 1.5;
}

/* ───── BOTÓN CERRAR ───── */
.wc-mmp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: 0;
    background: rgba(255, 255, 255, 0.7);
    color: #0d3b3a;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wc-mmp-modal-close:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.wc-mmp-modal-close:focus {
    outline: 2px solid #0d6b6a;
    outline-offset: 2px;
}

/* ───── GRID ───── */
.wc-mmp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 28px 32px 0;
}

.wc-mmp-grid h3 {
    margin: 0 0 14px;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-mmp-grid h3::before {
    content: '';
    width: 4px;
    height: 14px;
    background: linear-gradient(180deg, #0d6b6a, #14b8a6);
    border-radius: 2px;
}

.wc-mmp-block {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.wc-mmp-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

/* ───── BLOQUE RECEPTOR DESTACADO ───── */
.wc-mmp-block-receiver {
    background: linear-gradient(135deg, #e4f4f3 0%, #f0faf9 100%);
    border: 2px solid #a7d9d7;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(13, 107, 106, 0.06);
}

.wc-mmp-block-receiver::after {
    content: '🔒';
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 16px;
    opacity: 0.5;
}

.wc-mmp-block-receiver h3 {
    color: #0d6b6a;
    margin-bottom: 12px;
    font-size: 0.82em;
}

.wc-mmp-block-receiver h3::before {
    background: linear-gradient(180deg, #0d6b6a, #14b8a6);
}

/* ───── RESUMEN DEL PEDIDO ───── */
.wc-mmp-order-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    font-size: 0.93em;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.wc-mmp-order-summary table {
    width: 100%;
    border-collapse: collapse;
}

.wc-mmp-order-summary table th,
.wc-mmp-order-summary table td {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.wc-mmp-order-summary table th {
    font-weight: 600;
    color: #475569;
}

.wc-mmp-order-summary table tr:last-child th,
.wc-mmp-order-summary table tr:last-child td {
    border-bottom: 0;
    font-weight: 700;
    color: #0f172a;
    font-size: 1.05em;
}

.wc-mmp-order-summary .woocommerce-checkout-payment,
.wc-mmp-order-summary #payment {
    display: none !important;
}

/* ───── LISTAS ───── */
.wc-mmp-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wc-mmp-list li {
    padding: 8px 0;
    font-size: 0.94em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #334155;
}

.wc-mmp-list li:last-child {
    border-bottom: 0;
}

.wc-mmp-list li strong {
    flex-shrink: 0;
    min-width: 125px;
    color: #64748b;
    font-size: 0.88em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wc-mmp-block-receiver .wc-mmp-list li strong {
    color: #0d6b6a;
}

.wc-mmp-block-receiver .wc-mmp-list li {
    border-color: rgba(13, 107, 106, 0.1);
    color: #134e4a;
}

/* Teléfono destacado con efecto */
.wc-mmp-phone-value {
    font-size: 1.15em;
    color: #0d6b6a;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    letter-spacing: 0.02em;
    display: inline-block;
    padding: 2px 8px;
    background: rgba(13, 107, 106, 0.08);
    border-radius: 6px;
    position: relative;
}

.wc-mmp-phone-value::before {
    content: '📞';
    margin-right: 6px;
    font-size: 0.9em;
}

/* ───── CAMPOS DE FORMULARIO ───── */
.wc-mmp-field {
    margin-bottom: 18px;
}

.wc-mmp-field:last-child {
    margin-bottom: 0;
}

.wc-mmp-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #334155;
    letter-spacing: 0.01em;
}

.wc-mmp-field input {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95em;
    color: #0f172a;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.wc-mmp-field input:hover {
    border-color: #cbd5e1;
}

.wc-mmp-field input:focus {
    border-color: #0d6b6a;
    box-shadow: 0 0 0 4px rgba(13, 107, 106, 0.1);
    outline: none;
    background: #ffffff;
}

.wc-mmp-field input::placeholder {
    color: #94a3b8;
    font-size: 0.9em;
}

/* ───── MENSAJE DE ERROR ───── */
.wc-mmp-error {
    color: #991b1b;
    font-weight: 600;
    font-size: 0.9em;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 14px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: wcMmpShake 0.4s ease-in-out;
}

.wc-mmp-error::before {
    content: '⚠️';
    font-size: 1.1em;
}

@keyframes wcMmpShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ───── BOTONES DE ACCIÓN ───── */
.wc-mmp-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px 32px 32px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0 0 20px 20px;
    margin-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.wc-mmp-cancel-btn,
.wc-mmp-process-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    text-align: center;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 0.95em;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
    line-height: 1.4;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.wc-mmp-cancel-btn {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.wc-mmp-cancel-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wc-mmp-cancel-btn:active {
    transform: translateY(0);
}

.wc-mmp-process-btn {
    background: linear-gradient(135deg, #0d6b6a 0%, #0f766e 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow:
        0 4px 14px rgba(13, 107, 106, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.wc-mmp-process-btn:hover {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    box-shadow:
        0 8px 24px rgba(13, 107, 106, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.wc-mmp-process-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(13, 107, 106, 0.25);
}

.wc-mmp-process-btn:focus,
.wc-mmp-cancel-btn:focus {
    outline: 2px solid #0d6b6a;
    outline-offset: 2px;
}

/* ───── ICONO EN CHECKOUT ───── */
ul.payment_methods li img {
    max-width: 90px !important;
    height: auto;
    transition: transform 0.2s ease;
}

ul.payment_methods li img:hover {
    transform: scale(1.05);
}

.wc-mmp-gateway-icon,
.wc-mmp-checkout-icon {
    max-height: 90px;
    width: auto;
}

/* ───── PÁGINA THANKYOU ───── */
.wc-mmp-thankyou-instructions {
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin: 28px 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wc-mmp-thankyou-instructions h2 {
    color: #0d6b6a;
    margin-bottom: 16px;
    font-size: 1.3em;
    font-weight: 700;
}

.wc-mmp-thankyou-instructions p {
    color: #334155;
    line-height: 1.6;
    margin-bottom: 10px;
}

.wc-mmp-thankyou-instructions strong {
    color: #0d6b6a;
    font-weight: 600;
}

/* ───── RESPONSIVE ───── */
@media (max-width: 768px) {
    .wc-mmp-modal-overlay {
        padding: 16px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .wc-mmp-modal {
        max-height: 95vh;
        border-radius: 16px;
    }

    .wc-mmp-modal-header {
        padding: 24px 20px 20px;
        border-radius: 16px 16px 0 0;
    }

    .wc-mmp-modal-header .wc-mmp-logo-img {
        height: 42px;
    }

    .wc-mmp-modal-header h2 {
        font-size: 1.25em;
    }

    .wc-mmp-modal-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .wc-mmp-grid {
        padding: 20px 20px 0;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .wc-mmp-actions {
        padding: 20px 20px 24px;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .wc-mmp-cancel-btn,
    .wc-mmp-process-btn {
        width: 100%;
        min-width: auto;
    }

    .wc-mmp-list li strong {
        min-width: 100px;
        font-size: 0.85em;
    }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
    .wc-mmp-modal-overlay {
        padding: 8px;
        padding-top: 24px;
    }

    .wc-mmp-modal-header {
        padding: 20px 16px 18px;
    }

    .wc-mmp-modal-header h2 {
        font-size: 1.15em;
    }

    .wc-mmp-modal-subtitle {
        font-size: 0.85em;
    }

    .wc-mmp-grid {
        padding: 16px 16px 0;
        gap: 16px;
    }

    .wc-mmp-block {
        margin-bottom: 18px;
        padding-bottom: 18px;
    }

    .wc-mmp-block-receiver {
        padding: 16px;
    }

    .wc-mmp-actions {
        padding: 16px 16px 20px;
    }

    .wc-mmp-cancel-btn,
    .wc-mmp-process-btn {
        padding: 12px 20px;
        font-size: 0.9em;
    }

    .wc-mmp-phone-value {
        font-size: 1.05em;
    }
}