/* Frontend Payment Styles */

.payment-methods {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.payment-methods h3 {
    margin-top: 0;
    color: #333;
}

.payment-method {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-method:hover {
    border-color: #0073aa;
}

.payment-method.selected {
    border-color: #0073aa;
    background: #f0f8ff;
}

.payment-method input[type="radio"] {
    margin-right: 10px;
}

.payment-method label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.payment-method .payment-logo {
    width: 60px;
    height: auto;
    margin-left: auto;
}

.payment-method .payment-description {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    margin-left: 25px;
}

.payment-gateway-container {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.payment-gateway-container.active {
    display: block;
}

#paypal-button-container {
    margin-top: 15px;
}

.tb-payment-notification {
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.tb-payment-notification.tb-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.tb-payment-notification.tb-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.tb-payment-notification.tb-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.tb-payment-notification p {
    margin: 0;
}

.payment-security-info {
    margin-top: 15px;
    padding: 10px;
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 4px;
    font-size: 13px;
    color: #2d5a2d;
}

.payment-security-info::before {
    content: "🔒 ";
}

.payment-total {
    background: #f8f9fa;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin: 20px 0;
}

.payment-total h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.payment-total .total-amount {
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
}

.payment-loading {
    text-align: center;
    padding: 20px;
}

.payment-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   MODAL DEL SISTEMA DE PAGOS — TB Modal
   Sin conflictos con booking-modal de script.js
   ============================================ */

.tb-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(27, 94, 32, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow-y: auto;
    padding: 24px 16px;
    box-sizing: border-box;
}

.tb-modal-content {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 24px 64px rgba(27, 94, 32, 0.25);
    overflow: hidden;
    animation: tbSlideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes tbSlideUp {
    from { opacity: 0; transform: translateY(32px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Header del modal */
.tb-modal-header {
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
    padding: 28px 24px 22px;
    text-align: center;
    position: relative;
}

.tb-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.35em;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.tb-modal-header p {
    margin: 6px 0 0;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
}

/* Botón cerrar */
.tb-modal-close {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
    border: none;
}

.tb-modal-close:hover {
    background: rgba(255,255,255,0.35);
}

/* Cuerpo del modal */
.tb-modal-body {
    padding: 24px;
}

/* Resumen de reserva */
.tb-booking-summary {
    background: #f8fdf8;
    border: 1.5px solid #c8e6c9;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.tb-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e8f5e8;
    font-size: 15px;
}

.tb-summary-row:last-child {
    border-bottom: none;
}

.tb-summary-label {
    color: #555;
    font-weight: 500;
}

.tb-summary-value {
    color: #1b5e20;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
}

/* Total */
.tb-total-summary {
    background: linear-gradient(135deg, #e8f5e8, #f1f8e9);
    border: 2px solid rgba(76,175,80,0.25);
    border-radius: 14px;
    padding: 16px 20px;
    text-align: center;
    margin-bottom: 20px;
}

.tb-total-summary h4 {
    margin: 0;
    font-size: 1.6em;
    color: #2e7d32;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tb-total-summary span {
    display: block;
    font-size: 12px;
    color: #66bb6a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    font-weight: 600;
}

/* Métodos de pago */
.tb-payment-methods {
    margin-bottom: 8px;
}

.tb-payment-methods h4 {
    margin: 0 0 12px;
    color: #2e7d32;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tb-payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tb-payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.tb-payment-option:hover {
    border-color: #4caf50;
    background: #f8fdf8;
}

.tb-payment-option input[type="radio"] {
    accent-color: #4caf50;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.tb-payment-option:has(input:checked) {
    border-color: #4caf50;
    background: #f1f8f1;
}

/* Acciones del modal */
.tb-modal-actions {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
}

.tb-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.3px;
    touch-action: manipulation;
    min-height: 48px;
}

.tb-btn:active {
    transform: scale(0.97);
}

.tb-btn-primary {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: #fff;
    box-shadow: 0 4px 14px rgba(76,175,80,0.35);
}

.tb-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(76,175,80,0.45);
    transform: translateY(-1px);
}

.tb-btn-secondary {
    background: #f5f5f5;
    color: #555;
    border: 1.5px solid #ddd;
}

.tb-btn-secondary:hover {
    background: #ebebeb;
    color: #333;
}

/* Modal PayPal */
#tb-paypal-payment-modal .tb-modal-header {
    background: linear-gradient(135deg, #003087 0%, #009cde 100%);
}

#tb-paypal-payment-modal .tb-modal-body {
    padding: 24px;
}

#temp-paypal-button-container {
    min-height: 48px;
}

#temp-paypal-button-container iframe {
    border-radius: 8px;
    overflow: hidden;
}

#tb-paypal-payment-modal .tb-modal-actions {
    padding: 0 24px 24px;
}

#tb-paypal-cancel {
    width: 100%;
}

/* On-site badge */
.tb-onsite-message {
    background: #f0f9ff;
    border: 1.5px solid #bae6fd;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 14px;
    font-size: 13px;
    color: #0369a1;
    line-height: 1.5;
}

.tb-onsite-message p {
    margin: 4px 0;
}

/* Responsive */
@media (max-width: 480px) {
    .tb-modal {
        padding: 12px 10px;
    }

    .tb-modal-content {
        border-radius: 16px;
    }

    .tb-modal-body {
        padding: 16px;
    }

    .tb-modal-actions {
        flex-direction: column;
        padding: 0 16px 20px;
    }

    .tb-total-summary h4 {
        font-size: 1.4em;
    }
}

/* ============================================
   SUCCESS MODAL — Pago Exitoso
   ============================================ */

.tb-success-modal {
    z-index: 10001;
    background: rgba(15, 60, 20, 0.65);
}

.tb-success-content {
    max-width: 480px;
    overflow: visible;
}

/* Hero header con gradiente animado */
.tb-success-hero {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 40%, #43a047 100%);
    padding: 36px 24px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tb-success-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.07) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 40%);
    pointer-events: none;
}

