/* ==========================================================================
   Wayfare — Resort & Hotel Booking
   Design tokens
   Color:   ink #17332F | sand #EDE6D5 | paper #FAF7EF | ochre #C4872F
            sea #6E9C8C | line rgba(23,51,47,.14)
   Type:    Display  -> "Fraunces"  (editorial serif, travel-poster feel)
            Body/UI  -> "Public Sans"
            Utility  -> "Space Mono" (prices, dates, refs)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Public+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap");

:root {
    --ink: #17332f;
    --ink-soft: #9fb0a8;
    --sand: rgba(232, 220, 200, 0.12);
    --paper: #faf7ef;
    --ochre: #c4872f;
    --ochre-dark: #a66d1f;
    --sea: #6e9c8c;
    --sea-light: rgba(110, 156, 140, 0.18);
    --line: rgba(250, 247, 239, 0.14);
    --white: #ffffff;
    --danger: #e0604a;
    --bg: #0f2419;
    --surface: #17332f;
    --surface-2: #1f4033;
    --radius: 4px;
    --radius-lg: 10px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--paper);
    font-family:
        "Public Sans",
        -apple-system,
        sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    font-family: "Fraunces", serif;
    font-weight: 600;
    margin: 0 0 0.4em;
    letter-spacing: -0.01em;
}

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

.mono {
    font-family: "Space Mono", monospace;
}

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

:focus-visible {
    outline: 2px solid var(--ochre);
    outline-offset: 2px;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ---------- Header / Nav ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
}

/* Mobile nav toggle (checkbox hack, no JS required) */
.nav-toggle-input {
    display: none;
}
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    cursor: pointer;
    z-index: 41;
}
.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    border-radius: 1px;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: "Fraunces", serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.brand img {
    max-width: 140px;
    height: auto;
    display: block;
}

.brand .stamp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1.5px solid var(--paper);
    border-radius: 50%;
    font-size: 1rem;
    transform: rotate(-6deg);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-links a {
    font-weight: 600;
    font-size: 0.94rem;
    color: white;
}
.nav-links a:hover {
    color: var(--ochre-dark);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1.5px solid var(--paper);
    background: transparent;
    color: var(--paper);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn:hover {
    background: var(--ink);
    color: var(--paper);
}

.btn-primary {
    background: var(--ochre);
    border-color: var(--ochre);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--ochre-dark);
    border-color: var(--ochre-dark);
}

.btn-block {
    width: 100%;
}
.btn-danger-text {
    border: none;
    background: none;
    color: var(--danger);
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
}
.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    background: var(--ink);
    color: var(--paper);
    padding: 32px 0 70px;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at 82% 20%,
            rgba(96, 35, 47, 0.35),
            transparent 45%
        ),
        radial-gradient(
            circle at 8% 90%,
            rgba(10, 56, 40, 0.3),
            transparent 40%
        );
    pointer-events: none;
}

.hero-eyebrow {
    font-family: "Space Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.76rem;
    color: var(--sea);
    margin-bottom: 18px;
    position: relative;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--paper);

    position: relative;
}

.hero h1 em {
    font-style: italic;
    color: var(--ochre);
}

.hero p.lede {
    max-width: 176ch;
    color: rgba(250, 247, 239, 0.78);
    font-size: 1.2rem;
    position: relative;
    margin-top: 14px;
}

/* ---------- Search card ---------- */

.sele {
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 12px;
    background: var(--surface-2);
    color: var(--paper);
}

.search-card {
    position: relative;
    background: var(--surface);
    color: var(--paper);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 22px;
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field label {
    font-family: "Space Mono", monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
}
.field input,
.field select {
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 12px;
    background: var(--surface-2);
    color: var(--paper);
    width: 100%;
}
.field input:focus,
.field select:focus {
    border-color: var(--ochre);
}

/* ---------- Category strip ---------- */

.section {
    padding: 32px 0;
}
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}
.section-head .eyebrow {
    font-family: "Space Mono", monospace;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--ochre-dark);
    display: block;
    margin-bottom: 6px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.category-chip {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 14px;
    text-align: center;
    cursor: pointer;
    background: var(--surface);
    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}
