/* Reset e Variáveis */
:root {
    --primary-color: #0f172a;
    --secondary-color: #0059ff;
    --success-color: #0059ff;
    --warning-color: #facc15;
    --bg-color: #f1f5ff;
    --text-color: #0f172a;
    --border-color: #d6e4ff;
    --shadow: 0 18px 50px -32px rgba(15, 23, 42, 0.45);
    --white: #ffffff;
    --gray-light: #f8faff;
    --gray-medium: #64748b;
    --blue: #0059ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(180deg, #0b1228 0%, #101d3f 45%, #0f172a 100%);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 80px; /* Espaço para o botão fixo */
}

/* Logo Ticketmaster */
.checkout-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 34px 20px;
    background: linear-gradient(96deg, rgba(0, 89, 255, 0.9) 0%, rgba(2, 70, 196, 0.94) 74%);
    box-shadow: var(--shadow);
}

.logo-img {
    max-height: 80px;
    width: auto;
}

/* Banner Principal */
.main-banner {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 420px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(4, 12, 34, 0.94), rgba(2, 10, 28, 0.75));
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-banner img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
}

.share-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 12px 30px -18px rgba(15, 23, 42, 0.55);
    transition: all 0.3s;
}

.share-button:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 20px 60px -28px rgba(15, 23, 42, 0.65);
}

/* Informações do Evento */
.event-info {
    padding: 28px 24px;
    background: var(--white);
    border-radius: 24px;
    margin: -60px auto 24px;
    width: min(980px, 92%);
    box-shadow: var(--shadow);
}

.event-info h1 {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 14px;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.event-description {
    margin-bottom: 24px;
    line-height: 1.6;
}

.event-description p {
    margin-bottom: 12px;
    color: #1e293b;
}

.event-description strong {
    color: var(--secondary-color);
    font-weight: 700;
}

.event-highlights {
    margin: 20px 0;
    padding: 18px;
    background: var(--gray-light);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.highlight-item:last-child {
    margin-bottom: 0;
}

.highlight-item i {
    color: var(--primary-color);
    margin-top: 2px;
    flex-shrink: 0;
}

.highlight-item span {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.4;
}

.event-details {
    margin-bottom: 24px;
}

.event-date,
.event-location {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--gray-medium);
    font-size: 0.9rem;
}

.event-date i,
.event-location i {
    color: var(--secondary-color);
    width: 16px;
}

.location-link {
    color: var(--blue);
    text-decoration: none;
}

.location-link:hover {
    text-decoration: underline;
}

.installment-button {
    width: 100%;
    background: var(--success-color);
    color: var(--white);
    border: none;
    border-radius: 16px;
    padding: 14px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.installment-button:hover {
    background: #0246c4;
    transform: translateY(-2px);
}

/* Seção de Ingressos */
.tickets-section {
    padding: 20px;
    background: var(--white);
}

.tickets-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tickets-header h2 {
    font-size: 1.2rem;
    font-weight: bold;
}

.alert-banner {
    background: rgba(0, 89, 255, 0.12);
    color: var(--secondary-color);
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(0, 89, 255, 0.24);
}

.alert-banner i {
    font-size: 0.9rem;
}

/* Lista de Ingressos */
.tickets-list {
    padding: 20px;
}

.ticket-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 18px 48px -32px rgba(15, 23, 42, 0.35);
    transition: all 0.3s;
}

.ticket-card:hover {
    box-shadow: 0 26px 70px -34px rgba(15, 23, 42, 0.45);
    transform: translateY(-3px);
}

.ticket-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.ticket-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.3;
}

.ticket-description {
    font-size: 0.9rem;
    color: #475569;
    margin: 5px 0 0 0;
}

.ticket-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 0;
}

.ticket-tax {
    font-size: 0.9rem;
    color: #64748b;
    margin: 2px 0 0 0;
}

.ticket-tax.is-zero {
    color: var(--secondary-color);
    font-weight: 600;
}

.ticket-installment {
    font-size: 0.9rem;
    color: var(--success-color);
    font-weight: 500;
    margin: 8px 0 0 0;
}

.ticket-sale-date {
    font-size: 0.8rem;
    color: #999;
    margin: 8px 0 0 0;
}

.ticket-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: rgba(0, 89, 255, 0.08);
}

.qty-btn.minus {
    color: #64748b;
}

