/* ==========================================================================
   Wayanad Stays — Public theme
   Mobile-first, premium Wayanad travel design.
   ========================================================================== */

:root {
    /* Brand palette */
    --green-900: #0f2e21;
    --green-800: #14402e;
    --green-700: #1b5e3f;
    --green-600: #22794f;
    --green-500: #2e9b66;
    --green-100: #e4f2ea;
    --gold: #c8912f;
    --gold-soft: #e7c983;

    --ink: #17231d;
    --ink-soft: #45564d;
    --muted: #6b7a72;
    --line: #e6ece8;
    --bg: #faf8f3;          /* warm white */
    --card: #ffffff;
    --danger: #c0392b;
    --success: #1b7a4b;
    --info: #2b6cb0;

    /* Typography */
    --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    --font-display: "Fraunces", "Georgia", "Times New Roman", serif;
    --fs-1: clamp(2rem, 5vw, 3.2rem);
    --fs-2: clamp(1.5rem, 3.5vw, 2.2rem);
    --fs-3: clamp(1.2rem, 2.5vw, 1.5rem);
    --fs-body: 1rem;
    --fs-sm: 0.875rem;
    --fs-xs: 0.78rem;

    /* Radius */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-pill: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 46, 33, 0.06), 0 2px 6px rgba(15, 46, 33, 0.05);
    --shadow-md: 0 6px 18px rgba(15, 46, 33, 0.08);
    --shadow-lg: 0 18px 40px rgba(15, 46, 33, 0.14);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* Layout */
    --header-h: 68px;
    --mobile-cta-h: 72px;
    --container: 1180px;
    --container-narrow: 820px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-h);
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: var(--fs-1); }
h2 { font-size: var(--fs-2); }
h3 { font-size: var(--fs-3); }

a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-600); }

img { max-width: 100%; display: block; }

/* ==========================================================================
   Global mobile overflow safety (root-cause guards)
   - overflow-x: clip contains stray overflow WITHOUT creating a scroll
     container (so position: sticky keeps working, unlike overflow: hidden).
   - Media never exceeds its container.
   - Long words/URLs wrap instead of forcing width.
   - Grid/flex children may shrink below their intrinsic content size.
   ========================================================================== */
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
body { overflow-wrap: break-word; }
img, svg, video, iframe { max-width: 100%; }
img, video { height: auto; }
iframe { border: 0; }
h1, h2, h3, h4, p, a, span, li { overflow-wrap: break-word; }