.category-chip:hover {
    transform: translateY(-3px);
    border-color: var(--ochre);
    box-shadow: var(--shadow);
}
.category-chip.active {
    border-color: var(--ochre);
    background: var(--surface-2);
}
.category-chip .icon {
    font-size: 1.7rem;
    display: block;
    margin-bottom: 8px;
}
.category-chip .name {
    font-weight: 700;
    font-size: 0.88rem;
}
.category-chip .count {
    font-family: "Space Mono", monospace;
    font-size: 0.72rem;
    color: var(--ink-soft);
    margin-top: 3px;
}

/* ---------- Filters bar ---------- */

.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-bottom: 30px;
}
.filters-bar select,
.filters-bar input {
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 10px;
    background: var(--surface-2);
    color: var(--paper);
}
.filters-bar .spacer {
    flex: 1;
}
.result-count {
    font-family: "Space Mono", monospace;
    font-size: 0.82rem;
    color: var(--ink-soft);
}

/* ---------- Hotel cards ---------- */

.hotel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.hotel-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
}
.hotel-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hotel-card .thumb {
    height: 190px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.hotel-card .thumb .badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 36, 25, 0.85);
    color: var(--paper);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}
.hotel-card .body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.hotel-card .loc {
    font-size: 0.8rem;
    color: var(--ink-soft);
}
.hotel-card h3 {
    font-size: 1.18rem;
    margin: 0;
}
.hotel-card .amenities {
    font-size: 0.78rem;
    color: var(--ink-soft);
}
.hotel-card .foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}
.hotel-card .price {
    font-family: "Space Mono", monospace;
    font-weight: 700;
    font-size: 1.05rem;
}
.hotel-card .price span {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--ink-soft);
}
.stars {
    color: var(--ochre);
    font-size: 0.85rem;
}

.empty-state,
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-soft);
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 36px;
}
.pagination button {
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--paper);
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: "Space Mono", monospace;
}
.pagination button.active {
    background: var(--ochre);
    color: var(--white);
    border-color: var(--ochre);
}
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Hotel detail page ---------- */

.detail-hero {
    height: 420px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}
.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
}
.detail-hero .info {
    position: relative;
    color: var(--paper);
    padding: 30px 0;
    width: 100%;
}
.detail-hero h1 {
    color: var(--paper);
    font-size: clamp(2rem, 4vw, 2.8rem);
}
.detail-hero .meta {
    display: flex;
    gap: 18px;
    align-items: center;
    font-size: 0.92rem;
    flex-wrap: wrap;
}

.gallery-strip {
    display: flex;
    gap: 10px;
    padding: 14px 0;
    overflow-x: auto;
}
.gallery-strip img {
    height: 90px;
    width: 130px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 40px;
    align-items: start;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 4px;
}
.pill {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    background: var(--sea-light);
}

.room-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: center;
}
.room-card img {
    width: 130px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}
.room-card .r-body {
    flex: 1;
}
.room-card .r-price {
    text-align: right;
    font-family: "Space Mono", monospace;
}
.room-card .r-price .amt {
    font-size: 1.2rem;
    font-weight: 700;
}
.room-card .r-price .per {
    font-size: 0.72rem;
    color: var(--ink-soft);
    display: block;
}

.booking-box {
    position: sticky;
    top: 96px;
    border: 1.5px solid var(--ochre);
    border-radius: var(--radius-lg);
    padding: 22px;
    background: var(--surface);
}
.booking-box h3 {
    margin-bottom: 4px;
}
.booking-box .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}
.booking-box .field input,
.booking-box .field select {
    width: 100%;
}
.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 4px 0;
}
.summary-line.total {
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-family: "Space Mono", monospace;
}
.avail-note {
    font-size: 0.82rem;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
}
.avail-note.ok {
    background: var(--sea-light);
    color: var(--paper);
}
.avail-note.bad {
    background: rgba(224, 96, 74, 0.16);
    color: var(--danger);
}

