/* ─────────────────────────────────────────────────────────────────────────────
   style.css — Booking Engine Frontend
   ───────────────────────────────────────────────────────────────────────────── */

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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --text: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg: #ffffff;
    --bg-subtle: #f9fafb;
    --success: #10b981;
    --error: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .10);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Nav ────────────────────────────────────────────────────────────────────── */

nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-brand img {
    height: 36px;
    width: auto;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all .15s;
}

.lang-btn:hover,
.lang-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, .06);
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */

.hero {
    background: var(--primary);
    color: white;
    padding: 64px 0 80px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    opacity: .88;
    margin-bottom: 40px;
}

/* ── Search bar ─────────────────────────────────────────────────────────────── */

.search-bar {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 720px;
    margin: 0 auto;
    overflow: hidden;
}

.search-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px 20px;
    border-right: 1px solid var(--border);
    min-width: 0;
}

.search-field:last-of-type {
    border-right: none;
}

.search-field label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.search-field input,
.search-field select {
    border: none;
    outline: none;
    font-size: .95rem;
    color: var(--text);
    background: transparent;
    width: 100%;
    font-weight: 500;
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 28px;
    font-size: .95rem;
    font-weight: 600;
    transition: background .15s;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* ── Section ────────────────────────────────────────────────────────────────── */

.section {
    padding: 60px 0;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 32px;
}

/* ── Property grid ──────────────────────────────────────────────────────────── */

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.property-card {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: white;
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
}

.property-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.property-card-img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-card-img-placeholder {
    width: 100%;
    height: 210px;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
}

.property-card-body {
    padding: 18px 20px;
}

.property-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-card-city {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.property-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.property-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.property-card-price span {
    font-size: .8rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .9rem;
    border: none;
    transition: all .15s;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

.btn-sm {
    padding: 7px 16px;
    font-size: .82rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ── Gallery ────────────────────────────────────────────────────────────────── */

.gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 240px 240px;
    gap: 8px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 48px;
}

.gallery-main {
    grid-row: 1 / 3;
}

.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity .15s;
}

.gallery img:hover {
    opacity: .92;
}

.gallery-placeholder {
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
    grid-row: 1 / 3;
    border-radius: var(--radius);
}

/* ── Property detail layout ─────────────────────────────────────────────────── */

.property-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    align-items: start;
}

.property-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.property-location {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: .95rem;
}

.property-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

.property-section:last-child {
    border-bottom: none;
}

.property-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ── Sidebar booking widget ─────────────────────────────────────────────────── */

.booking-widget {
    position: sticky;
    top: 84px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    background: white;
}

.widget-price {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.widget-price strong {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.widget-price span {
    font-size: .9rem;
    color: var(--text-muted);
}

.widget-body {
    padding: 20px 24px;
}

.widget-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
}

.widget-date-field {
    padding: 10px 14px;
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
}

.widget-date-field:last-child {
    border-right: none;
}

.widget-date-field:hover {
    background: var(--bg-subtle);
}

.widget-date-field label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.widget-date-field input {
    border: none;
    outline: none;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    width: 100%;
    cursor: pointer;
}

.widget-guests {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
    cursor: pointer;
}

.widget-guests label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.widget-guests-val {
    font-size: .9rem;
    font-weight: 600;
}

.widget-summary {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
}

.widget-summary-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1rem;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.widget-unavail {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: .85rem;
    color: var(--error);
    margin-bottom: 12px;
    text-align: center;
}

/* ── Calendar ───────────────────────────────────────────────────────────────── */

.calendar {
    user-select: none;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-month {
    font-weight: 700;
    font-size: 1rem;
    text-transform: capitalize;
}

.calendar-nav {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all .15s;
}

.calendar-nav:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.calendar-day-name {
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 4px 0 8px;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all .12s;
    position: relative;
}

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

.calendar-day.available:hover {
    background: var(--primary);
    color: white;
}

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

.calendar-day.in-range {
    background: rgba(99, 102, 241, .12);
    color: var(--primary);
}

.calendar-day.closed {
    color: var(--text-muted);
    text-decoration: line-through;
    cursor: not-allowed;
    opacity: .5;
}

.calendar-day.past {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: .4;
}

.calendar-day-price {
    position: absolute;
    bottom: 2px;
    font-size: .55rem;
    color: var(--text-muted);
    line-height: 1;
}

.calendar-day.selected .calendar-day-price,
.calendar-day.in-range .calendar-day-price {
    color: var(--primary);
}

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

/* ── Booking form ───────────────────────────────────────────────────────────── */

.booking-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 48px;
    align-items: start;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group .required {
    color: var(--error);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    color: var(--text);
    outline: none;
    transition: border-color .15s;
    background: white;
}

.form-control:focus {
    border-color: var(--primary);
}

.form-control.error {
    border-color: var(--error);
}

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

.form-error {
    font-size: .78rem;
    color: var(--error);
    margin-top: 4px;
}

.booking-summary-card {
    position: sticky;
    top: 84px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: white;
}

.booking-summary-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.booking-summary-img-placeholder {
    width: 100%;
    height: 180px;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-muted);
}

.booking-summary-body {
    padding: 20px;
}

.booking-summary-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.booking-summary-dates {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.booking-summary-line {
    display: flex;
    justify-content: space-between;
    font-size: .88rem;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

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

.booking-summary-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--border);
}

/* ── Confirmation ───────────────────────────────────────────────────────────── */

.confirmation-card {
    max-width: 520px;
    margin: 80px auto;
    text-align: center;
    padding: 0 20px;
}

.confirmation-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(16, 185, 129, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 24px;
}

.confirmation-ref {
    display: inline-block;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 16px 0 32px;
}

.confirmation-details {
    text-align: left;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 32px;
}

.confirmation-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: .9rem;
    border-bottom: 1px solid var(--border);
}

.confirmation-detail-row:last-child {
    border-bottom: none;
}

.confirmation-detail-row .label {
    color: var(--text-muted);
}

.confirmation-detail-row .value {
    font-weight: 600;
}

/* ── Lightbox ───────────────────────────────────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .9);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    opacity: .8;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .15);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background .15s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, .3);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

/* ── Spinner ────────────────────────────────────────────────────────────────── */

#spinner {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    font-size: 2rem;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */

footer {
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
}

/* ── Empty / Error states ───────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1rem;
}

/* ── Required asterisk (CSS-only, always inline with label) ─────────────────── */

label[data-required]::after,
.form-group label[data-required]::after {
    content: ' *';
    color: var(--error);
    font-size: .85em;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 900px) {
    .property-layout {
        grid-template-columns: 1fr;
    }

    .booking-layout {
        grid-template-columns: 1fr;
    }

    .booking-widget {
        position: static;
    }

    .booking-summary-card {
        position: static;
    }
}

/* Mobile */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 16px;
    }

    .section {
        padding: 32px 0;
    }

    .nav-inner {
        height: 56px;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .nav-brand img {
        height: 28px;
    }

    .lang-btn {
        padding: 3px 10px;
        font-size: .75rem;
    }

    .hero {
        padding: 36px 0 48px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: .9rem;
        margin-bottom: 24px;
    }

    .search-bar {
        flex-direction: column;
        border-radius: var(--radius);
    }

    .search-field {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
    }

    .search-field:last-of-type {
        border-bottom: none;
    }

    .search-btn {
        padding: 14px;
        border-radius: 0 0 var(--radius) var(--radius);
        width: 100%;
    }

    .property-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .property-card-img,
    .property-card-img-placeholder {
        height: 180px;
    }

    .gallery {
        grid-template-columns: 1fr;
        grid-template-rows: 200px;
        border-radius: var(--radius-sm);
    }

    .gallery-main {
        grid-row: auto;
    }

    .gallery>*:not(.gallery-main) {
        display: none;
    }

    #calendars {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .calendar-day {
        font-size: .8rem;
    }

    .calendar-day-price {
        font-size: .5rem;
    }

    .booking-widget {
        position: static;
        border-radius: var(--radius-sm);
    }

    .widget-price {
        padding: 16px 18px 12px;
    }

    .widget-body {
        padding: 16px 18px;
    }

    .widget-date-field {
        padding: 8px 10px;
    }

    .widget-date-field input {
        font-size: .82rem;
    }

    .booking-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .booking-summary-card {
        position: static;
        order: -1;
    }

    .booking-summary-img,
    .booking-summary-img-placeholder {
        height: 140px;
    }

    .booking-summary-body {
        padding: 14px 16px;
    }

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

    .form-group {
        margin-bottom: 16px;
    }

    .form-control {
        font-size: .9rem;
        padding: 9px 12px;
    }

    .pay-tabs .pay-tab {
        font-size: .8rem;
        padding: 10px;
        gap: 5px;
    }

    .pay-tabs .pay-tab svg {
        width: 14px;
        height: 14px;
    }

    .btn-lg {
        padding: 13px 20px;
        font-size: .9rem;
    }

    .btn {
        font-size: .85rem;
    }

    .confirmation-card {
        margin: 40px auto;
    }

    .confirmation-ref {
        font-size: .95rem;
        padding: 8px 16px;
    }

    .confirmation-detail-row {
        flex-direction: column;
        gap: 2px;
        padding: 10px 16px;
    }

    .confirmation-detail-row .value {
        font-weight: 700;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: 20px;
    }

    .property-title {
        font-size: 1.4rem;
    }

    .property-location {
        font-size: .85rem;
    }

    .property-section {
        margin-bottom: 28px;
        padding-bottom: 28px;
    }
}