/* ==========================================================
   REX Stays · holiday villas on the Costa del Sol
   Light, airy layout in the REX palette (forest green, cream, sage)
   ========================================================== */
:root {
  --green: #2A4936;
  --green-soft: #3c5e48;
  --sage: #8A9786;
  --sage-light: #E3E7DF;
  --cream: #FAF3E4;
  --white: #FFFFFF;
  --ink: #2A4936;
  --muted: #6F7A6D;
  --line: #E6E1D4;
  --display: 'Plus Jakarta Sans', 'Helvetica Neue', sans-serif;
  --body: 'Plus Jakarta Sans', 'Helvetica Neue', sans-serif;
  --max: 1180px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--body); font-weight: 300; font-size: 16px; line-height: 1.75; color: var(--ink); background: var(--white); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

h1, h2, h3 { font-family: var(--display); font-weight: 300; line-height: 1.25; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.label { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; }

/* ---------- Top bar ---------- */
.topbar { background: var(--green); color: var(--cream); font-size: 0.72rem; letter-spacing: 0.08em; text-align: center; padding: 7px 16px; }
.topbar a { text-decoration: underline; text-underline-offset: 3px; }
.topbar span { opacity: 0.5; margin: 0 8px; }

/* ---------- Header ---------- */
.site-header { background: var(--white); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 84px; gap: 24px; }
.logo img { height: 46px; width: auto; }
.nav { display: flex; gap: 34px; list-style: none; }
.nav a { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; padding: 6px 0; border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav a:hover, .nav a.active { border-color: var(--green); }
.social { display: flex; gap: 14px; }
.social a { width: 18px; height: 18px; color: var(--green); opacity: .8; }
.social a:hover { opacity: 1; }
.social svg { width: 18px; height: 18px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 30px; height: 22px; position: relative; }
.nav-toggle span { position: absolute; left: 0; right: 0; height: 2px; background: var(--green); transition: .25s; }
.nav-toggle span:nth-child(1) { top: 0; } .nav-toggle span:nth-child(2) { top: 10px; } .nav-toggle span:nth-child(3) { top: 20px; }

/* ---------- Hero with search ---------- */
.hero { position: relative; min-height: 78vh; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--white); overflow: hidden; }
.hero picture, .hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,38,27,.25), rgba(20,38,27,.35)); }
.hero-inner { position: relative; z-index: 2; padding: 80px 20px; width: 100%; }
.hero h1 { font-size: clamp(1.4rem, 3.2vw, 2.3rem); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; text-shadow: 0 2px 18px rgba(0,0,0,.35); margin-bottom: 30px; }

.search { display: flex; justify-content: center; align-items: stretch; gap: 8px; flex-wrap: wrap; max-width: 760px; margin: 0 auto; }
.search .field { background: var(--white); color: var(--ink); display: flex; flex-direction: column; text-align: left; padding: 8px 16px; min-width: 150px; flex: 1; }
.search label { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.search input, .search select { border: 0; background: transparent; font: inherit; font-size: 0.92rem; font-weight: 400; color: var(--ink); padding: 2px 0; outline: none; width: 100%; }
.search button { background: var(--green); color: var(--white); border: 0; padding: 0 30px; font: inherit; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; min-height: 52px; display: inline-flex; align-items: center; gap: 10px; transition: background .2s; }
.search button:hover { background: var(--green-soft); }
.search button svg { width: 16px; height: 16px; }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.intro { text-align: center; }
.intro h2 { color: var(--green); max-width: 720px; margin: 0 auto 22px; }
.intro p { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: 0.95rem; }

.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 64px; text-align: center; }
.service svg { width: 46px; height: 46px; stroke: var(--sage); margin: 0 auto 18px; }
.service h3 { font-size: 1.05rem; font-weight: 400; margin-bottom: 8px; }
.service p { font-size: 0.88rem; color: var(--muted); max-width: 290px; margin: 0 auto 22px; }

.btn { display: inline-block; background: var(--green); color: var(--white); padding: 13px 28px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; border: 1px solid var(--green); cursor: pointer; transition: background .2s, color .2s; font-family: inherit; }
.btn:hover { background: var(--green-soft); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,.8); }
.btn-outline:hover { background: var(--white); color: var(--green); }
.btn-light { background: var(--cream); color: var(--green); border-color: var(--cream); }
.btn-light:hover { background: var(--white); }

/* ---------- Featured villas (sage band) ---------- */
.featured { background: var(--sage); color: var(--white); }
.featured h2 { text-align: center; padding-bottom: 26px; margin-bottom: 52px; border-bottom: 1px solid rgba(255,255,255,.35); }
.villa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.villa-card { position: relative; display: block; }
.villa-card .photo { overflow: hidden; aspect-ratio: 4/3; }
.villa-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.villa-card:hover img { transform: scale(1.04); }
.villa-card .info { position: relative; margin: -46px 18px 0; background: rgba(250,243,228,.94); color: var(--ink); padding: 18px 22px 20px; }
.villa-card h3 { font-size: 1.3rem; font-weight: 300; margin-bottom: 4px; }
.villa-card .meta { font-size: 0.74rem; color: var(--muted); line-height: 1.6; }
.villa-card .more { display: inline-block; margin-top: 10px; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--green); border-bottom: 1px solid var(--green); }
.featured .center { text-align: center; margin-top: 56px; }

/* ---------- Book direct ---------- */
.direct { background: var(--cream); }
.direct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 46px; margin-top: 56px; }
.direct-grid div { border-top: 1px solid var(--green); padding-top: 22px; }
.direct-grid h3 { font-size: 1.05rem; font-weight: 500; margin-bottom: 8px; }
.direct-grid p { font-size: 0.9rem; color: var(--muted); }