/* Partículas decorativas */
.tb-success-hero::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #a5d6a7, #81c784, #a5d6a7, transparent);
    animation: tbShimmer 2.5s ease-in-out infinite;
}

@keyframes tbShimmer {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 1; }
}

/* Ícono de check animado */
.tb-check-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    position: relative;
    z-index: 1;
}

.tb-check-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2.5px solid rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tbCheckPop 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.1s both;
}

@keyframes tbCheckPop {
    from { transform: scale(0) rotate(-20deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

.tb-check-circle svg {
    animation: tbCheckDraw 0.4s ease 0.5s both;
}

@keyframes tbCheckDraw {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}

/* Anillos de pulso */
.tb-check-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    animation: tbRingPulse 2s ease-out 0.6s infinite;
}

.tb-check-ring-2 {
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.1);
    animation: tbRingPulse 2s ease-out 0.9s infinite;
}

@keyframes tbRingPulse {
    0%   { transform: scale(0.85); opacity: 0.8; }
    100% { transform: scale(1.3);  opacity: 0; }
}

.tb-success-hero h2 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 1.55em;
    font-weight: 800;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
    animation: tbFadeUp 0.4s ease 0.3s both;
}

.tb-success-hero p {
    margin: 0;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    position: relative;
    z-index: 1;
    animation: tbFadeUp 0.4s ease 0.45s both;
}

@keyframes tbFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Número de reserva */
.tb-booking-ref-card {
    margin: 20px 20px 0;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border: 1.5px solid #a5d6a7;
    border-radius: 14px;
    padding: 14px 18px;
    text-align: center;
    animation: tbFadeUp 0.4s ease 0.55s both;
}

.tb-ref-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #66bb6a;
    margin-bottom: 4px;
}

.tb-ref-number {
    font-size: 1.1em;
    font-weight: 800;
    color: #1b5e20;
    letter-spacing: 0.5px;
    word-break: break-all;
}

/* Tabla de detalles */
.tb-success-body {
    padding: 16px 20px 8px;
    animation: tbFadeUp 0.4s ease 0.65s both;
}

.tb-details-table {
    width: 100%;
    border-collapse: collapse;
}

.tb-details-table tr {
    border-bottom: 1px solid #f0f4f0;
}

.tb-details-table tr:last-child {
    border-bottom: none;
}

.tb-details-table td {
    padding: 10px 4px;
    font-size: 14px;
    vertical-align: middle;
}

.tb-details-table td:first-child {
    color: #757575;
    font-weight: 500;
    width: 42%;
}

.tb-details-table td:last-child {
    color: #1a1a1a;
    font-weight: 600;
    text-align: right;
}

.tb-total-row-final td {
    padding-top: 14px;
    font-size: 15px;
    font-weight: 700;
    border-top: 2px solid #e8f5e9;
}

.tb-total-row-final td:first-child {
    color: #2e7d32;
}

.tb-total-amount {
    color: #2e7d32 !important;
    font-size: 1.3em !important;
}

/* Nota informativa */
.tb-success-note {
    margin: 12px 20px 0;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: #78350f;
    line-height: 1.55;
    animation: tbFadeUp 0.4s ease 0.75s both;
}

.tb-success-note strong {
    color: #92400e;
}

/* Botón Entendido */
.tb-success-footer {
    padding: 16px 20px 20px;
    animation: tbFadeUp 0.4s ease 0.85s both;
}

.tb-btn-success {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 20px rgba(46,125,50,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    touch-action: manipulation;
    min-height: 52px;
}

.tb-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(46,125,50,0.45);
}

