/* ============================================================
   Standalone Checkout — /pagos/
   Self-contained CSS. No theme/Elementor/FluidCheckout deps.
   ============================================================ */

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body.tm-checkout-body{
    min-height:100vh;
    display:flex;
    flex-direction:column;
    margin:0;
    font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    font-size:14px;
    line-height:1.5;
    color:#1a1a2e;
    background:#f8fafc;
    -webkit-font-smoothing:antialiased;
}
img{max-width:100%;height:auto;display:block}
a{color:#7C3AED;text-decoration:none}
a:hover{text-decoration:underline}

/* Topbar */
.tm-checkout-topbar{
    background:#fff;
    border-bottom:1px solid #e2e8f0;
    padding:16px 20px;
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:center;
    gap:12px;
    position:sticky;
    top:0;
    z-index:999;
}
.tm-checkout-topbar .tm-checkout-progress{justify-self:center}
@media (max-width:520px){
    .tm-checkout-topbar{
        grid-template-columns:auto 1fr;
    }
    .tm-checkout-topbar .tm-checkout-progress{justify-self:end}
}
.tm-checkout-logo-link{display:block;line-height:0}
.tm-checkout-logo{height:clamp(26px,4vw,36px);width:auto}
.tm-checkout-progress{
    display:flex;
    align-items:center;
    gap:10px;
    font-size:13px;
    color:#64748b;
    font-weight:500;
}
.tm-checkout-progress-step{display:flex;align-items:center;gap:8px}
.tm-checkout-progress-dot{
    display:inline-flex;align-items:center;justify-content:center;
    width:26px;height:26px;border-radius:50%;
    background:#e2e8f0;color:#64748b;font-weight:600;font-size:12px;
    transition:all .2s ease;
}
.tm-checkout-progress-step--active .tm-checkout-progress-dot,
.tm-checkout-progress-step--done .tm-checkout-progress-dot{
    background:linear-gradient(135deg,#9769ff,#7C3AED);color:#fff;
}
.tm-checkout-progress-step--active .tm-checkout-progress-label{color:#1a1a2e}
.tm-checkout-progress-line{width:32px;height:2px;background:#e2e8f0}

/* Main layout */
.tm-checkout-main{
    flex:1;
    width:100%;
    max-width:1400px;
    margin:0 auto;
    padding:clamp(16px,3vw,32px);
}
.tm-checkout-layout{
    display:grid;
    grid-template-columns:1fr clamp(320px,35vw,480px);
    gap:clamp(20px,3vw,32px);
    align-items:start;
}
@media (max-width:899px){
    .tm-checkout-layout{grid-template-columns:1fr}
    .tm-checkout-col-sidebar{order:-1}
}

/* Steps */
.tm-checkout-step{
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:14px;
    padding:clamp(18px,3vw,28px);
    box-shadow:0 1px 3px rgba(0,0,0,.04);
    margin-bottom:16px;
}
.tm-checkout-step[hidden]{display:none}
.tm-checkout-step-title{
    margin:0 0 20px;
    font-size:18px;
    font-weight:700;
    color:#1a1a2e;
    letter-spacing:-.01em;
}
.tm-checkout-field-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px 16px;
}
.tm-checkout-field{display:flex;flex-direction:column;gap:6px}
.tm-checkout-field--half{grid-column:span 1}
.tm-checkout-field:not(.tm-checkout-field--half){grid-column:1/-1}
@media (max-width:520px){
    .tm-checkout-field-grid{grid-template-columns:1fr}
    .tm-checkout-field--half{grid-column:1/-1}
}
.tm-checkout-field label{
    font-size:13px;
    font-weight:600;
    color:#374151;
}
.tm-checkout-field input{
    width:100%;
    padding:11px 14px;
    border:1px solid #d0d5dd;
    border-radius:10px;
    background:#fff;
    font-family:inherit;
    font-size:14px;
    color:#1a1a2e;
    transition:border-color .15s,box-shadow .15s;
}
.tm-checkout-field input:focus{
    outline:none;
    border-color:#7C3AED;
    box-shadow:0 0 0 3px rgba(124,58,237,.1);
}
.tm-checkout-field input[aria-invalid="true"]{
    border-color:#e85347;
    background:#fff5f5;
}
.tm-checkout-field-hint{
    display:block;
    font-size:12px;
    color:#64748b;
    margin-top:4px;
    line-height:1.4;
}
.tm-checkout-field-hint[hidden]{display:none}
.tm-checkout-field-hint.is-warning{
    color:#d97706;
    font-weight:500;
    animation:tm-shake .3s ease;
}
@keyframes tm-shake{
    0%,100%{transform:translateX(0)}
    25%{transform:translateX(-3px)}
    75%{transform:translateX(3px)}
}

/* Phone group: selector de pais + input de numero */
.tm-checkout-phone-group{
    display:grid;
    grid-template-columns:auto 1fr;
    gap:8px;
    align-items:stretch;
}
.tm-checkout-phone-number{width:100%}

/* ── Custom phone country picker ── */
.tm-phone-picker{position:relative}
.tm-phone-picker-button{
    appearance:none;
    background:#fff;
    border:1px solid #d0d5dd;
    border-radius:10px;
    padding:11px 10px;
    font-family:inherit;
    font-size:14px;
    color:#1a1a2e;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:6px;
    height:100%;
    min-width:100px;
    transition:border-color .15s,box-shadow .15s;
}
.tm-phone-picker-button:hover{border-color:#a4aebd}
.tm-phone-picker-button:focus-visible{
    outline:none;
    border-color:#7C3AED;
    box-shadow:0 0 0 3px rgba(124,58,237,.1);
}
.tm-phone-picker-button[aria-expanded="true"]{
    border-color:#7C3AED;
    box-shadow:0 0 0 3px rgba(124,58,237,.1);
}
.tm-phone-picker-flag{font-size:18px;line-height:1}
.tm-phone-picker-label{font-weight:600;white-space:nowrap;font-size:13px}
.tm-phone-picker-caret{
    font-size:10px;
    color:#64748b;
    margin-left:2px;
    transition:transform .15s;
}
.tm-phone-picker-button[aria-expanded="true"] .tm-phone-picker-caret{
    transform:rotate(180deg);
}

.tm-phone-picker-dropdown{
    position:absolute;
    top:calc(100% + 4px);
    left:0;
    width:320px;
    max-width:calc(100vw - 40px);
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:12px;
    box-shadow:0 10px 30px rgba(0,0,0,.12);
    z-index:50;
    overflow:hidden;
    display:flex;
    flex-direction:column;
}
/* hidden attr prevalece sobre display:flex */
.tm-phone-picker-dropdown[hidden]{display:none}
.tm-phone-picker-search{
    appearance:none;
    border:none;
    border-bottom:1px solid #e2e8f0;
    padding:11px 14px;
    font-family:inherit;
    font-size:14px;
    color:#1a1a2e;
    outline:none;
    background:#f8fafc;
}
.tm-phone-picker-search:focus{background:#fff}
.tm-phone-picker-list{
    list-style:none;
    margin:0;
    padding:6px 0;
    max-height:320px;
    overflow-y:auto;
    overscroll-behavior:contain;
}
.tm-phone-picker-option{
    display:grid;
    grid-template-columns:24px 1fr auto;
    align-items:center;
    gap:10px;
    padding:9px 14px;
    cursor:pointer;
    font-size:13px;
    transition:background .1s;
}
.tm-phone-picker-option:hover,
.tm-phone-picker-option.is-highlighted{background:#f7f2ff}
.tm-phone-picker-option[aria-selected="true"]{background:#e8e0f7;font-weight:600}
.tm-phone-picker-option[hidden]{display:none}
.tm-phone-picker-opt-flag{font-size:18px;line-height:1}
.tm-phone-picker-opt-name{color:#1a1a2e;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-phone-picker-opt-dial{color:#64748b;font-variant-numeric:tabular-nums}
.tm-phone-picker-divider{
    height:1px;
    background:#e2e8f0;
    margin:6px 14px;
    list-style:none;
}
.tm-checkout-req{color:#e85347}

.tm-checkout-step-actions{
    display:flex;
    gap:12px;
    justify-content:flex-end;
    margin-top:24px;
    flex-wrap:wrap;
}
.tm-checkout-step-actions .tm-checkout-btn--secondary{margin-right:auto}

/* Buttons */
.tm-checkout-btn{
    appearance:none;
    border:none;
    cursor:pointer;
    font-family:inherit;
    font-size:14px;
    font-weight:600;
    padding:12px 20px;
    border-radius:10px;
    transition:transform .1s,box-shadow .15s,opacity .15s;
    display:inline-flex;align-items:center;gap:8px;
    text-decoration:none;
}
.tm-checkout-btn:hover{transform:translateY(-1px)}
.tm-checkout-btn:active{transform:translateY(0)}
.tm-checkout-btn:disabled{opacity:.6;cursor:not-allowed;transform:none}
.tm-checkout-btn--primary{
    background:linear-gradient(135deg,#9769ff,#7C3AED);
    color:#fff;
    box-shadow:0 2px 8px rgba(124,58,237,.25);
}
.tm-checkout-btn--primary:hover{box-shadow:0 4px 14px rgba(124,58,237,.35)}
.tm-checkout-btn--secondary{
    background:#fff;
    color:#374151;
    border:1px solid #d0d5dd;
}
.tm-checkout-btn--secondary:hover{background:#f8fafc}

.tm-checkout-submit{min-width:180px;justify-content:center;font-size:15px;padding:14px 24px}
.tm-checkout-submit-spinner{
    width:16px;height:16px;
    border:2px solid rgba(255,255,255,.3);
    border-top-color:#fff;
    border-radius:50%;
    animation:tm-spin .6s linear infinite;
}
@keyframes tm-spin{to{transform:rotate(360deg)}}

/* Gateways */
.tm-checkout-gateways{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.tm-checkout-gateway-label{
    display:grid;
    grid-template-columns:auto 1fr;
    grid-template-rows:auto auto;
    gap:4px 12px;
    padding:14px 16px;
    border:1px solid #d0d5dd;
    border-radius:10px;
    background:#fff;
    cursor:pointer;
    transition:border-color .15s,background .15s;
}
.tm-checkout-gateway-label:has(input[name="payment_method"]:checked){
    border-color:#7C3AED;
    background:#f7f2ff;
    box-shadow:0 0 0 3px rgba(124,58,237,.08);
}
.tm-checkout-gateway-label input{
    grid-row:1/span 2;
    align-self:center;
    width:18px;height:18px;accent-color:#7C3AED;
    margin:0;
}
.tm-checkout-gateway-title{
    font-weight:600;
    color:#1a1a2e;
    display:flex;align-items:center;gap:8px;
}
.tm-checkout-gateway-icon img{max-height:20px;width:auto;display:inline}
.tm-checkout-gateway-desc{
    grid-column:2;
    font-size:12px;color:#64748b;
}
.tm-checkout-gateway-empty{
    padding:16px;
    background:#fff5f5;
    border:1px solid #fecaca;
    border-radius:8px;
    color:#991b1b;
}

/* Terms */
.tm-checkout-terms{
    margin:18px 0 0;
    padding:14px;
    background:#f8fafc;
    border-radius:10px;
    transition:background .2s ease, box-shadow .2s ease;
}
.tm-checkout-terms label{
    display:flex;align-items:flex-start;gap:10px;
    font-size:13px;color:#374151;cursor:pointer;
}
.tm-checkout-terms input{width:18px;height:18px;accent-color:#7C3AED;margin-top:1px;flex-shrink:0}
/* Estado "necesita atención": pulse sutil cuando el checkbox debe marcarse para PayPal */
.tm-checkout-terms.tm-terms--needs-attention{
    background:linear-gradient(135deg, rgba(245,158,11,0.08) 0%, rgba(245,158,11,0.04) 100%);
    box-shadow:0 0 0 2px rgba(245,158,11,0.25);
    animation:tmTermsPulse 1.6s ease-in-out 2;
}
@keyframes tmTermsPulse{
    0%,100%{box-shadow:0 0 0 2px rgba(245,158,11,0.25)}
    50%{box-shadow:0 0 0 4px rgba(245,158,11,0.40)}
}

/* Banner aviso "Acepta términos" — hidden por default, visible cuando JS
   detecta intento de submit/click PayPal sin terms aceptados. Universal
   para todos los gateways (AZUL, PayPal, Card). */
.tm-paypal-terms-warning{
    display:none;
    position:relative;
    align-items:flex-start;gap:12px;
    margin:14px 0 26px; /* bottom amplio para que la flecha respire */
    padding:14px 16px;
    background:linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    border:1px solid #fcd34d;
    border-radius:12px;
    box-shadow:0 1px 2px rgba(245,158,11,0.08);
    color:#78350f;
    font-size:13px;
    line-height:1.45;
    animation:tmTermsWarningIn .25s ease-out;
}

/* Flecha amber apuntando al checkbox debajo */
.tm-paypal-terms-warning__arrow{
    position:absolute;
    bottom:-22px;
    left:9px; /* center del círculo (9 + 30/2 = 24) cae sobre center del checkbox del .tm-checkout-terms (14 padding + 18/2 = 23) */
    width:30px;height:30px;
    border-radius:50%;
    background:#f59e0b;
    color:#fff;
    display:flex;align-items:center;justify-content:center;
    box-shadow:0 4px 10px rgba(245,158,11,0.35);
    animation:tmArrowBounce 1.1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events:none;
    z-index:2;
}
@keyframes tmArrowBounce{
    0%, 100% { transform:translateY(0); }
    50%      { transform:translateY(8px); }
}
.tm-checkout-form[data-show-terms-warning="true"] .tm-paypal-terms-warning{
    display:flex;
}
@keyframes tmTermsWarningIn{
    from{opacity:0;transform:translateY(-4px)}
    to{opacity:1;transform:translateY(0)}
}
.tm-paypal-terms-warning__icon{
    width:32px;height:32px;
    border-radius:50%;
    background:#f59e0b;
    color:#fff;
    display:flex;align-items:center;justify-content:center;
    flex-shrink:0;
}
.tm-paypal-terms-warning__content{
    display:flex;flex-direction:column;gap:2px;
}
.tm-paypal-terms-warning__content strong{
    font-size:13px;font-weight:700;color:#92400e;
}
.tm-paypal-terms-warning__content span{
    font-size:12px;color:#78350f;opacity:.92;
}

/* Wrapper de botones PayPal: cuando términos no aceptados, los botones se
   ven 100% normales pero un overlay invisible captura el click y muestra
   el banner de aviso. Sin opacity reducida — preserva la apariencia oficial
   de PayPal (yellow vivo) para no confundir al user. */
.tm-paypal-buttons-wrap{
    position:relative;
}
.tm-checkout-form[data-terms-accepted="false"] .tm-paypal-buttons-wrap > *{
    pointer-events:none; /* botones internos no responden a clicks */
}
.tm-checkout-form[data-terms-accepted="false"] .tm-paypal-buttons-wrap::after{
    content:"";
    position:absolute;inset:0;
    background:transparent;
    cursor:not-allowed;
    z-index:10;
    pointer-events:auto; /* el overlay sí captura click → JS muestra aviso */
}
/* Overlay de procesamiento — visible mientras se confirma el pago tras
   cerrar popup PayPal o submit de cualquier gateway. Evita que el user
   sienta que la página está colgada o quede dudando si el cobro pasó. */
.tm-processing-overlay{
    position:fixed;inset:0;
    background:rgba(15,23,42,0.78);
    backdrop-filter:blur(4px);
    -webkit-backdrop-filter:blur(4px);
    z-index:99999;
    display:flex;align-items:center;justify-content:center;
    animation:tmOverlayIn .25s ease-out;
}
@keyframes tmOverlayIn{
    from{opacity:0}
    to{opacity:1}
}
.tm-processing-overlay__card{
    background:#fff;
    border-radius:16px;
    padding:32px 40px;
    box-shadow:0 20px 60px rgba(0,0,0,0.3);
    text-align:center;
    max-width:90vw;
    width:380px;
    display:flex;flex-direction:column;align-items:center;gap:14px;
}
.tm-processing-overlay__spinner{
    width:48px;height:48px;
    border-radius:50%;
    border:4px solid rgba(124,58,237,0.15);
    border-top-color:#7C3AED;
    animation:tmSpinnerRotate .9s linear infinite;
}
@keyframes tmSpinnerRotate{
    to{transform:rotate(360deg)}
}
.tm-processing-overlay__title{
    font-size:18px;font-weight:700;color:#0f172a;
    margin:0;
}
.tm-processing-overlay__text{
    font-size:13px;color:#64748b;
    margin:0;line-height:1.5;
}
.tm-processing-overlay__fallback{
    margin-top:14px;padding-top:14px;
    border-top:1px solid #e5e7eb;
    width:100%;
    display:flex;flex-direction:column;align-items:center;gap:8px;
    animation:tmOverlayIn .3s ease-out;
}
.tm-processing-overlay__fallback-text{
    margin:0;font-size:12px;color:#94a3b8;
}
.tm-processing-overlay__close-btn{
    appearance:none;border:1px solid #e2e8f0;background:#fff;
    color:#475569;font-size:13px;font-weight:600;
    padding:8px 18px;border-radius:8px;cursor:pointer;
    transition:all .15s ease;
    font-family:inherit;
}
.tm-processing-overlay__close-btn:hover{
    background:#f8fafc;border-color:#cbd5e1;
}

/* Esconder lista <li> nativa del PPCP plugin con el mensaje feo */
.tm-checkout-gateway-fields ul li[class*="paypal"][class*="terms"],
.tm-checkout-form .ppcp-disabled-message,
.tm-checkout-form .ppcp-message-list,
.tm-checkout-form ul.ppcp-message-list{
    display:none !important;
}

/* Errors */
.tm-checkout-errors{
    margin:16px 0 0;
    padding:12px 16px;
    background:#fff5f5;
    border:1px solid #fecaca;
    border-radius:8px;
    color:#991b1b;
    font-size:13px;
}
.tm-checkout-errors[hidden]{display:none}

/* Summary sidebar */
.tm-checkout-summary{
    position:sticky;top:100px;
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:14px;
    padding:20px;
    box-shadow:0 1px 3px rgba(0,0,0,.04);
}
@media (max-width:899px){.tm-checkout-summary{position:static}}
.tm-checkout-summary-title{
    margin:0 0 16px;
    font-size:15px;
    font-weight:700;
    color:#1a1a2e;
    text-transform:uppercase;
    letter-spacing:.04em;
}

/* ── Hold countdown ──
   Card independiente (encima del resumen del pedido). Shadow y
   padding propios, no embebida. */
.tm-checkout-hold{
    --hold-c1: #7C3AED;
    --hold-c2: #9769ff;
    --hold-bg: #ffffff;
    --hold-border: rgba(124,58,237,.22);
    --hold-tint: rgba(124,58,237,.05);
    position:relative;
    padding:16px 18px 18px;
    background:var(--hold-bg);
    border:1px solid var(--hold-border);
    border-radius:14px;
    box-shadow:0 4px 16px rgba(124,58,237,.10), 0 1px 2px rgba(0,0,0,.04);
    margin-bottom:16px;
    overflow:hidden;
    transition:background .3s,border-color .3s,box-shadow .3s;
}
/* Banda decorativa superior, tinted con el color del estado */
.tm-checkout-hold::before{
    content:"";
    position:absolute;
    inset:0 0 auto 0;
    height:3px;
    background:linear-gradient(90deg,var(--hold-c2),var(--hold-c1));
    transition:background .3s;
}
.tm-checkout-hold-head{
    display:flex;
    align-items:center;
    gap:8px;
    color:var(--hold-c1);
    font-size:12px;
    font-weight:600;
    letter-spacing:.02em;
    text-transform:uppercase;
    margin-bottom:10px;
}
.tm-checkout-hold-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:22px;height:22px;
    border-radius:50%;
    background:var(--hold-c1);
    color:#fff;
    flex-shrink:0;
}
.tm-checkout-hold-icon svg{width:12px;height:12px}
.tm-checkout-hold-label{
    color:#1a1a2e;
    text-transform:none;
    letter-spacing:0;
    font-weight:600;
    font-size:13px;
}
.tm-checkout-hold-timer{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:10px;
    margin-bottom:10px;
}
.tm-checkout-hold-prefix{
    font-size:12px;
    color:#64748b;
    font-weight:500;
}
.tm-checkout-hold-clock{
    font-family:'SF Mono','Monaco','Menlo',ui-monospace,monospace;
    font-size:24px;
    font-weight:700;
    color:var(--hold-c1);
    letter-spacing:-.02em;
    font-variant-numeric:tabular-nums;
    line-height:1;
    transition:color .3s;
}
.tm-checkout-hold-bar{
    height:4px;
    background:rgba(124,58,237,.08);
    border-radius:999px;
    overflow:hidden;
    transition:background .3s;
}
.tm-checkout-hold-bar-fill{
    height:100%;
    width:100%;
    background:linear-gradient(90deg,var(--hold-c2),var(--hold-c1));
    border-radius:inherit;
    transform-origin:left;
    transition:transform 1s linear,background .3s;
}

/* Warning state (< 2 min): ambar. Pulso sutil sobre el reloj. */
.tm-checkout-hold.is-warning{
    --hold-c1:#d97706;
    --hold-c2:#f59e0b;
    --hold-bg:#fffaf0;
    --hold-border:rgba(217,119,6,.22);
}
.tm-checkout-hold.is-warning .tm-checkout-hold-bar{background:rgba(217,119,6,.12)}
.tm-checkout-hold.is-warning .tm-checkout-hold-clock{
    animation:tm-pulse-warn 1s ease-in-out infinite alternate;
}
@keyframes tm-pulse-warn{
    from{opacity:1}
    to{opacity:.55}
}

/* Expired state (00:00): rojo. */
.tm-checkout-hold.is-expired{
    --hold-c1:#dc2626;
    --hold-c2:#ef4444;
    --hold-bg:#fff5f5;
    --hold-border:rgba(220,38,38,.22);
}
.tm-checkout-hold.is-expired .tm-checkout-hold-bar{background:rgba(220,38,38,.14)}
.tm-checkout-hold.is-expired .tm-checkout-hold-clock{animation:none}

/* Expired overlay */
.tm-checkout-expired-overlay{
    position:fixed;inset:0;
    background:rgba(26,26,46,.75);
    backdrop-filter:blur(6px);
    z-index:1000;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    animation:tm-fade-in .2s ease;
}
@keyframes tm-fade-in{from{opacity:0}to{opacity:1}}
.tm-checkout-expired-modal{
    background:#fff;
    border-radius:16px;
    padding:32px;
    max-width:440px;
    width:100%;
    text-align:center;
    box-shadow:0 20px 50px rgba(0,0,0,.3);
}
.tm-checkout-expired-icon{
    width:60px;height:60px;
    margin:0 auto 18px;
    border-radius:50%;
    background:linear-gradient(135deg,#fecaca,#dc2626);
    display:flex;align-items:center;justify-content:center;
    font-size:28px;color:#fff;
}
.tm-checkout-expired-title{
    font-size:20px;font-weight:700;color:#1a1a2e;margin:0 0 8px;
}
.tm-checkout-expired-text{
    font-size:14px;color:#64748b;margin:0 0 18px;line-height:1.5;
}
.tm-checkout-expired-countdown{
    font-size:13px;color:#94a3b8;margin:0 0 18px;
    font-variant-numeric:tabular-nums;
}
.tm-checkout-expired-countdown strong{color:#7C3AED;font-weight:600}
.tm-checkout-items{list-style:none;margin:0 0 18px;padding:0 0 16px;border-bottom:1px solid #e2e8f0;display:flex;flex-direction:column;gap:12px}
.tm-checkout-item{display:grid;grid-template-columns:56px 1fr auto;gap:12px;align-items:flex-start}
.tm-checkout-item-img{
    width:56px;height:56px;border-radius:8px;
    object-fit:cover;background:#f1f5f9;
}
.tm-checkout-item-img--placeholder{background:linear-gradient(135deg,#e8e0f7,#f7f2ff)}
.tm-checkout-item-body{min-width:0}
.tm-checkout-item-name{
    font-size:13px;line-height:1.35;font-weight:600;color:#1a1a2e;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.tm-checkout-item-variation,
.tm-checkout-item-seat{
    font-size:12px;line-height:1.3;color:#7C3AED;margin-top:3px;
    font-weight:600;
}
.tm-checkout-item-variation p{margin:0;display:inline}
.tm-checkout-item-label{
    color:#94a3b8;
    font-weight:500;
    margin-right:2px;
}
.tm-checkout-item-price{font-size:13px;font-weight:600;color:#1a1a2e;white-space:nowrap}

.tm-checkout-totals{margin:0;display:flex;flex-direction:column;gap:8px}
.tm-checkout-totals-row{display:flex;justify-content:space-between;align-items:baseline}
.tm-checkout-totals-row dt{margin:0;color:#64748b;font-size:13px}
.tm-checkout-totals-row dd{margin:0;color:#1a1a2e;font-size:13px}
.tm-checkout-totals-row--discount dt,
.tm-checkout-totals-row--discount dd{color:#16a34a;font-weight:600}
.tm-checkout-totals-row--discount dt{display:flex;align-items:center;gap:6px}
.tm-checkout-discount-icon{font-size:14px;line-height:1}

/* Banner verde "¡Promo aplicada!" sobre los totales */
.tm-checkout-promo-banner{
    display:flex;align-items:center;gap:10px;
    margin:0 0 14px;padding:11px 14px;
    background:linear-gradient(135deg,#ecfdf5 0%,#d1fae5 100%);
    border:1px solid #6ee7b7;border-radius:10px;
    color:#065f46;font-size:13px;line-height:1.4;
    animation:tm-checkout-promo-in .32s ease-out;
}
.tm-checkout-promo-banner strong{font-weight:700;color:#064e3b}
.tm-checkout-promo-icon{font-size:16px;flex-shrink:0}
.tm-checkout-promo-text{flex:1}
@keyframes tm-checkout-promo-in{
    from{opacity:0;transform:translateY(-4px)}
    to{opacity:1;transform:translateY(0)}
}
.tm-checkout-totals-row--total{
    padding-top:10px;margin-top:4px;
    border-top:1px dashed #e2e8f0;
}
.tm-checkout-totals-row--total dt,
.tm-checkout-totals-row--total dd{
    font-size:16px;font-weight:700;color:#7C3AED;
}
.tm-checkout-cart-link{margin-top:14px;font-size:13px;text-align:center}

/* Empty state */
.tm-checkout-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;
    max-width:480px;margin:auto;text-align:center;
    background:#fff;border-radius:14px;padding:40px;
    border:1px solid #e2e8f0;
}
.tm-checkout-empty h1{font-size:22px;margin:0 0 8px}
.tm-checkout-empty p{color:#64748b;margin:0 0 24px}
.tm-checkout-empty-icon{
    width:60px;height:60px;
    margin:0 auto 20px;
    border-radius:50%;
    background:linear-gradient(135deg,#fecaca,#dc2626);
    color:#fff;
    display:flex;align-items:center;justify-content:center;
}
.tm-checkout-empty--expired{
    border-color:rgba(220,38,38,.2);
    box-shadow:0 4px 16px rgba(220,38,38,.08), 0 1px 2px rgba(0,0,0,.04);
    position:relative;overflow:hidden;
}
.tm-checkout-empty--expired::before{
    content:"";
    position:absolute;inset:0 0 auto 0;height:3px;
    background:linear-gradient(90deg,#ef4444,#dc2626);
}
.tm-checkout-empty--expired p strong{
    color:#dc2626;
    font-variant-numeric:tabular-nums;
    font-weight:700;
    margin:0 2px;
}

/* Footer */
.tm-checkout-footer{
    width:100%;
    max-width:1400px;margin:40px auto 24px;
    padding:0 clamp(16px,3vw,32px);
    display:flex;gap:20px;flex-wrap:wrap;
    font-size:12px;color:#94a3b8;
}
.tm-checkout-footer a{color:#64748b}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){
    *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}
}

/* ════════════════════════════════════════════════════════════
   Azul EMBEDDED overlay — iframe inline sin salir del sitio
   ════════════════════════════════════════════════════════════ */
body.tm-no-scroll{overflow:hidden}
.tm-azul-embed{
    position:fixed;inset:0;
    background:rgba(26,26,46,.75);
    backdrop-filter:blur(6px);
    -webkit-backdrop-filter:blur(6px);
    z-index:1000;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    animation:tm-fade-in .2s ease;
}
.tm-azul-embed-card{
    background:#fff;
    border-radius:16px;
    width:100%;
    max-width:560px;
    max-height:92vh;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    box-shadow:0 20px 50px rgba(0,0,0,.3);
    position:relative;
}
.tm-azul-embed-card::before{
    content:"";
    position:absolute;
    inset:0 0 auto 0;
    height:3px;
    background:linear-gradient(90deg,#9769ff,#7C3AED);
    z-index:2;
}
.tm-azul-embed-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:16px 18px;
    border-bottom:1px solid #e2e8f0;
    flex-shrink:0;
}
.tm-azul-embed-head-lead{
    display:flex;
    align-items:center;
    gap:12px;
}
.tm-azul-embed-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:36px;height:36px;
    border-radius:10px;
    background:linear-gradient(135deg,#e8e0f7,#f7f2ff);
    color:#7C3AED;
    flex-shrink:0;
}
.tm-azul-embed-title{
    font-size:15px;font-weight:700;color:#1a1a2e;line-height:1.2;
}
.tm-azul-embed-sub{
    font-size:12px;color:#64748b;margin-top:2px;line-height:1.2;
}
.tm-azul-embed-close{
    appearance:none;
    border:none;
    background:transparent;
    width:32px;height:32px;
    border-radius:8px;
    font-size:22px;line-height:1;
    color:#64748b;
    cursor:pointer;
    transition:background .15s,color .15s;
}
.tm-azul-embed-close:hover{background:#f1f5f9;color:#1a1a2e}

/* Variant compacto (botón "Continuar con AZUL" en vez de iframe) */
.tm-azul-embed-card--compact{
    max-width:440px;
    max-height:none;
}
.tm-azul-embed-body--compact{
    min-height:0!important;
    background:#fff!important;
    padding:24px 28px 28px;
    text-align:center;
}
.tm-azul-embed-intro{
    font-size:14px;
    color:#475569;
    margin:0 0 22px;
    line-height:1.5;
}
.tm-azul-embed-intro strong{color:#1a1a2e}
.tm-azul-embed-pay-btn{
    width:100%!important;
    justify-content:center!important;
    padding:14px 24px!important;
    font-size:15px!important;
    margin-bottom:10px!important;
}
.tm-azul-embed-cancel{
    appearance:none;
    background:transparent;
    border:none;
    padding:8px 12px;
    margin-top:4px;
    font-family:inherit;
    font-size:13px;
    color:#64748b;
    cursor:pointer;
    border-radius:6px;
    transition:color .15s,background .15s;
}
.tm-azul-embed-cancel:hover{color:#1a1a2e;background:#f1f5f9}
.tm-azul-embed-loader-inline{
    display:flex;
    justify-content:center;
    padding:10px 0 18px;
}
.tm-azul-embed-loader-inline .tm-azul-embed-spinner{margin:0}

/* Timer del overlay Azul (force-cancel antes de que WC cancele) */
.tm-azul-embed-timer{
    --tc: #7C3AED;
    --tc2:#9769ff;
    --tbg:rgba(124,58,237,.08);
    padding:12px 14px;
    border:1px solid rgba(124,58,237,.22);
    background:#fbf9ff;
    border-radius:10px;
    margin:14px 0 12px;
    display:grid;
    grid-template-columns:1fr auto;
    align-items:baseline;
    gap:8px 12px;
    transition:background .3s,border-color .3s;
}
.tm-azul-embed-timer-label{
    font-size:12px;
    color:#64748b;
    font-weight:500;
    grid-column:1;
}
.tm-azul-embed-timer-clock{
    font-family:'SF Mono','Monaco','Menlo',ui-monospace,monospace;
    font-size:20px;
    font-weight:700;
    color:var(--tc);
    letter-spacing:-.02em;
    font-variant-numeric:tabular-nums;
    grid-column:2;
    line-height:1;
    transition:color .3s;
}
.tm-azul-embed-timer-bar{
    grid-column:1 / -1;
    height:3px;
    background:var(--tbg);
    border-radius:999px;
    overflow:hidden;
    margin-top:4px;
}
.tm-azul-embed-timer-bar-fill{
    height:100%;
    background:linear-gradient(90deg,var(--tc2),var(--tc));
    transform-origin:left;
    transition:transform 1s linear;
}
.tm-azul-embed-timer.is-warning{
    --tc:#d97706;
    --tc2:#f59e0b;
    --tbg:rgba(217,119,6,.14);
    background:#fffaf0;
    border-color:rgba(217,119,6,.28);
}
.tm-azul-embed-timer.is-warning .tm-azul-embed-timer-clock{
    animation:tm-pulse-warn 1s ease-in-out infinite alternate;
}
.tm-azul-embed-timer.is-expired{
    --tc:#dc2626;
    --tc2:#ef4444;
    --tbg:rgba(220,38,38,.16);
    background:#fff5f5;
    border-color:rgba(220,38,38,.28);
}

/* Result expired */
.tm-azul-embed-result--expired .tm-azul-embed-result-icon{
    background:linear-gradient(135deg,#fca5a5,#dc2626);
    font-size:28px;
}

.tm-azul-embed-body{
    position:relative;
    flex:1;
    min-height:520px;
    background:#f8fafc;
}
.tm-azul-embed-loader{
    position:absolute;inset:0;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:14px;
    color:#64748b;
    font-size:14px;
    pointer-events:none;
    z-index:1;
}
.tm-azul-embed-spinner{
    width:40px;height:40px;
    border:3px solid rgba(124,58,237,.15);
    border-top-color:#7C3AED;
    border-radius:50%;
    animation:tm-spin .8s linear infinite;
}
.tm-azul-embed-iframe{
    position:relative;
    width:100%;
    height:100%;
    min-height:520px;
    border:0;
    display:block;
    z-index:0;
}

.tm-azul-embed-result{
    padding:40px 32px;
    text-align:center;
}
.tm-azul-embed-result-icon{
    width:64px;height:64px;
    margin:0 auto 18px;
    border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    font-size:32px;font-weight:700;color:#fff;
}
.tm-azul-embed-result--completed .tm-azul-embed-result-icon{
    background:linear-gradient(135deg,#10b981,#059669);
}
.tm-azul-embed-result--cancelled .tm-azul-embed-result-icon{
    background:linear-gradient(135deg,#94a3b8,#64748b);
}
.tm-azul-embed-result--failed .tm-azul-embed-result-icon{
    background:linear-gradient(135deg,#ef4444,#dc2626);
}
.tm-azul-embed-result-title{font-size:20px;font-weight:700;color:#1a1a2e;margin-bottom:6px}
.tm-azul-embed-result-sub{font-size:14px;color:#64748b}

@media (max-width:640px){
    .tm-azul-embed{padding:0}
    .tm-azul-embed-card{
        max-width:none;max-height:100vh;
        height:100vh;border-radius:0;
    }
}

/* ════════════════════════════════════════════════════════════
   Azul overlay — integrado al look del checkout (plugin original)
   ════════════════════════════════════════════════════════════ */

/* Overlay backdrop con blur (igual que el modal de expiracion). */
#azul-popup-overlay.azul-popup-overlay{
    position:fixed;inset:0;
    background:rgba(26,26,46,.75);
    backdrop-filter:blur(6px);
    -webkit-backdrop-filter:blur(6px);
    z-index:1000;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    animation:tm-fade-in .2s ease;
}

/* Card principal, mismos tokens del checkout. */
#azul-popup-overlay .azul-popup-overlay-card{
    background:#fff;
    border-radius:16px;
    padding:36px 32px 32px;
    max-width:440px;
    width:100%;
    text-align:center;
    box-shadow:0 20px 50px rgba(0,0,0,.3);
    position:relative;
    overflow:hidden;
}
/* Banda gradient morado arriba — misma del hold-countdown. */
#azul-popup-overlay .azul-popup-overlay-card::before{
    content:"";
    position:absolute;
    inset:0 0 auto 0;
    height:4px;
    background:linear-gradient(90deg,#9769ff,#7C3AED);
}

/* Iconos grandes arriba (el lock 🔒 o spinner). Rediseno el lock como
   circulo con icon. */
#azul-popup-overlay .azul-popup-overlay-card > div[style*="font-size:48px"]{
    font-size:0!important;
    width:64px!important;
    height:64px!important;
    margin:4px auto 20px!important;
    border-radius:50%!important;
    background:linear-gradient(135deg,#e8e0f7,#f7f2ff)!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    position:relative;
}
#azul-popup-overlay .azul-popup-overlay-card > div[style*="font-size:48px"]::after{
    content:"🔒";
    font-size:28px!important;
    line-height:1;
}

/* Spinner moradito que reemplaza el azul default. */
#azul-popup-overlay .azul-popup-spinner{
    width:48px;height:48px;
    border:3px solid rgba(124,58,237,.15);
    border-top-color:#7C3AED;
    margin:4px auto 20px;
}

/* Textos */
#azul-popup-overlay .azul-popup-message{
    font-size:20px;
    font-weight:700;
    color:#1a1a2e;
    margin:0 0 8px;
    letter-spacing:-.01em;
}
#azul-popup-overlay .azul-popup-submessage{
    font-size:14px;
    color:#64748b;
    margin:0 0 24px;
    line-height:1.5;
}

/* Boton principal "PAGAR CON AZUL": igual que los CTAs del checkout. */
#azul-popup-overlay #azul-pay-now-btn{
    appearance:none!important;
    display:block!important;
    width:100%!important;
    padding:14px 24px!important;
    font-family:inherit!important;
    font-size:15px!important;
    font-weight:600!important;
    color:#fff!important;
    background:linear-gradient(135deg,#9769ff,#7C3AED)!important;
    border:none!important;
    border-radius:10px!important;
    cursor:pointer!important;
    transition:box-shadow .15s,transform .1s!important;
    margin-bottom:14px!important;
    box-shadow:0 2px 8px rgba(124,58,237,.3)!important;
    letter-spacing:.02em;
    text-transform:none!important;
}
#azul-popup-overlay #azul-pay-now-btn:hover{
    box-shadow:0 4px 14px rgba(124,58,237,.4)!important;
    background:linear-gradient(135deg,#9769ff,#7C3AED)!important;
    transform:translateY(-1px);
}
#azul-popup-overlay #azul-pay-now-btn:active{
    transform:translateY(0);
}

/* Boton cancelar: link-like gris, no outline azul. */
#azul-popup-overlay .azul-popup-close-btn{
    background:transparent!important;
    border:none!important;
    color:#64748b!important;
    cursor:pointer;
    font-family:inherit;
    font-size:13px;
    font-weight:500;
    padding:8px 12px!important;
    border-radius:6px;
    transition:color .15s,background .15s;
    line-height:1!important;
    display:inline-block!important;
}
#azul-popup-overlay .azul-popup-close-btn:hover{
    color:#1a1a2e!important;
    background:#f1f5f9!important;
}
#azul-popup-overlay .azul-popup-close-btn:focus-visible{
    outline:2px solid #7C3AED;outline-offset:2px;
}

/* M2: center empty state vertically in viewport */
.tm-checkout-main:has(.tm-checkout-empty) {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Prevenir auto-zoom de iOS Safari al focus en inputs.
   /pago/ no carga standalone-mobile-override.css, fix incluido aquí. */
@media (max-width: 767px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="submit"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Cupones — toggle expandible dentro del card del Resumen del pedido */
.tm-checkout-coupon {
    margin: 0 0 16px;
    padding: 0 0 16px;
    border-bottom: 1px dashed #E2E8F0;
}
.tm-coupon-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 4px 0;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s;
}
.tm-coupon-toggle:hover { color: #7C3AED; }
.tm-coupon-toggle-label { flex: 1; min-width: 0; }
.tm-coupon-toggle-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.tm-coupon-toggle[aria-expanded="true"] .tm-coupon-toggle-chevron { transform: rotate(180deg); }
.tm-coupon-toggle[aria-expanded="true"] { color: #1a1a2e; }

.tm-coupon-panel { margin-top: 12px; }
.tm-coupon-panel[hidden] { display: none; }

.tm-coupon-row { display: flex; gap: 8px; }
.tm-coupon-input {
    flex: 1;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tm-coupon-input:focus {
    outline: none;
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.tm-coupon-btn {
    flex-shrink: 0;
    padding: 11px 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #9769ff, #7C3AED);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
}
.tm-coupon-btn:hover:not(:disabled) { box-shadow: 0 4px 14px rgba(124,58,237,0.35); }
.tm-coupon-btn:active:not(:disabled) { transform: scale(0.97); }
.tm-coupon-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.tm-coupon-applied { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-coupon-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px 6px 10px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #065F46;
    letter-spacing: 0.5px;
}
.tm-coupon-chip-code { text-transform: uppercase; }
.tm-coupon-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(6,95,70,0.15);
    color: #065F46;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
}
.tm-coupon-remove:hover { background: rgba(6,95,70,0.3); }

.tm-coupon-msg {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
}
.tm-coupon-msg--success { background: #ECFDF5; color: #065F46; }
.tm-coupon-msg--error   { background: #FEF2F2; color: #991B1B; }
.tm-coupon-msg--info    { background: #EFF6FF; color: #1E40AF; }

@media (max-width: 480px) {
    .tm-coupon-btn { padding: 11px 14px; }
}

/* WC notices (errors / messages / info) integrados al theme TICKETMAX.
   Sin esto, los notices se ven con styling de WC default (ul con bullets,
   sin radius, sin colores theme). */
.woocommerce-notices-wrapper { margin: 0 0 16px; }
.woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-error,
.woocommerce-message,
.woocommerce-info,
ul.woocommerce-error {
    list-style: none !important;
    padding: 14px 16px !important;
    margin: 0 0 12px !important;
    border-radius: 12px !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 14px;
    line-height: 1.5;
}
.woocommerce-error,
ul.woocommerce-error {
    background: #FEF2F2 !important;
    color: #991B1B !important;
}
.woocommerce-message {
    background: #ECFDF5 !important;
    color: #065F46 !important;
}
.woocommerce-info {
    background: #EFF6FF !important;
    color: #1E40AF !important;
}
.woocommerce-error li,
.woocommerce-message li,
.woocommerce-info li {
    padding: 4px 0 !important;
    margin: 0 !important;
    list-style: none !important;
}
.woocommerce-error li::before,
.woocommerce-message li::before,
.woocommerce-info li::before { content: none !important; }
.woocommerce-error a,
.woocommerce-message a,
.woocommerce-info a { color: inherit; text-decoration: underline; font-weight: 600; }
.woocommerce-error .button,
.woocommerce-message .button { display: none !important; }