/* ---------- Discover ---------- */
.discover-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 52px; }
.tile { position: relative; aspect-ratio: 4/5; overflow: hidden; color: var(--white); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.tile:hover img { transform: scale(1.04); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(20,38,27,.75)); }
.tile .txt { position: absolute; left: 24px; right: 24px; bottom: 22px; z-index: 2; }
.tile h3 { font-size: 1.25rem; font-weight: 400; margin-bottom: 4px; }
.tile p { font-size: 0.84rem; opacity: .9; }

/* ---------- Owners band ---------- */
.owners-band { background: var(--green); color: var(--cream); text-align: center; }
.owners-band h2 { margin-bottom: 16px; }
.owners-band p { max-width: 560px; margin: 0 auto 30px; opacity: .85; font-size: 0.95rem; }

/* ---------- Page hero (subpages) ---------- */
.page-hero { position: relative; color: var(--white); text-align: center; padding: 120px 20px 110px; background-size: cover; background-position: center; }
.page-hero::before { content: ""; position: absolute; inset: 0; background: rgba(20,38,27,.45); }
.page-hero > * { position: relative; }
.page-hero h1 { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 26px; }

/* ---------- Villas list ---------- */
.list-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.list-head p { color: var(--muted); font-size: 0.9rem; }
.villa-list .villa-card .info { background: var(--cream); }
.empty { display: none; text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Villa detail ---------- */
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 240px 240px; gap: 8px; }
.gallery a { overflow: hidden; display: block; }
.gallery a:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery a:hover img { transform: scale(1.03); }
.detail { display: grid; grid-template-columns: 1.6fr 1fr; gap: 64px; padding-top: 56px; }
.detail h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); color: var(--green); margin-bottom: 6px; }
.detail .where { color: var(--muted); font-size: 0.9rem; margin-bottom: 26px; }
.facts { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.facts div { padding: 16px 26px 16px 0; margin-right: 26px; font-size: 0.86rem; }
.facts strong { display: block; font-size: 1.2rem; font-weight: 400; }
.detail h2 { font-size: 1.3rem; margin: 40px 0 14px; color: var(--green); }
.detail p { margin-bottom: 14px; }
.amenities { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 30px; }
.amenities li { padding-left: 24px; position: relative; font-size: 0.94rem; }
.amenities li::before { content: ""; position: absolute; left: 0; top: 10px; width: 12px; height: 7px; border-left: 1.5px solid var(--sage); border-bottom: 1.5px solid var(--sage); transform: rotate(-45deg); }
.rules { background: var(--cream); padding: 22px 26px; font-size: 0.92rem; }
.rules li { margin-left: 18px; }

.book-box { position: sticky; top: 110px; border: 1px solid var(--line); padding: 30px; background: var(--white); box-shadow: 0 24px 50px -34px rgba(42,73,54,.45); align-self: start; }
.book-box h3 { font-size: 1.2rem; font-weight: 400; margin-bottom: 4px; }
.book-box .sub { font-size: 0.82rem; color: var(--muted); margin-bottom: 20px; }
.book-box .row { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.book-box .f { padding: 10px 14px; display: flex; flex-direction: column; }
.book-box .row .f:first-child { border-right: 1px solid var(--line); }
.book-box .f + .f { }
.book-box .full { border: 1px solid var(--line); border-top: 0; }
.book-box label { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.book-box input, .book-box select, .book-box textarea { border: 0; font: inherit; font-size: 0.92rem; font-weight: 400; color: var(--ink); background: transparent; outline: none; padding: 2px 0; width: 100%; resize: vertical; }
.book-box .summary { font-size: 0.86rem; color: var(--muted); margin: 14px 0 0; min-height: 1.4em; }
.book-box .summary.error { color: #9b3b2e; }
.book-box .btn { width: 100%; margin-top: 18px; text-align: center; }
.book-box .alt { display: block; text-align: center; margin-top: 12px; font-size: 0.82rem; color: var(--muted); }
.book-box .alt a { color: var(--green); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.book-box .channels { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--muted); text-align: center; }
.book-box .channels a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.footer { background: var(--green); color: rgba(250,243,228,.85); padding: 72px 0 34px; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; }
.footer img { height: 46px; width: auto; margin-bottom: 18px; }
.footer h4 { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream); margin-bottom: 16px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; }
.footer a:hover { color: var(--white); }
.footer-bottom { margin-top: 52px; padding-top: 22px; border-top: 1px solid rgba(250,243,228,.18); font-size: 0.76rem; opacity: .7; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.wa-float { position: fixed; right: 22px; bottom: 22px; width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 60; }
.wa-float svg { width: 30px; height: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .villa-grid, .services, .direct-grid, .discover-grid { grid-template-columns: 1fr 1fr; }
  .detail { grid-template-columns: 1fr; gap: 40px; }
  .book-box { position: static; }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .social { display: none; }
  .nav { position: fixed; inset: 84px 0 auto 0; background: var(--white); flex-direction: column; gap: 0; padding: 10px 28px 26px; border-bottom: 1px solid var(--line); transform: translateY(-140%); transition: transform .3s; z-index: 40; }
  .nav.open { transform: none; }
  .nav a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 140px 140px; }
  .gallery a:first-child { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 640px) {
  section { padding: 68px 0; }
  .topbar .hide-sm { display: none; }
  .villa-grid, .services, .direct-grid, .discover-grid, .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: 88vh; }
  .search { flex-direction: column; }
  .search .field { min-width: 0; }
  .search button { justify-content: center; }
  .amenities { grid-template-columns: 1fr; }
}
