/**
 * Checkout Modal Styles
 * Premium Glassmorphic Design
 */

/* ========================================
   CHECKOUT MODAL
   ======================================== */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal, 2000);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.checkout-modal.show {
    opacity: 1;
    visibility: visible;
}

.checkout-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(8px);
}

.checkout-container {
    position: relative;
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.95), rgba(13, 17, 23, 0.98));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 24px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 100px rgba(14, 165, 233, 0.15);
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.checkout-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.checkout-close:hover {
    background: rgba(239, 68, 68, 0.8);
    transform: rotate(90deg);
}

.checkout-header {
    padding: 3rem 2.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.checkout-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-align: center;
}

.checkout-header p {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin: 0;
}

.checkout-body {
    padding: 2.5rem;
}

/* ========================================
   PAYMENT METHODS
   ======================================== */
.payment-methods h3 {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.payment-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.payment-method {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.payment-method:hover {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.4);
    transform: translateY(-2px);
}

.payment-method.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: #0ea5e9;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

.payment-method.highlight {
    position: relative;
    overflow: hidden;
}

.payment-method.highlight::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(103, 232, 249, 0.1),
            transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.payment-icon {
    font-size: 2rem;
    line-height: 1;
}

.payment-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.payment-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

.payment-fee {
    font-size: 0.8rem;
    color: rgba(255, 165, 0, 0.9);
    font-weight: 500;
}

.payment-fee.green {
    color: #10b981;
}

/* ========================================
   PRICE SUMMARY
   ======================================== */
.price-summary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.price-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.price-row.fee-row {
    color: rgba(255, 165, 0, 0.9);
}

.price-row.total {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    padding-top: 1rem;
}

.price-row.total span:last-child {
    color: #0ea5e9;
    font-size: 1.5rem;
}

/* ========================================
   CHECKOUT ALERT
   ======================================== */
.checkout-alert {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-left: 4px solid #0ea5e9;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.alert-icon {
    font-size: 2rem;
    line-height: 1;
}

.alert-icon.success {
    color: #10b981;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    display: block;
    color: #ffffff;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.alert-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
}

.alert-content ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.alert-content li {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.alert-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #0ea5e9;
    font-weight: bold;
}

/* ========================================
   ACTION BUTTON
   ======================================== */
.btn-checkout-action {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    border: none;
    border-radius: 50px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-checkout-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.6);
}

.btn-checkout-action:active {
    transform: translateY(-1px);
}

/* ========================================
   INVOICE DIALOG SYSTEM
   ======================================== */
.invoice-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(10px);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.invoice-dialog {
    position: relative;
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.98), rgba(13, 17, 23, 0.99));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 100px rgba(14, 165, 233, 0.2);
    animation: dialogSlideIn 0.4s ease;
}

.invoice-dialog.invoice-form-container {
    max-width: 600px;
}

.invoice-dialog.invoice-confirmation {
    max-width: 400px;
    text-align: center;
    padding: 3rem 2rem;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.invoice-dialog-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.invoice-dialog-close:hover {
    background: rgba(239, 68, 68, 0.8);
    transform: rotate(90deg);
}

.invoice-dialog-header {
    padding: 2.5rem 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.invoice-dialog-header h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.75rem 0;
}

.invoice-dialog-header p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.invoice-form-subtitle {
    font-size: 0.9rem !important;
    color: rgba(255, 255, 255, 0.6) !important;
    margin-top: 0.5rem !important;
}

/* Invoice Options */
.invoice-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 2rem;
}

.invoice-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.invoice-option:hover {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3);
}

.invoice-option-icon {
    font-size: 3rem;
    line-height: 1;
}

.invoice-option-content h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
}

.invoice-price {
    font-size: 0.95rem;
    color: rgba(255, 165, 0, 0.9);
    margin: 0.25rem 0;
}

.invoice-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0ea5e9;
    margin: 0.5rem 0 0 0;
}

/* Invoice Form */
.invoice-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: #1a2332;
    color: #ffffff;
}

.btn-submit-invoice {
    width: 100%;
    padding: 1.125rem;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    border: none;
    border-radius: 50px;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}

.btn-submit-invoice:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.6);
}

.btn-submit-invoice:active {
    transform: translateY(0);
}

/* Invoice Confirmation */
.confirmation-icon {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 1.5rem;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.invoice-confirmation h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 1rem 0;
}

.invoice-confirmation p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0.5rem 0;
}

.confirmation-subtitle {
    font-size: 0.9rem !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-style: italic;
    margin-top: 1.5rem !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .checkout-container {
        width: 95%;
        border-radius: 20px;
    }

    .checkout-header {
        padding: 2.5rem 1.5rem 1rem;
    }

    .checkout-body {
        padding: 1.5rem;
    }


    /* Payment grid mantiene 4 columnas en móvil */
    .payment-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    .payment-method {
        padding: 0.75rem 0.5rem;
    }

    .payment-icon {
        font-size: 1.5rem;
    }

    .payment-name {
        font-size: 0.8rem;
    }

    .payment-fee {
        font-size: 0.7rem;
    }


    .price-row.total {
        font-size: 1.2rem;
    }

    .price-row.total span:last-child {
        font-size: 1.3rem;
    }

    /* Invoice Dialog Responsive */
    .invoice-dialog {
        width: 95%;
        border-radius: 16px;
    }

    .invoice-options {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .invoice-option {
        padding: 1.5rem 1rem;
    }

    .invoice-form {
        padding: 1.5rem;
    }

    .invoice-dialog-header {
        padding: 2rem 1.5rem 1rem;
    }

    .invoice-confirmation {
        padding: 2.5rem 1.5rem;
    }

    .confirmation-icon {
        font-size: 4rem;
    }
}

/* Scrollbar personalizado para el modal */
.checkout-container::-webkit-scrollbar,
.invoice-dialog::-webkit-scrollbar {
    width: 8px;
}

.checkout-container::-webkit-scrollbar-track,
.invoice-dialog::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.checkout-container::-webkit-scrollbar-thumb,
.invoice-dialog::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.5);
    border-radius: 10px;
}

.checkout-container::-webkit-scrollbar-thumb:hover,
.invoice-dialog::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.7);
}