:root {
    --primary: #C5A059;
    --primary-hover: #B8860B;
    --secondary: #2C2C2C;
    --bg-color: #FAF9F6;
    --text-main: #333333;
    --text-muted: #666666;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: #E2E2E2;
    --accent: #E8D3A3;
    --booked: #B8B8B8;
    --available: #FFFFFF;
    --selected: #C5A059;
    --selected-text: #FFFFFF;
    --gold: #C5A059;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo { font-family: 'Playfair Display', serif; }

.loader-wrapper {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
}
.loader {
    width: 48px; height: 48px;
    border: 5px solid var(--primary);
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.loader-small {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid #fff; border-bottom-color: transparent;
    border-radius: 50%; animation: rotation 0.8s linear infinite;
    margin-left: 8px; vertical-align: middle;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

header {
    background: var(--card-bg); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 5%; position: sticky; top: 0; z-index: 100;
}
.logo { font-size: 2rem; font-weight: 700; letter-spacing: 2px; }
.logo span { font-weight: 300; color: var(--primary); }

.hero {
    position: relative; height: 460px;
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: white; padding: 0 20px;
    overflow: hidden; background: #1a1a1a;
}
.hero-carousel-track { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.hero-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 1.2s ease-in-out;
}
.hero-slide.active {
    opacity: 1; transform: scale(1.02);
    transition: opacity 1.2s ease-in-out, transform 6s ease-out;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(15, 23, 42, 0.7) 100%);
    z-index: 2;
}
.hero-content { position: relative; z-index: 3; transform: translateY(-20px); }
.hero-content h1 { font-size: 3.5rem; margin-bottom: 1rem; text-shadow: 2px 2px 10px rgba(0,0,0,0.3); }
.hero-content p { font-size: 1.2rem; font-weight: 300; max-width: 600px; margin: 0 auto; }

.booking-container {
    display: grid; grid-template-columns: 1fr 450px; gap: 2rem;
    max-width: 1200px; margin: -40px auto 4rem; padding: 0 20px;
    position: relative; z-index: 10;
}

.card {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 2.5rem; box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.3); backdrop-filter: blur(20px);
}
.card-header { margin-bottom: 2rem; }
.card-header h2 { font-size: 1.8rem; color: var(--secondary); margin-bottom: 0.5rem; }
.card-header p { color: var(--text-muted); }

.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-header { text-align: center; font-weight: 600; font-size: 0.9rem; color: var(--text-muted); padding: 10px 0; }

.day-cell {
    aspect-ratio: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; cursor: pointer;
    border-radius: 8px; transition: var(--transition);
    font-size: 1rem; position: relative; border: 1px solid var(--border-color);
}
.day-cell .price { font-size: 0.75rem; color: var(--text-muted); margin-top: -2px; }
.day-cell.booked .price { opacity: 0.2; }
.day-cell.selected .price, .day-cell.partial-booked-start.selected .price { color: rgba(255, 255, 255, 0.9); }

.day-cell.booked {
    background-color: var(--booked); color: #555;
    cursor: not-allowed; text-decoration: line-through; opacity: 0.75;
}
.day-cell.available:hover { border-color: var(--primary); color: var(--primary); background: rgba(197, 160, 89, 0.05); }

.day-cell.selected { background-color: var(--selected) !important; color: white; transform: scale(1.05); }
.day-cell.in-range { background-color: rgba(197, 160, 89, 0.2); }
.day-cell.hover-range { background-color: rgba(197, 160, 89, 0.1) !important; }
.day-cell.hover-error { background-color: rgba(244, 67, 54, 0.1) !important; border-color: #f44336 !important; cursor: not-allowed; }

.day-cell.gap-offer { border: 2px dashed var(--gold); background: rgba(197, 160, 89, 0.05); }
.gap-badge {
    position: absolute; top: 2px; right: 2px;
    background: #e67e22; color: white; font-size: 0.55rem;
    padding: 1px 4px; border-radius: 4px; font-weight: 700;
    line-height: 1.3; z-index: 5;
    pointer-events: none; animation: pulse 2s infinite;
}
@keyframes pulse { 0% { opacity: 0.7; } 50% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0.7; } }
@keyframes pulse-gold { 0%,100% { box-shadow: 0 0 0 0 rgba(197,160,89,0.4); } 50% { box-shadow: 0 0 0 8px rgba(197,160,89,0); } }

.day-cell.today { border: 2px solid var(--primary); }
.day-cell.partial-booked,
.day-cell.partial-booked-start { background: var(--available); }

.calendar-legend { display: flex; gap: 1.5rem; margin-top: 1.5rem; justify-content: center; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-muted); }
.box { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border-color); }
.box.booked { background: var(--booked); }
.box.available { background: var(--available); }
.box.selected { background: var(--selected); }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.9rem; color: var(--secondary); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px 16px; border: 1px solid var(--border-color);
    border-radius: 8px; font-family: inherit; font-size: 1rem;
    transition: var(--transition); background: white;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.1);
}
.form-group input.invalid, .form-group textarea.invalid { border-color: #f44336; background: rgba(244,67,54,0.05); }

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

.booking-summary {
    background: rgba(197, 160, 89, 0.05); padding: 1.5rem;
    border-radius: 8px; margin: 2rem 0;
    border: 1px dashed var(--primary);
}
.booking-summary h3 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--primary); }
.summary-line { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.summary-line.highlight { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--primary); font-weight: 600; }

