:root {
    --color-primary: #2E4A3D;
    --color-primary-light: #4A6E5D;
    --color-accent: #D48C44;
    --color-accent-hover: #b87635;
    --color-bg: #F9F7F2;
    --color-card-bg: #FFFFFF;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #e0e0e0;
    --container-width: 900px;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--color-text);
    background-color: #f7f9f7;
    margin: 0;
    padding-bottom: 2rem;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Aesthetics */
body::after {
    content: '';
    position: fixed;
    bottom: -240px;
    /* Slightly lower */
    right: -160px;
    /* Further right */
    width: 700px;
    height: 900px;
    background-image: url('bg-giraffe-v2.png');
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
    mix-blend-mode: multiply;
}

/* ... existing styles ... */



.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Header */
.header {
    background-color: var(--color-card-bg);
    padding: var(--spacing-sm) 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.back-link {
    text-decoration: none;
    color: var(--color-text-light);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
    /* Removed fixed width to allow natural spacing */
}

.back-link:hover {
    color: var(--color-primary);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    /* Removed text-align center and flex-grow to allow space-between to push it right */
}

/* Progress Bar */
.progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: var(--spacing-md) 0 var(--spacing-lg);
    gap: 1rem;
}

.progress-step {
    font-weight: 600;
    color: var(--color-text-light);
    font-size: 0.9rem;
    opacity: 0.5;
    transition: opacity 0.3s, color 0.3s;
}

.progress-step.active {
    color: var(--color-primary);
    opacity: 1;
    font-weight: 700;
}

.progress-line {
    width: 40px;
    height: 2px;
    background-color: #ddd;
}

/* Main Content */
.main-content {
    flex: 1;
}