/* Any grid/flex layout child is allowed to shrink (prevents horizontal push) */
.grid > *, .grid-props > *, .footer-grid > *,
.u-grid-2 > *, .u-grid-3 > *, .u-grid-4 > *, .u-grid-auto > *,
.home-cats > *, .home-locs > *, .home-cta__actions > *,
.listing__grid > *, .pdetail__related > *, .pdetail__specs > *, .pamenity-list > * {
    min-width: 0;
}
.card, .ds-card { min-width: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
.container-narrow { max-width: var(--container-narrow); }

@media (max-width: 359.98px) {
    .container, .ds-container { padding-inline: 14px; }
}

/* Utilities previously provided by Bootstrap (now self-hosted) */
.d-none { display: none !important; }
.d-block { display: block !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Inline alerts (enquiry + contact feedback) */
.alert { padding: .75rem 1rem; border-radius: var(--r-sm); font-size: var(--fs-sm); margin: 0 0 var(--space-3); border: 1px solid transparent; }
.alert-danger { background: #fbe6e3; color: #b23b2e; border-color: #eabbb4; }
.alert-success { background: #e3f3ea; color: #1b7a4b; border-color: #b6ddc6; }
.alert-info { background: #e5eefb; color: #22568f; border-color: #bcd2f0; }

.section { padding: var(--space-7) 0; }
.section-tight { padding: var(--space-6) 0; }

.text-muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: var(--fs-xs); font-weight: 700; color: var(--green-600); }

/* Skip link */
.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 2000;
    background: var(--green-700); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* Focus visibility */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: var(--r-sm); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: var(--font-sans); font-weight: 600; font-size: var(--fs-body);
    padding: .8rem 1.4rem; border-radius: var(--r-pill); border: 1.5px solid transparent;
    cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    min-height: 46px; line-height: 1; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-600); color: #fff; box-shadow: var(--shadow-md); }
.btn-gold { background: var(--gold); color: #1c1403; }
.btn-gold:hover { background: var(--gold-soft); color: #1c1403; }
.btn-whatsapp { background: #25D366; color: #063a1c; }
.btn-whatsapp:hover { background: #1ebe5b; color: #063a1c; }
.btn-outline { background: transparent; border-color: var(--green-700); color: var(--green-700); }
.btn-outline:hover { background: var(--green-700); color: #fff; }
.btn-light { background: #fff; color: var(--green-800); border-color: var(--line); }
.btn-light:hover { box-shadow: var(--shadow-sm); }
.btn-block { width: 100%; }
.btn-sm { padding: .5rem .9rem; min-height: 38px; font-size: var(--fs-sm); }

/* ---- Header ---- */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: var(--header-h);
    background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--green-800); }
.brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--green-700), var(--green-500)); display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.brand small { display: block; font-family: var(--font-sans); font-weight: 500; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.nav-desktop { display: none; align-items: center; gap: var(--space-5); }
.nav-desktop a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.nav-desktop a:hover, .nav-desktop a.active { color: var(--green-700); }

.nav-toggle { display: inline-flex; flex-direction: column; gap: 5px; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }

/* Off-canvas mobile menu */
.mobile-nav { position: fixed; inset: 0; z-index: 1100; visibility: hidden; }
.mobile-nav[aria-hidden="false"] { visibility: visible; }
.mobile-nav__overlay { position: absolute; inset: 0; background: rgba(15,46,33,.45); opacity: 0; transition: opacity .25s ease; }
.mobile-nav[aria-hidden="false"] .mobile-nav__overlay { opacity: 1; }
.mobile-nav__panel {
    position: absolute; top: 0; right: 0; height: 100%; width: min(84%, 340px);
    background: #fff; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .28s ease;
    display: flex; flex-direction: column; padding: var(--space-5);
}
.mobile-nav[aria-hidden="false"] .mobile-nav__panel { transform: translateX(0); }
.mobile-nav__panel a { padding: .85rem .25rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.mobile-nav__close { align-self: flex-end; background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink); }

/* ---- Hero ---- */
.hero { position: relative; border-radius: 0; overflow: hidden; }
.hero__inner { position: relative; padding: var(--space-8) 0; }
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,46,33,.55), rgba(15,46,33,.78)); }
.hero { color: #fff; }
.hero h1 { color: #fff; max-width: 16ch; }
.hero p { color: rgba(255,255,255,.9); font-size: 1.1rem; max-width: 46ch; }
.hero .hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }

/* Search bar in hero */
.hero-search { margin-top: var(--space-6); background: #fff; border-radius: var(--r-lg); padding: var(--space-4); box-shadow: var(--shadow-lg); display: grid; gap: var(--space-3); }
.hero-search .field { display: flex; flex-direction: column; gap: 4px; }
.hero-search label { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.hero-search select, .hero-search input { padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-body); background: #fff; color: var(--ink); }

/* ---- Category chips (swipeable) ---- */
.chip-row { display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-2) 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem;
    padding: .55rem 1rem; border-radius: var(--r-pill); border: 1.5px solid var(--line);
    background: #fff; color: var(--ink-soft); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap;
    transition: .15s;
}
.chip:hover { border-color: var(--green-500); color: var(--green-700); }
.chip.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* ---- Property grid & cards ---- */
.grid { display: grid; gap: var(--space-4); }
.grid-props { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid-props { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); } }
@media (min-width: 900px) { .grid-props { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1140px) { .grid-props { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
    background: var(--card); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; height: 100%;
    border: 1px solid var(--line);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--green-100); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: .25rem .55rem; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; }
.badge-featured { background: var(--gold); color: #241900; }
.badge-verified { background: var(--green-700); color: #fff; }
.badge-avail { position: absolute; bottom: 8px; left: 8px; background: rgba(255,255,255,.95); color: var(--green-800); }
.badge-avail.limited { color: #a15c00; }
.badge-avail.on_request { color: var(--info); }
.badge-avail.sold_out, .badge-avail.unavailable { color: var(--danger); }

.card__body { padding: var(--space-3) var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__title { font-family: var(--font-sans); font-weight: 700; font-size: 1rem; margin: 0; line-height: 1.3; }
.card__title a { color: var(--ink); }
.card__loc { font-size: var(--fs-sm); color: var(--muted); display: flex; align-items: center; gap: 4px; }
.card__meta { display: flex; align-items: center; gap: .75rem; font-size: var(--fs-xs); color: var(--ink-soft); margin-top: 2px; }
.card__foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; padding-top: var(--space-2); }
.card__price { font-weight: 800; color: var(--green-800); font-size: 1.05rem; }
.card__price small { display: block; font-weight: 500; color: var(--muted); font-size: var(--fs-xs); }
.rating { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-sm); font-weight: 700; color: var(--gold); }

@media (max-width: 380px) {
    .card__title { font-size: .92rem; }
    .card__body { padding: var(--space-2) var(--space-3) var(--space-3); }
}

/* Section headers */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: var(--space-5); }
.section-head p { margin: .25rem 0 0; color: var(--muted); }
.section-head a { font-weight: 600; white-space: nowrap; }

/* ---- Filters panel ---- */
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--space-4); box-shadow: var(--shadow-sm); }
.filters .field { margin-bottom: var(--space-3); }
.filters label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 4px; }
.filters select, .filters input { width: 100%; padding: .6rem .7rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.amenity-check { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: var(--fs-sm); }

/* ---- Empty state ---- */
.empty { text-align: center; padding: var(--space-8) var(--space-4); color: var(--muted); }
.empty__icon { font-size: 2.5rem; margin-bottom: .5rem; }

/* ---- Contact page ---- */
.contact-intro { text-align: center; max-width: 620px; margin: 0 auto var(--space-6); }
.contact-intro h1 { margin-bottom: var(--space-3); }
.contact-intro p { margin: 0; }
.contact-layout { display: grid; grid-template-columns: 1fr; gap: var(--space-5); align-items: start; }
@media (min-width: 860px) { .contact-layout { grid-template-columns: 1.5fr 1fr; } }
.contact-aside { display: grid; gap: var(--space-5); align-items: start; }
.contact-card-title { font-family: var(--font-sans); font-size: 1.2rem; font-weight: 700; margin: 0 0 var(--space-4); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
@media (min-width: 520px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field-row .field { margin-bottom: 0; min-width: 0; }
.contact-info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.contact-info-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; }
.contact-info-row__ic { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--green-100); display: grid; place-items: center; font-size: 1.1rem; }
.contact-info-row a { color: var(--ink); font-weight: 600; }
.contact-info-row a:hover { color: var(--green-700); }

/* ---- Footer ---- */
.site-footer { background: var(--green-900); color: #d8e6dd; margin-top: var(--space-8); }
.site-footer a { color: #cfe3d8; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-5); padding: var(--space-7) 0 var(--space-5); }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-grid h4 { color: #fff; font-family: var(--font-sans); font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: var(--space-4) 0; font-size: var(--fs-sm); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }

/* ---- Breadcrumb ---- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; font-size: var(--fs-sm); color: var(--muted); padding: var(--space-4) 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--green-700); }

/* ---- Pagination ---- */
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: var(--space-6); flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center; padding: 0 .6rem; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-weight: 600; }
.pagination .current { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.pagination .disabled { opacity: .45; pointer-events: none; }

/* ---- Nav desktop breakpoint ---- */
@media (min-width: 900px) {
    .nav-desktop { display: flex; }
    .nav-toggle { display: none; }
}

/* ---- Utility ---- */
.d-none { display: none !important; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.wrap { flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