.tb-btn-success:active {
    transform: scale(0.97);
}

/* Confetti dots — decoración */
.tb-confetti {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    border-radius: 20px;
}

.tb-confetti-dot {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: tbConfettiFloat 3s ease-in-out infinite;
}

@keyframes tbConfettiFloat {
    0%   { opacity: 0;   transform: translateY(0)   rotate(0deg); }
    15%  { opacity: 0.8; }
    85%  { opacity: 0.6; }
    100% { opacity: 0;   transform: translateY(-180px) rotate(360deg); }
}

/* Mobile */
@media (max-width: 480px) {
    .tb-success-hero {
        padding: 28px 18px 22px;
    }

    .tb-check-wrap {
        width: 60px;
        height: 60px;
    }

    .tb-check-circle {
        width: 60px;
        height: 60px;
    }

    .tb-success-hero h2 {
        font-size: 1.3em;
    }

    .tb-booking-ref-card {
        margin: 16px 14px 0;
        padding: 12px 14px;
    }

    .tb-ref-number {
        font-size: 0.95em;
    }

    .tb-success-body {
        padding: 12px 14px 6px;
    }

    .tb-details-table td {
        font-size: 13px;
        padding: 9px 2px;
    }

    .tb-total-amount {
        font-size: 1.15em !important;
    }

    .tb-success-note {
        margin: 10px 14px 0;
        font-size: 12px;
        padding: 10px 12px;
    }

    .tb-success-footer {
        padding: 14px 14px 18px;
    }

    .tb-btn-success {
        font-size: 15px;
        min-height: 50px;
    }
}

/* PayPal Modal Centering - Mobile Fix */
.paypal-checkout-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

.paypal-checkout-modal {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 auto !important;
    max-width: 400px !important;
    width: 100% !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

/* PayPal Button Container */
#paypal-button-container {
    margin: 15px 0 !important;
    text-align: center !important;
}

/* PayPal SDK Modal Override */
.paypal-checkout-sandbox .paypal-checkout-modal,
.paypal-checkout-production .paypal-checkout-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    z-index: 999999 !important;
}

@media (max-width: 768px) {
    .paypal-checkout-overlay {
        padding: 10px !important;
    }
    
    .paypal-checkout-modal {
        max-width: 95% !important;
        max-height: 90vh !important;
        border-radius: 8px !important;
    }
    
    /* PayPal SDK Mobile Override */
    .paypal-checkout-sandbox .paypal-checkout-modal,
    .paypal-checkout-production .paypal-checkout-modal {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 95% !important;
        max-width: 400px !important;
        max-height: 85vh !important;
    }
}

@media (max-width: 480px) {
    .paypal-checkout-modal {
        max-width: 98% !important;
        max-height: 95vh !important;
        border-radius: 6px !important;
    }
    
    .paypal-checkout-sandbox .paypal-checkout-modal,
    .paypal-checkout-production .paypal-checkout-modal {
        width: 98% !important;
        max-width: 350px !important;
        max-height: 90vh !important;
    }
}

/* ============================================
   ON-SITE SUCCESS MODAL — variante azul
   ============================================ */

.tb-success-modal.tb-onsite .tb-success-hero {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 40%, #1976d2 100%);
}

.tb-success-modal.tb-onsite .tb-booking-ref-card {
    background: linear-gradient(135deg, #e3f2fd, #e8eaf6);
    border-color: #90caf9;
}

.tb-success-modal.tb-onsite .tb-ref-label {
    color: #1976d2;
}

.tb-success-modal.tb-onsite .tb-ref-number {
    color: #0d47a1;
}

.tb-success-modal.tb-onsite .tb-total-row-final td:first-child {
    color: #1565c0;
}

.tb-success-modal.tb-onsite .tb-total-amount {
    color: #1565c0 !important;
}

.tb-success-modal.tb-onsite .tb-btn-success {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.35);
}

.tb-success-modal.tb-onsite .tb-btn-success:hover {
    box-shadow: 0 10px 28px rgba(21, 101, 192, 0.45);
}

.tb-success-modal.tb-onsite .tb-success-note {
    background: #e3f2fd;
    border-color: #90caf9;
    border-left-color: #1976d2;
    color: #0d47a1;
}

.tb-success-modal.tb-onsite .tb-success-note strong {
    color: #0d47a1;
}

/* ============================================
   TOAST NOTIFICATIONS — posición fija
   ============================================ */

.tb-payment-notification.tb-success {
    background: #d4edda;
    border: 1.5px solid #28a745;
    color: #155724;
}

.tb-payment-notification.tb-error {
    background: #f8d7da;
    border: 1.5px solid #dc3545;
    color: #721c24;
}

.tb-payment-notification.tb-info {
    background: #d1ecf1;
    border: 1.5px solid #17a2b8;
    color: #0c5460;
}