.page-title {
    text-align: center;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

/* Steps */
.step-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.step-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Tickets Grid */
.tickets-grid {
    display: grid;
    gap: 1.5rem;
    /* Increased gap to prevent sticking */
    margin-bottom: var(--spacing-md);
    grid-template-columns: 1fr 1fr;
    /* Enforce 2 columns */
}

@media (max-width: 600px) {
    .tickets-grid {
        grid-template-columns: 1fr;
        /* Stack on very small screens if needed, or keep 2 if user insists */
    }
}

.ticket-card {
    background: var(--color-card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    /* Better for grid layout */
    justify-content: space-between;
    align-items: flex-start;
    /* Left align content in card */
    gap: 1rem;
    border: 1px solid transparent;
}

/* Family Bundle Style Update */
.ticket-card.highlight {
    border-color: var(--color-accent);
    background: white;
    /* Changed from transparent tint to white as requested */
    border-width: 2px;
    /* Slight highlight via border instead */
}

.ticket-type {
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

/* Calendar Styles (Restored) */
.calendar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    /* Center horizontally */
}

.custom-calendar {
    position: relative;
    width: 300px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    user-select: none;
    transition: opacity 0.3s;
}

.custom-calendar.disabled {
    pointer-events: none;
    opacity: 0.5;
    background: #f9f9f9;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.cal-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.cal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.cal-day:hover:not(.empty) {
    background-color: var(--color-bg);
}

.cal-day.selected {
    background-color: var(--color-primary);
    color: white;
}

.cal-day.empty {
    cursor: default;
}

.open-date-wrapper {
    margin-top: 0.5rem;
}

/* Calendar Status Colors */
.cal-day.status-free {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.cal-day.status-free:hover {
    background-color: #c8e6c9;
}

.cal-day.status-closed {
    background-color: #f5f5f5;
    color: #9e9e9e;
    cursor: not-allowed;
    text-decoration: line-through;
    border: 1px solid #e0e0e0;
}

.cal-day.status-soldout {
    background-color: #ffebee;
    color: #c62828;
    cursor: not-allowed;
    border: 1px solid #ffcdd2;
}

/* Selected state overrides status colors */
.cal-day.selected {
    background-color: var(--color-primary) !important;
    color: white !important;
    border-color: var(--color-primary) !important;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-free {
    background-color: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.dot-closed {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.dot-soldout {
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
}

/* End Calendar Styles */

/* Navigation & Footer */
.step-footer {
    display: flex;
    justify-content: space-between;
    /* Ensures Back is Left, Next is Right */
    margin-top: 1rem;
    /* Reduced to pull closer to warning */
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    gap: 1rem;
    max-width: 540px;
    /* Tighter width: 260px * 2 + 20px gap */
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.total-preview {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-primary);
    /* margin-right: auto; Removed, space-between handles it */
}

/* Button Consistency */
.cta-btn,
.secondary-btn {
    width: 260px;
    /* Fixed width for exact equality */
    justify-content: center;
    display: flex;
    padding: 1rem;
}

.cta-btn {
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cta-btn:hover {
    background-color: #e69138;
}

.secondary-btn {
    background-color: transparent;
    color: var(--color-text-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    border-color: var(--color-text);
    color: var(--color-text);
}

.ticket-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f5f5f5;
    border-radius: 50px;
    padding: 0.25rem;
    width: 100%;
    /* Full width in card */
    justify-content: space-between;
}

.control-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #fff;
    cursor: pointer;
    font-weight: bold;
    color: var(--color-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.control-btn:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.count {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    /* Reduced spacing */
    max-width: 600px;
    margin: 0 auto 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    /* Tighter label-input gap */
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--color-text);
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
    width: 100%;
    background-color: white;
    box-sizing: border-box;
    /* Explicitly ensure border-box */
    appearance: none;
    /* Uniform look */
    -webkit-appearance: none;
}

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

/* Summary List */
.checkout-summary {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.summary-list {
    list-style: none;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.summary-item-name {
    color: var(--color-text);
}

.summary-item-price {
    font-weight: 600;
}

.total-row {
    display: flex;
    justify-content: placeholder;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.total-price {
    color: var(--color-accent);
}

.payment-selection {
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Footer Buttons */
.step-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.total-preview {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.cta-btn,
.secondary-btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.1s;
}

.cta-btn {
    background: var(--color-accent);
    color: white;
    border: none;
    margin-left: auto;
}

.cta-btn:hover {
    background: var(--color-accent-hover);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-light);
}

.secondary-btn:hover {
    border-color: var(--color-text);
    color: var(--color-text);
}

.footer {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 0.85rem;
}

/* New Feature Styles */
.date-selection-container,
.conservation-container {
    background: var(--color-card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-sm);
}

.section-label {
    display: block;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.date-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
}

.date-input {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
}

.date-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-label {
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: column;
}

.highlight-checkbox {
    background-color: rgba(46, 74, 61, 0.05);
    /* very light primary color */
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(46, 74, 61, 0.1);
}

.conservation-desc {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 0.2rem;
}

.summary-item.surcharge {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-style: italic;
    border-top: 1px dashed #eee;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}



/* Payment Options Grid */
.payment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.payment-option-btn {
    background: white;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--color-text);
}

.payment-option-btn:hover {
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.payment-option-btn.active {
    border-color: var(--color-accent);
    background-color: rgba(212, 140, 68, 0.05);
    /* Light accent tint */
    color: var(--color-accent);
}

.payment-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Payment Demo Area */
.payment-demo-area {
    background: #f0f4f8;
    border: 1px dashed #cbd5e0;
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--color-text-light);
}

.demo-title {
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

/* Test Warning */
.test-warning {
    background-color: #fff3e0;
    border-left: 4px solid var(--color-accent);
    padding: 1rem;
    margin-top: 1rem;
    /* margin-bottom is handled by container spacing typically, but let's be safe */
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #e65100;
    border-radius: 4px;
    text-align: left;
}

/* Footer Button Fix */
/* Ensure space between buttons */
}

/* Validation Animations */
@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.error-shake {
    border: 2px solid #e74c3c !important;
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background-color: #333;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease-out;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification.error {
    background-color: #e74c3c;
}

.toast-notification.success {
    background-color: #2e7d32;
}