.btn-primary {
    width: 100%; padding: 16px; background: var(--primary);
    color: white; border: none; border-radius: 8px;
    font-size: 1.1rem; font-weight: 600; cursor: pointer;
    transition: var(--transition); text-transform: uppercase; letter-spacing: 1px;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.2);
}
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.form-note { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 1rem; }

footer { text-align: center; padding: 3rem; color: var(--text-muted); position: relative; }
footer a { color: var(--gold); text-decoration: none; font-weight: bold; }

.toast {
    position: fixed; bottom: 2rem; right: 2rem;
    padding: 1rem 2rem; background: white;
    color: var(--secondary); border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    display: flex; align-items: center; gap: 12px;
    transform: translateX(120%); opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000; font-weight: 600;
    border-left: 5px solid var(--primary);
    max-width: 380px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.error { border-left-color: #f44336; }
.toast.success { border-left-color: #4CAF50; }

.whatsapp-float {
    position: fixed; bottom: 2rem; left: 2rem;
    width: 60px; height: 60px;
    background-color: #25d366; color: #FFF;
    border-radius: 50px; text-align: center; font-size: 30px;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3);
    z-index: 999; display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: all 0.3s ease;
    animation: float-jump 3s infinite;
}
.whatsapp-float:hover { transform: scale(1.1) rotate(5deg); background-color: #20b355; }
@keyframes float-jump { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); } }

.nav-btn {
    background: transparent; border: 1px solid var(--border-color);
    width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; font-size: 0.9rem; color: var(--secondary);
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.nav-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ============ UX Enhancements ============ */

.progress-stepper {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; max-width: 560px; margin: 1.5rem auto 0; padding: 0 20px;
    position: relative; z-index: 10;
}
.step { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.88rem; transition: var(--transition); }
.step-number {
    width: 32px; height: 32px; border-radius: 50%;
    background: white; border: 2px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
    transition: var(--transition);
}
.step.active { color: var(--secondary); }
.step.active .step-number { background: var(--primary); color: white; border-color: var(--primary); transform: scale(1.08); }
.step.completed .step-number { background: #4CAF50; color: white; border-color: #4CAF50; }
.step.completed .step-number::before { content: '✓'; }
.step.completed .step-number-text { display: none; }
.step-line { flex: 0 0 32px; height: 2px; background: var(--border-color); transition: var(--transition); }
.step-line.active { background: var(--primary); }

.urgency-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(230, 126, 34, 0.1); color: #d35400;
    padding: 6px 14px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600; margin-top: 0.8rem;
}
.urgency-badge::before { content: '🔥'; }

.range-display {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 8px; padding: 14px; margin-bottom: 1rem;
    background: white; border-radius: 8px; border: 1px solid var(--border-color);
    font-size: 0.95rem;
}
.range-display .range-nights { font-weight: 700; color: var(--primary); }
.range-display .range-arrow, .range-display .range-sep { color: var(--text-muted); }

.price-breakdown { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed var(--border-color); }
.price-breakdown .summary-line { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.price-breakdown .summary-line.savings { color: #2E7D32; font-weight: 600; }

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(20,20,20,0.55);
    backdrop-filter: blur(4px); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-backdrop[hidden] { display: none; }
.modal-backdrop.show { opacity: 1; pointer-events: auto; }
.modal {
    background: white; border-radius: var(--radius);
    max-width: 500px; width: 100%; padding: 2rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    transform: scale(0.92) translateY(10px); transition: transform 0.25s ease;
    max-height: 90vh; overflow-y: auto;
}
.modal-backdrop.show .modal { transform: scale(1) translateY(0); }
.modal h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--secondary); margin-bottom: 0.5rem; }
.modal-row {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--border-color);
    font-size: 0.92rem;
}
.modal-row:last-child { border-bottom: none; }
.modal-row strong { color: var(--secondary); text-align: right; }
.modal-row.highlight { color: var(--primary); font-weight: 700; font-size: 1rem; }
.modal-actions { display: flex; gap: 10px; margin-top: 1.5rem; }
.modal-actions .btn-primary { margin-top: 0; flex: 1; padding: 14px; }
.btn-secondary {
    flex: 1; padding: 14px; background: transparent; color: var(--text-muted);
    border: 1px solid var(--border-color); border-radius: 8px;
    font-weight: 600; cursor: pointer; font-size: 1rem;
    font-family: inherit; transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.day-cell:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; z-index: 10; }

.mobile-sticky-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    background: white; border-top: 2px solid var(--primary);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
    padding: 12px 16px; display: none;
    align-items: center; justify-content: space-between; gap: 12px;
    transform: translateY(110%); transition: transform 0.3s ease;
}
.mobile-sticky-bar[hidden] { display: none !important; }
.mobile-sticky-bar.show { transform: translateY(0); }
.msb-info { display: flex; flex-direction: column; line-height: 1.15; }
.msb-total { font-weight: 700; font-size: 1.1rem; color: var(--primary); font-family: 'Playfair Display', serif; }
.msb-nights { font-size: 0.78rem; color: var(--text-muted); }
.msb-cta {
    background: var(--primary); color: white; border: none;
    padding: 10px 18px; border-radius: 8px; font-weight: 600;
    cursor: pointer; font-family: inherit; font-size: 0.9rem;
    white-space: nowrap; transition: var(--transition);
}
.msb-cta:hover { background: var(--primary-hover); }

@media (max-width: 1024px) {
    .booking-container { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2.5rem; }
    .mobile-sticky-bar { display: flex; }
    body.has-booking { padding-bottom: 80px; }
}
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .hero { height: 250px; }
    .card { padding: 1.5rem; }
    .toast { left: 1rem; right: 1rem; max-width: none; bottom: 90px; }
    .progress-stepper { gap: 6px; padding: 0 10px; }
    .progress-stepper .step-label { display: none; }
    .step-line { flex-basis: 20px; }
    .modal { padding: 1.5rem; }
    .modal-actions { flex-direction: column-reverse; }
    .gap-badge {
        top: 1px; right: 1px;
        font-size: 0.48rem; padding: 0 3px;
        border-radius: 3px;
    }
    .gap-badge .gap-badge-pct { display: none; }
    .day-cell.gap-offer { border-width: 1.5px; }
}