/* ---------- Modal ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(23, 51, 47, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal {
    background: var(--surface);
    color: var(--paper);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
}
.modal .close-x {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
}
.modal .field {
    margin-bottom: 14px;
}
.modal .field input {
    width: 100%;
}
.tab-switch {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}
.tab-switch button {
    background: none;
    border: none;
    padding: 10px 2px;
    font-weight: 700;
    color: var(--ink-soft);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tab-switch button.active {
    color: var(--paper);
    border-color: var(--ochre);
}
.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 10px;
    min-height: 1.2em;
}

/* ---------- Ticket / confirmation ---------- */

.ticket {
    border: 1.5px dashed var(--ochre);
    border-radius: var(--radius-lg);
    padding: 26px;
    background: var(--surface);
    position: relative;
}
.ticket .ref {
    font-family: "Space Mono", monospace;
    font-size: 1.4rem;
    letter-spacing: 0.05em;
}
.ticket .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 18px;
}
.ticket .grid div span {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    margin-bottom: 4px;
}

/* ---------- Bookings list page ---------- */

.booking-row {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
}
.booking-row img {
    width: 100px;
    height: 76px;
    object-fit: cover;
    border-radius: var(--radius);
}
.status-tag {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}
.status-confirmed {
    background: var(--sea-light);
    color: #8fd9bb;
}
.status-cancelled {
    background: rgba(224, 96, 74, 0.16);
    color: var(--danger);
}
.status-pending {
    background: rgba(196, 135, 47, 0.18);
    color: var(--ochre);
}
.status-completed {
    background: var(--sand);
    color: var(--ink-soft);
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--ink);

    padding: 44px 0;
    margin-top: 60px;
    font-size: 0.86rem;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--paper);
    padding: 12px 22px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
}
.toast.error {
    background: var(--danger);
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
    .container {
        padding: 0 22px;
    }
    .hotel-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .detail-layout {
        grid-template-columns: 1fr;
    }
    .booking-box {
        position: static;
    }
    .search-card {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 18px;
    }
    .brand img {
        max-width: 110px;
    }
    .search-card {
        grid-template-columns: 1fr 1fr;
        padding: 18px;
        margin-top: 28px;
    }
    .hotel-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Collapse nav into a toggleable dropdown */
    .nav-toggle {
        display: flex;
    }
    .nav-links {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        padding: 10px 18px 16px;
        z-index: 39;
        color: var(--paper);
    }
    .nav-links a {
        width: 100%;
        padding: 10px 0;
    }
    .nav-toggle-input:checked ~ .nav-links {
        display: flex;
    }

    .hero {
        padding: 40px 0 70px;
    }
    .hero-eyebrow {
        margin-bottom: 12px;
    }
    .search-card .btn {
        width: 100%;
    }

    .section {
        padding: 40px 0;
    }
    .section-head {
        margin-bottom: 18px;
    }

    .filters-bar {
        gap: 8px;
    }
    .filters-bar select,
    .filters-bar #minPrice,
    .filters-bar #maxPrice {
        flex: 1 1 calc(50% - 8px);
        width: auto !important;
        min-width: 0;
    }
    .filters-bar .spacer {
        display: none;
    }
    .result-count {
        flex-basis: 100%;
    }

    .hotel-card .thumb {
        height: 160px;
    }

    /* Hotel detail page */
    .detail-hero {
        height: 300px;
    }
    .detail-hero .meta {
        gap: 10px;
        font-size: 0.86rem;
    }
    .gallery-strip img {
        height: 70px;
        width: 100px;
    }
    .room-card {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }
    .room-card img {
        width: 100%;
        height: 150px;
    }
    .room-card .r-price {
        text-align: left;
        display: flex;
        align-items: baseline;
        gap: 8px;
        margin-top: 6px;
    }
    .booking-box {
        padding: 18px;
    }
    .booking-box .row {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 22px;
    }

    .ticket {
        padding: 18px;
    }
    .ticket .grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .booking-row {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }
    .booking-row img {
        width: 100%;
        height: 140px;
    }

    .site-footer .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 400px) {
    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ticket .grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
