/* Booking Section Styles */
.booking-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.booking-container {
    width: 100%;
}

.booking-title {
    font-family: 'Merriweather', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

.booking-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0.8;
}

.booking-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.availability-calendar {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.availability-calendar h2 {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.calendar-rules {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.calendar-rules p {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    color: var(--text-color);
}

#calendar-container {
    min-height: 200px;
}

.calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-color);
    font-size: 1rem;
}

#calendar {
    margin: 1.5rem 0;
}

/* Calendar months container - 2 months side by side */
.calendar-months-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.calendar-month-wrapper {
    display: flex;
    flex-direction: column;
}

.calendar-month-title {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

/* Custom Calendar Styles */
.custom-calendar {
    font-family: 'Inter', sans-serif;
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

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

.calendar-month-year {
    font-family: 'Merriweather', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.calendar-nav-btn {
    background: var(--white);
    border: 1px solid #e0e0e0;
    cursor: pointer;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
    color: var(--text-color);
    flex-shrink: 0;
}

.calendar-nav-btn:hover {
    background: #f5f5f5;
    border-color: var(--primary-color);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-color);
    padding: 0.5rem 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid #e0e0e0;
    background: var(--white);
    min-height: 40px;
    max-width: 100%;
    box-sizing: border-box;
}

.calendar-day:first-child {
    border-top-left-radius: 8px;
}

.calendar-day:nth-child(7) {
    border-top-right-radius: 8px;
}

.day-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    padding: 4px;
    position: relative;
    min-height: 50px; /* Ensure enough space for label */
}

.calendar-day.empty {
    cursor: default;
    visibility: hidden;
}

.calendar-day .day-number {
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 1;
    line-height: 1.2;
}

.calendar-day .day-price {
    font-size: 0.7rem;
    font-weight: 400;
    color: #666;
    z-index: 1;
    line-height: 1;
}

.calendar-day .day-label {
    font-size: 0.6rem;
    font-weight: 600;
    z-index: 2;
    line-height: 1;
    margin-top: 1px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.calendar-day.booked .day-label.owner-booked {
    color: rgba(255, 255, 255, 0.95);
    background: #800000;
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 0.55rem;
}

.calendar-day.past {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.available {
    background: var(--white);
    color: var(--text-color);
    border-color: #e0e0e0;
}

.calendar-day.available:hover {
    background: #e8f4f8;
    border-color: var(--primary-color);
    z-index: 2;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.calendar-day.available .day-price {
    color: var(--primary-color);
    font-weight: 500;
}

.calendar-day.booked {
    background: #800000; !important;
    color: white !important;
    cursor: not-allowed !important;
    border-color: #d32f2f !important;
    font-weight: 500;
}

.calendar-day.booked.selected {
    background: #800000; !important;
    border-color: #800000;important;
}

.calendar-day.blocked {
    background: #f5f5f5;
    color: #9e9e9e;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.calendar-day.selected {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    font-weight: 700;
    z-index: 3;
}

.calendar-day.selected .day-price {
    color: rgba(255, 255, 255, 0.9);
}

.calendar-day.checkin {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    font-weight: 700;
    z-index: 3;
}

.calendar-day.checkin .day-price {
    color: rgba(255, 255, 255, 0.9);
}

.calendar-day.checkout {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    font-weight: 700;
    z-index: 3;
}

.calendar-day.checkout .day-price {
    color: rgba(255, 255, 255, 0.9);
}

.calendar-day.in-range {
    background: #e8f4f8;
    color: var(--primary-color);
    border-color: #b3d9e6;
    border-radius: 0;
    position: relative;
}

.calendar-day.in-range .day-price {
    color: var(--primary-color);
    font-weight: 500;
}

.calendar-day.hover-range {
    background: #f0f8fa;
    border-color: #cce7f0;
    border-radius: 0;
}

.calendar-day.hover-range .day-price {
    color: var(--primary-color);
}

.calendar-day.today {
    border-color: var(--primary-color);
    font-weight: 700;
}

.calendar-day.today.selected {
    border-color: var(--white);
}

.calendar-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
}

.legend-color.available {
    background: var(--white);
    border: 1px solid #e0e0e0;
}

.legend-color.booked {
    background: #800000;
}

.legend-color.blocked {
    background: #9e9e9e;
}

.selected-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.date-input-group {
    display: flex;
    flex-direction: column;
}

.date-input-group label {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.date-input-group input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
    cursor: pointer;
}

.date-input-group.clickable-date-input {
    cursor: pointer;
}

.date-input-group.clickable-date-input:hover input {
    border-color: var(--primary-color);
}

.date-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.price-summary {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.price-summary h3 {
    font-family: 'Merriweather', serif;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.price-line {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-family: 'Inter', sans-serif;
    border-bottom: 1px solid #e0e0e0;
}

.price-line.total {
    border-bottom: none;
    border-top: 2px solid var(--primary-color);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.booking-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.booking-form h2 {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.booking-form h3 {
    font-family: 'Merriweather', serif;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 1.5rem 0 1rem;
}

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

.form-group label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

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

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.checkbox-group a {
    color: var(--primary-color);
    text-decoration: underline;
}

.payment-breakdown {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    background: #f0f7ff;
    border: 1px solid #b3d4fc;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
}

.payment-breakdown h3 {
    margin: 0 0 0.75rem 0;
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.payment-breakdown p {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.payment-breakdown-note {
    margin-top: 1rem !important;
    font-size: 0.95rem;
    color: #555;
}

#payment-element {
    margin-top: 1rem;
}

#payment-element h3 {
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

#stripe-payment-element {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.payment-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    display: none;
}

.payment-message.error {
    background: #ffebee;
    color: #c62828;
}

.payment-message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.submit-button {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-button:hover:not(:disabled) {
    background: var(--logo-color);
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(9, 30, 59, 0.3);
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@media (max-width: 1024px) {
    .booking-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .booking-section {
        padding: 2rem 1rem;
    }

    .booking-title {
        font-size: 2rem;
    }

    .selected-dates {
        grid-template-columns: 1fr;
    }
    
    .custom-calendar {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .calendar-header {
        margin-bottom: 1rem;
    }
    
    .calendar-month-year {
        font-size: 1.1rem;
    }
    
    .calendar-weekdays {
        gap: 0.25rem;
    }
    
    .calendar-weekday {
        font-size: 0.75rem;
        padding: 0.25rem 0;
    }
    
    .calendar-days {
        gap: 0.25rem;
    }
    
    .calendar-day {
        min-height: 35px;
        font-size: 0.85rem;
    }
    
    .day-number {
        font-size: 0.85rem;
    }
    
    .day-price {
        font-size: 0.6rem;
    }
    
    .calendar-nav-btn {
        padding: 0.5rem;
        width: 36px;
        height: 36px;
    }
    
    .calendar-nav-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Stack calendar months vertically on mobile */
    .calendar-months-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .custom-calendar {
        padding: 0.75rem;
    }
    
    .calendar-day {
        min-height: 30px;
    }
    
    .day-number {
        font-size: 0.75rem;
    }
    
    .day-price {
        font-size: 0.55rem;
    }
}


/* Voucher code field */
.voucher-input-row {
    display: flex;
    gap: 0.5rem;
}

.voucher-input-row input {
    flex: 1;
}

.voucher-apply-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color, #2c3e50);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    white-space: nowrap;
}

.voucher-apply-btn:hover {
    opacity: 0.85;
}

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

.voucher-message {
    margin-top: 0.4rem;
    font-size: 0.875rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
}

.voucher-message.success {
    background: #e8f5e9;
    color: #27ae60;
}

.voucher-message.error {
    background: #fdecea;
    color: #c0392b;
}

.voucher-message.info {
    background: #e8f0fe;
    color: #1a56db;
}

/* ============================================================
   4-Step Booking Wizard Styles
   ============================================================ */

/* Step progress indicator */
.booking-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    flex-wrap: nowrap;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.35;
    transition: opacity 0.25s;
    min-width: 60px;
}

.step-item.active,
.step-item.completed {
    opacity: 1;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: background 0.25s, color 0.25s;
}

.step-item.active .step-number {
    background: var(--primary-color);
    color: #fff;
}

.step-item.completed .step-number {
    background: #27ae60;
    color: #fff;
}

.step-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    white-space: nowrap;
}

.step-connector {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    min-width: 30px;
    max-width: 80px;
    margin-bottom: 1.2rem;
}

/* Wizard step panels */
.booking-step-panel {
    max-width: 720px;
    margin: 0 auto;
    animation: stepFadeIn 0.2s ease;
}

@keyframes stepFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Step navigation (back + next side by side) */
.step-nav {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.back-button {
    padding: 0.9rem 1.6rem;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.back-button:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Booking summary card (Review and Payment steps) */
.booking-summary-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
}

.booking-summary-card h3 {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.booking-summary-card .price-line {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.booking-summary-card .price-line:last-child {
    border-bottom: none;
}

.booking-summary-card .price-line.total {
    border-top: 2px solid var(--primary-color);
    border-bottom: none;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.booking-summary-card .price-line.discount {
    color: #27ae60;
}

/* Per-step inline error messages */
.step-error {
    color: #c62828;
    background: #ffebee;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Two-column layout for first/last name on Step 2 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 520px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .step-connector {
        min-width: 15px;
    }

    .step-label {
        font-size: 0.65rem;
    }
}