.qty-btn.plus {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-display {
    width: 40px;
    height: 32px;
    border: 1px solid #ddd;
    background: var(--white);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.ticket-installments {
    color: var(--success-color);
    font-weight: 500;
    margin-bottom: 10px;
}

.ticket-date {
    color: var(--gray-medium);
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.ticket-soldout {
    color: var(--gray-medium);
    font-style: italic;
    font-size: 0.9rem;
    text-align: right;
}

/* Controles de Quantidade */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

.qty-btn {
    width: 35px;
    height: 35px;
    border: 2px solid var(--border-color);
    background: var(--white);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s;
}

.qty-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-display {
    width: 50px;
    height: 35px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: var(--gray-light);
}

/* Cupom de Desconto */
.coupon-section {
    background: var(--white);
    padding: 20px;
    margin: 10px 0;
}

.coupon-section button {
    background: none;
    border: none;
    color: var(--blue);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    text-decoration: underline;
}

.coupon-input {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.coupon-input input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.coupon-input button {
    background: var(--secondary-color);
    color: var(--white);
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
}

/* Botão Principal Fixo */
.main-action {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.select-ticket-btn {
    width: 100%;
    background: var(--success-color);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: 18px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.select-ticket-btn:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.select-ticket-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Resumo do Pedido */
.order-summary {
    background: var(--gray-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.order-summary h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.order-item:last-child {
    border-bottom: none;
}

.order-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Seções do Formulário */
.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-light);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-body h3 {
    color: var(--primary-color);
    margin: 25px 0 15px 0;
    font-size: 1.3rem;
}

/* Formulário */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

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

/* Métodos de Pagamento */
.payment-methods {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.payment-option {
    flex: 1;
}

.payment-option input[type="radio"] {
    display: none;
}

.payment-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option input[type="radio"]:checked + label {
    border-color: var(--secondary-color);
    background: rgba(255,107,0,0.1);
}

.payment-option label i {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.payment-button {
    margin-top: 30px;
}

.payment-button button {
    width: 100%;
    padding: 15px;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.payment-button button:hover:not(:disabled) {
    background: #e55a00;
}

.payment-button button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Modal */
.loading-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.active {
    display: block !important;
}

/* Área de Pagamento PIX - Estilos Organizados */
.pix-payment-container {
    text-align: center;
    padding: 20px;
    max-width: 100%;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.pix-payment-container * {
    touch-action: manipulation;
}

.pix-header-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pix-header-logos img {
    height: 25px;
    width: auto;
    object-fit: contain;
    pointer-events: none;
}

.pix-title {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 0;
}

.pix-description {
    margin-bottom: 20px;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.pix-qr-container {
    background: white;
    padding: 25px;
    border: 2px solid #ddd;
    border-radius: 15px;
    display: inline-block;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 100%;
    box-sizing: border-box;
}

.pix-qr-image {
    max-width: 300px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

.pix-code-section {
    margin: 20px 0;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.pix-code-wrapper {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: left;
}

.pix-code-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.pix-code-text {
    background: white;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    word-break: break-all;
    font-size: 0.75rem;
    max-height: 100px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
    color: #333;
    user-select: text;
    -webkit-user-select: text;
}

.pix-copy-button {
    padding: 12px 30px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s;
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 15px auto;
}

.pix-copy-button:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.pix-copy-button:active {
    transform: translateY(0);
}

.pix-info-box {
    margin: 20px 0;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 8px;
    text-align: left;
}

.pix-info-text {
    font-size: 0.9rem;
    color: #0066cc;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pix-info-text i {
    flex-shrink: 0;
}

/* Modal com área PIX - Desabilitar zoom */
.modal.pix-active {
    touch-action: none;
}

.modal.pix-active .modal-content {
    touch-action: pan-y;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.pix-active .pix-payment-container {
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.modal.pix-active img {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

/* Responsivo */
@media (max-width: 768px) {
    .main-banner {
        min-height: 400px;
    }
    
    .checkout-header {
        padding: 26px 16px;
    }
    
    .logo-img {
        max-height: 70px;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .payment-methods {
        flex-direction: column;
    }

    .event-info h1 {
        font-size: 1.3rem;
    }

    .ticket-card {
        padding: 15px;
    }

    .quantity-controls {
        justify-content: center;
        margin-top: 10px;
    }

    .pix-qr-container {
        padding: 20px;
        margin: 15px 0;
    }

    .pix-qr-image {
        max-width: 250px;
    }

    .pix-code-section {
        max-width: 100%;
    }

    .pix-title {
        font-size: 1.1rem;
    }

    .pix-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-banner {
        min-height: 300px;
    }
    
    .logo-img {
        max-height: 60px;
    }

    .pix-payment-container {
        padding: 15px;
    }

    .pix-qr-container {
        padding: 15px;
    }

    .pix-qr-image {
        max-width: 200px;
    }

    .pix-code-text {
        font-size: 0.7rem;
        padding: 10px;
    }

    .pix-copy-button {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}

.seat-map-section {
    width: min(980px, 92%);
    margin: 0 auto 32px;
}

.seat-map-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 20px 60px -36px rgba(15, 23, 42, 0.4);
    display: grid;
    gap: 12px;
}

.seat-map-image {
    width: 100%;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.seat-map-caption {
    margin: 0;
    font-size: 0.92rem;
    color: #475569;
}

@media (max-width: 768px) {
    .seat-map-section {
        margin-bottom: 24px;
    }

    .seat-map-card {
        padding: 18px;
    }

    .seat-map-image {
        border-radius: 16px;
    }
}
