/* System font stack */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: manipulation;
}

html {
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    hanging-punctuation: first allow-end last;
    font-size: 1.25rem;
    font-weight: 400;
    overscroll-behavior-y: none;
    font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Adwaita Sans, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif;
    background-color: white;
    color: black;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

main,
header {
    display: flex;
    max-width: 30rem;
    width: 100%;
    padding-left: .5rem;
    padding-right: .5rem;
}

header {
    justify-content: center;
    align-items: center;
    height: 6rem;
}

.logo {
    height: 4rem;
}

main {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 6rem);
    padding-bottom: .5rem;
}

.vh-spacer {
    flex: 1;
    min-height: 1.5rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

#warning-message {
    color: red;
    font-size: 1rem;
    margin-top: 0.5rem;
    display: none;
}

.line-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.line-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-and-quantity {
    display: flex;
    align-items: space-between;
    gap: .5rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.quantity-btn {
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid black;
    border-radius: 0.5rem;
    background-color: white;
    color: black;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    user-select: none;
    padding: 0;
    font-family: inherit;
}

.quantity-btn:hover {
    background-color: #f0f0f0;
}

.quantity-btn:active {
    background-color: #e0e0e0;
}

.quantity-display {
    text-align: center;
    font-size: 1rem;
    width: 1rem;
    font-weight: 500;
}

.transaction-fee-note, .boring-stuff {
    color: gray;
    font-style: italic;
    font-size: .75rem;
}

.boring-stuff {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.marketing-opt-out {
    vertical-align: middle;
}

.marketing-opt-out input[type="checkbox"] {
    vertical-align: middle;
}

.express-checkout-container {
    margin-top: .5rem;
}

.total-container {
    margin-top: 1.5rem;
}

.total {
    margin-top: .5rem;
    font-weight: 700;
}

.back-link {
    margin-top: 1.5rem;
}

.terms-and-conditions-item {
    margin-bottom: 1rem;
}

.terms-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-label {
    margin-right: 0.25rem;
}

.underlined-link {
    color: inherit;
    text-decoration: underline;
}

/* Success & Error page shared container styles */
.order-details,
.error-box {
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
}

/* Success page styles */
.order-details {
    background: #f8f8f8;
}

.order-details h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.order-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-details li {
    margin-top: 1.5rem;
    font-size: 1rem;
}

.order-total {
    font-weight: 700;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #ddd;
}

.confirmation-info {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding-left: 1rem;
}

.whatsapp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: #25D366;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 700;
    margin-top: 1.5rem;
    transition: background-color 0.2s ease;
}

.whatsapp-button:hover {
    background-color: #128C7E;
}

.whatsapp-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Already viewed page */
.already-viewed-message {
    font-size: 1.1rem;
    margin: 1.5rem 0;
    line-height: 1.6;
}

/* Error page */
.error-box {
    background: #fee2e2;
    border: 1px solid #ef4444;
}

/* Loading overlay styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid #e0e0e0;
    border-top-color: black;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

.loading-subtext {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* Event list on index page */
.event-list {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-list li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.event-list a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.event-list a:hover {
    opacity: 0.7;
}

.ticket-count {
    color: gray;
    font-size: 0.85rem;
}

/* Event date subtext on detail page */
.event-date-subtext {
    color: gray;
    font-style: italic;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}
