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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f6fa;
    color: #1f2937;
    line-height: 1.6;
}

header {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

#header-image {
    width: 100%;
    height: auto;
    display: block;
}

#basket-summary {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: #ffffff;
    color: #6154af;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

#basket-summary:hover {
    background: #f0f0f0;
    transform: scale(1.04);
}

main {
    display: flex;
    flex-direction: column;
    max-width: 680px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    gap: 2rem;
}

/* Ticket hero */
.ticket-hero {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.09);
}

.ticket-hero-image img {
    width: 50%;
    height: auto;
    aspect-ratio: 1089 / 570;
    display: block;
    margin: 0 auto;
}

.ticket-hero-info {
    padding: 1.75rem;
}

.ticket-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.ticket-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 0.4rem;
}

.ticket-info {
    font-size: 0.88rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.ticket-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #6154af;
    margin-bottom: 1.75rem;
}

.qty-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.hero-quantity-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.qty-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #6154af;
    background: white;
    color: #6154af;
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    line-height: 1;
}

.qty-btn:hover {
    background: #6154af;
    color: white;
}

#hero-quantity {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    min-width: 2.5rem;
    text-align: center;
}

/* Basket */
#basket {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    border: 1px solid #f0f0f0;
}

#basket h2 {
    margin-bottom: 1.25rem;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 700;
}

.basket-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
    align-items: center;
}

.basket-item-info h4 {
    font-size: 0.9rem;
    color: #111827;
    font-weight: 600;
}

.item-subtotal {
    font-weight: 700;
    color: #111827;
    font-size: 0.95rem;
    min-width: 3.5rem;
    text-align: right;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.quantity-controls button {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.quantity-controls button:hover {
    background: #6154af;
    border-color: #6154af;
    color: white;
}

.quantity-controls span {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.empty-basket {
    text-align: center;
    padding: 1.5rem;
    color: #9ca3af;
    font-size: 0.9rem;
}

#basket-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #f3f4f6;
}

#total-line {
    display: flex;
    justify-content: space-between;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
}

#checkout-btn {
    width: 100%;
    padding: 1rem;
    background: #6154af;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.01em;
}

#checkout-btn:hover:not(:disabled) {
    background: #4a3e8a;
    transform: scale(1.01);
}

#checkout-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

#switch-off-message {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    padding: 2rem;
    max-width: 80%;
    margin: 0 auto;
}

#switch-off-message.hidden {
    display: none;
}

main.hidden {
    display: none;
}

#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 100;
    font-weight: 600;
    color: #6154af;
}

#loading.hidden {
    display: none;
}

#error-message {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    display: none;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}

#error-message.visible {
    display: block;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    position: relative;
    background: white;
    border-radius: 14px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

#modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}

#modal-close:hover {
    color: #111827;
    background: #f3f4f6;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.form-group input {
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #111827;
    transition: border-color 0.15s;
    outline: none;
}

.form-group input:focus {
    border-color: #6154af;
}

.form-group input.invalid {
    border-color: #ef4444;
}

.field-error {
    font-size: 0.8rem;
    color: #ef4444;
    display: none;
}

.field-error.visible {
    display: block;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.modal-actions button {
    flex: 1;
    padding: 0.85rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}

#modal-cancel {
    background: #f3f4f6;
    color: #374151;
}

#modal-cancel:hover {
    background: #e5e7eb;
}

#modal-pay {
    background: #6154af;
    color: white;
}

#modal-pay:hover {
    background: #4a3e8a;
    transform: scale(1.01);
}

@media (max-width: 600px) {
    main {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    header {
        padding: 0.75rem 1rem;
    }

    #shop-logo {
        height: 48px;
        width: 48px;
    }

    .ticket-title {
        font-size: 1.35rem;
    }
}

@media (max-width: 600px) and (orientation: portrait) {
    #basket-summary {
        display: none;
    }
}
