:root {
  --brand-50: #f4f7f4;
  --brand-100: #e3ebe2;
  --brand-200: #c7d7c6;
  --brand-300: #9fbb9d;
  --brand-400: #6f9a6d;
  --brand-500: #4d7d4b;
  --brand-600: #3a6338;
  --brand-700: #2f4f2e;
  --brand-800: #284027;
  --brand-900: #223622;
  --sand: #e8e1d3;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --red-400: #f87171;
  --red-600: #dc2626;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff url('/logo-watermark.png') no-repeat center 80px;
  background-size: min(42rem, 85vw) auto;
  background-attachment: fixed;
  color: var(--brand-900);
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden; /* safety net: nothing should ever force a horizontal scrollbar/overlap */
}

a { color: inherit; }

img, svg { max-width: 100%; height: auto; }

.container { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.container-md { max-width: 56rem; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 32rem; margin: 0 auto; padding: 0 1rem; }

.section { padding: 3rem 0; text-align: center; }
.section-sm { padding: 2.25rem 0; text-align: center; }

.card {
  border: 1px solid var(--brand-200);
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  background: #fff;
}

.pinterest-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #fff 0%, var(--brand-50) 100%);
  border-color: var(--brand-200);
}
.pinterest-banner h3 { margin: 0 0 0.35rem; }
.pinterest-banner p { margin: 0; }
.pinterest-banner .btn { white-space: nowrap; }

.btn {
  display: inline-block;
  background: var(--brand-600);
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover { background: var(--brand-700); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary { background: var(--brand-100); color: var(--brand-800); }
.btn-secondary:hover { background: var(--brand-200); }
.btn-danger { background: var(--red-600); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-pdf { background: #a87c5c; }
.btn-pdf:hover { background: #8f6748; }

.row-actions { display: flex; flex-direction: column; align-items: stretch; gap: 0.4rem; min-width: 9rem; }

.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-100);
  color: var(--brand-500);
  font-size: 0.875rem;
  font-weight: 500;
}

h1, h2, h3 { color: var(--brand-900); line-height: 1.2; }
h2 { font-size: 1.875rem; margin-bottom: 1.15rem; }

.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;
}

label { display: block; font-weight: 500; margin-bottom: 0.25rem; }
input, select, textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--brand-200);
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 1rem;
}
input[type="radio"], input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: none;
}

.required-mark { color: var(--red-600); }

input.invalid, select.invalid, textarea.invalid {
  border-color: var(--red-600);
  background: #fef2f2;
}

input[type="date"] { color: var(--brand-300); }
input[type="date"].has-value { color: var(--brand-900); }

/* Editable date fields in the admin portal (invoice dates, booking stay dates) —
   always shown dark (not the pale "no value chosen yet" placeholder color the public
   booking form uses), with a tinted background and dashed border as a visual cue that
   they're click-to-edit rather than plain read-only text. */
input[type="date"].editable-date {
  color: var(--brand-900);
  background: var(--brand-50);
  border: 1px dashed var(--brand-400);
}
input[type="date"].editable-date:hover,
input[type="date"].editable-date:focus {
  border-style: solid;
  border-color: var(--brand-600);
  background: #fff;
}

.unit-option {
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 28rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--brand-200);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.unit-option:hover { border-color: var(--brand-400); }
.unit-option.selected { border-color: var(--brand-600); background: var(--brand-50); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-400);
  outline-offset: 1px;
}
.field { margin-bottom: 0.85rem; }

/* Compact inputs for the invoice-review modal specifically — it already packs 6+
   fields plus a live preview into one popup, so the site-wide input padding/font-size
   (sized for comfortable public-site typing) just wastes vertical space here. */
#invoice-modal .field { margin-bottom: 0.6rem; }
#invoice-modal .field label { margin-bottom: 0.15rem; font-size: 0.85rem; }
#invoice-modal input, #invoice-modal textarea {
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
}

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: #fff; border-bottom: 1px solid var(--brand-100);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
.site-header .logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; text-decoration: none; min-width: 0; }
.site-header .logo img { height: 4.25rem; width: auto; flex-shrink: 0; }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.5rem; }
.site-header nav a:not(.btn) { text-decoration: none; color: var(--brand-800); font-weight: 500; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 2.25rem; height: 2.25rem; background: none; border: none; cursor: pointer; padding: 0;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--brand-800); border-radius: 1px; }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-header nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--brand-100);
    box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  }
  .site-header nav.open { display: flex; }
  .site-header nav a { padding: 0.9rem 1.25rem; border-top: 1px solid var(--brand-100); }
  .site-header nav a.btn { margin: 0.75rem 1.25rem; text-align: center; }
}

/* Hero */
.hero { padding: 2.25rem 0; text-align: center; }
.hero img { max-height: 28rem; margin-bottom: 0.85rem; }
.hero p { max-width: 42rem; margin: 0.85rem auto 0; color: var(--brand-700); }

/* Unit cards */
.unit-card { overflow: hidden; }
.unit-card .unit-images { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; height: 12rem; }
.unit-card .unit-images img, .unit-card .unit-images .img-placeholder { width: 100%; height: 100%; object-fit: cover; }
.unit-card .unit-body { padding: 1rem; text-align: center; }
.unit-card .unit-price { font-size: 1.25rem; font-weight: 700; color: var(--brand-700); }
.fx-approx { display: block; font-size: 0.8rem; font-weight: 400; color: var(--brand-400); }
.visitor-flag-badge {
  display: inline-flex; align-items: center; gap: 0.45rem; margin: 0 auto 0.85rem; padding: 0.35rem 0.85rem;
  background: var(--brand-50); border: 1px solid var(--brand-200); border-radius: 999px;
  font-size: 0.85rem; color: var(--brand-700);
}
.visitor-flag-badge .flag-icon { border-radius: 2px; flex-shrink: 0; }
.fx-disclaimer { max-width: 36rem; margin: 0 auto 1.25rem; font-size: 0.75rem; color: var(--brand-400); }

.unit-carousel { position: relative; height: 22rem; background: var(--brand-100); overflow: hidden; }
.unit-carousel .carousel-slides { position: relative; width: 100%; height: 100%; }
.unit-carousel .carousel-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.unit-carousel .carousel-slide.active { opacity: 1; pointer-events: auto; }
.unit-carousel .carousel-arrow,
.photo-lightbox-box .carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.45); color: #fff; border: none; width: 2rem; height: 2rem;
  border-radius: 50%; cursor: pointer; font-size: 0.9rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.unit-carousel .carousel-arrow:hover,
.photo-lightbox-box .carousel-arrow:hover { background: rgba(0,0,0,0.65); }
.unit-carousel .carousel-prev, .photo-lightbox-box .carousel-prev { left: 0.5rem; }
.unit-carousel .carousel-next, .photo-lightbox-box .carousel-next { right: 0.5rem; }
.unit-carousel .carousel-dots,
.photo-lightbox-box .carousel-dots {
  position: absolute; bottom: 0.5rem; left: 0; right: 0;
  display: flex; justify-content: center; gap: 0.4rem; z-index: 2;
}
.unit-carousel .carousel-dot,
.photo-lightbox-box .carousel-dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.6);
  cursor: pointer; border: 1px solid rgba(0,0,0,0.2);
}
.unit-carousel .carousel-dot.active,
.photo-lightbox-box .carousel-dot.active { background: #fff; }
.unit-carousel .carousel-slide { cursor: zoom-in; }
.unit-carousel .carousel-expand {
  position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2;
  background: rgba(0,0,0,0.45); color: #fff; border: none; width: 2rem; height: 2rem;
  border-radius: 50%; cursor: pointer; font-size: 0.95rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.unit-carousel .carousel-expand:hover { background: rgba(0,0,0,0.65); }
.unit-carousel .carousel-expand::before {
  content: ""; display: block; width: 12px; height: 12px;
  background:
    linear-gradient(#fff,#fff) top left / 6px 2px no-repeat,
    linear-gradient(#fff,#fff) top left / 2px 6px no-repeat,
    linear-gradient(#fff,#fff) top right / 6px 2px no-repeat,
    linear-gradient(#fff,#fff) top right / 2px 6px no-repeat,
    linear-gradient(#fff,#fff) bottom left / 6px 2px no-repeat,
    linear-gradient(#fff,#fff) bottom left / 2px 6px no-repeat,
    linear-gradient(#fff,#fff) bottom right / 6px 2px no-repeat,
    linear-gradient(#fff,#fff) bottom right / 2px 6px no-repeat;
}

/* Full-screen photo lightbox (public site) */
.photo-lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
/* Fixed-size viewing area — same box regardless of each photo's own dimensions,
   so switching photos never changes the size of the frame. */
.photo-lightbox-box {
  position: relative;
  width: min(90vw, 64rem);
  height: min(85vh, 40rem);
  background: #000;
  border-radius: 0.5rem;
  overflow: hidden;
}
.photo-lightbox-box img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  display: block;
}
.photo-lightbox-close {
  position: absolute; top: -2.5rem; right: 0; background: none; border: none;
  color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; padding: 0.25rem;
  z-index: 3;
}

/* Reviews */
.review-card { padding: 0.6rem 0.85rem; font-size: 0.8rem; }
.review-card .star { font-size: 0.78rem; }
.review-card p { margin: 0.3rem 0; }
.review-card p:last-child {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.star { color: var(--amber-500); }
.star.empty { color: var(--brand-200); }

/* Footer */
.site-footer { background: var(--brand-900); color: var(--brand-100); margin-top: 1.5rem; }
.site-footer .container { padding: 2.25rem 1rem; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 260px)); justify-content: center; text-align: center; }
.site-footer iframe { max-width: 100%; }
.site-footer a { text-decoration: none; color: var(--brand-100); }
.site-footer a:hover { text-decoration: underline; }
.site-footer .bottom-bar { border-top: 1px solid var(--brand-800); padding: 0.85rem; text-align: center; font-size: 0.875rem; }

/* Calendar */
.calendar { padding: 1.15rem; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.85rem; }
.calendar-header strong { font-size: 1.15rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: left; }
.calendar-grid .day-label { font-size: 0.85rem; font-weight: 600; color: var(--brand-500); padding: 0.25rem; text-align: center; }
.calendar-grid .day {
  min-height: 5.25rem;
  min-width: 0;
  padding: 0.3rem;
  font-size: 0.8rem;
  border-radius: 0.375rem;
  border: 1px solid var(--brand-100);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.calendar-grid .day-empty { border: none; background: transparent; }
.calendar-grid .day-past { background: var(--brand-50); color: var(--brand-300); border-color: var(--brand-100); }
.calendar-grid .day-past .day-number { color: var(--brand-300); }
.calendar-grid .day-number { font-weight: 600; font-size: 0.9rem; margin-bottom: 1px; }
.calendar-grid .unit-bars { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calendar-grid .unit-bar {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 1px 4px;
  border-radius: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.calendar-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; font-size: 1rem; margin-top: 0.9rem; color: var(--brand-700); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 18px; height: 18px; border-radius: 4px; display: inline-block; }

@media (max-width: 640px) {
  .calendar-grid .day { min-height: 4.25rem; }
  .calendar-grid .unit-bar { font-size: 0.62rem; }
}

/* Booking confirmation modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem;
}
/* overflow-y:auto directly on a rounded box makes the scrollbar sit flush against
   that side's edge, flattening its corners whenever the content actually scrolls —
   scrolling instead happens in .modal-box-body (flex child, its own overflow-y), so
   .modal-box only ever clips to its own border-radius. */
.modal-box {
  background: #fff; border-radius: 0.5rem; max-width: 32rem; width: 100%; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column;
}
.modal-box-body { padding: 1.25rem; overflow-y: auto; min-height: 0; }

/* Scroll to top */
#scroll-top-btn {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--brand-600); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); font-size: 1.25rem; display: none;
}
#scroll-top-btn.visible { display: block; }

.notice { padding: 0.85rem; border-radius: 0.375rem; margin-bottom: 0.85rem; }
.notice-info { background: var(--brand-50); border: 1px solid var(--brand-200); }
.notice-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.notice-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.notice-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.notice-payment { background: #fef2f2; border: 1px solid var(--red-400); color: #7f1d1d; }
.notice-payment h3 { color: var(--red-600); }
.notice-payment a { color: #b91c1c; font-weight: 600; }

/* Booking platform badges — used anywhere a booking's source needs to be distinguished
   (admin dashboard, admin bookings page, supervisor portal). Booking.com's badge uses
   their own brand blue; Airbnb's uses their own brand pink/magenta. */
.platform-badge { display: inline-block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.15rem 0.5rem; border-radius: 999px; vertical-align: middle; white-space: nowrap; }
.platform-badge.platform-direct { background: var(--brand-100); color: var(--brand-700); }
.platform-badge.platform-airbnb { background: #ffe8ec; color: #c13584; }
.platform-badge.platform-booking-com { background: #e3f2fd; color: #003b95; }

/* Generic "Upcoming (open) / Past (collapsed)" <details> section pattern, reused by
   Admin → Manual Date Block Out, Admin → Bookings (Past Bookings), and the OTA
   guest-details list (Past OTA Bookings). */
.blocks-section-heading {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0 0 0.75rem; padding-bottom: 0.5rem; min-height: 1.4em; box-sizing: content-box;
  border-bottom: 2px solid var(--brand-200);
  font-size: 1.05rem; font-weight: 700; color: var(--brand-800);
}
summary.blocks-section-heading::marker { content: ""; display: none; }
.blocks-past-details { margin: 0; padding: 0; }
.blocks-past-details + .blocks-past-details { margin-top: 1.5rem; }
summary.blocks-section-heading {
  cursor: pointer; list-style: none; margin-top: 0;
}
summary.blocks-section-heading::-webkit-details-marker { display: none; }
summary.blocks-section-heading::before {
  content: "\25B8"; color: var(--brand-500); font-size: 1.4em; line-height: 1; transition: transform 0.15s;
}
.blocks-past-details[open] summary.blocks-section-heading::before { transform: rotate(90deg); }
.blocks-count {
  background: var(--brand-100); color: var(--brand-700); font-size: 0.75rem; font-weight: 600;
  padding: 0.1rem 0.5rem; border-radius: 999px;
}

/* Every red notice (errors + payment warnings) flashes boldly to draw the eye, site-wide
   — same style as the admin dashboard's Low Stock Alert. */
.notice-error, .notice-payment {
  animation: notice-flash 1.2s infinite;
  border-width: 2px;
}
@keyframes notice-flash {
  0%, 100% { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.35); }
  50% { border-color: #fecaca; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Same red-flash treatment as .notice-error, for inline text with no box around it
   (e.g. a short "needs attention" label inside a <summary>). */
.text-flash-red {
  animation: text-flash-red 1.2s infinite;
  font-weight: 600;
}
@keyframes text-flash-red {
  0%, 100% { color: #dc2626; }
  50% { color: #fecaca; }
}

/* A small flashing inline icon/badge drawing attention to something worth a second
   look without being a full alert (e.g. "this booking has notes") — pulses opacity
   rather than color, so it works regardless of the icon/text it's wrapping. */
.flash-icon { display: inline-block; animation: icon-flash 1.2s infinite; }
@keyframes icon-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* FAQ accordion */
.faq-list { text-align: left; }
.faq-list details {
  border: 1px solid var(--brand-200); border-radius: 0.5rem;
  padding: 0.7rem 1rem; margin-bottom: 0.5rem; background: #fff;
}
.faq-list summary {
  cursor: pointer; font-weight: 600; color: var(--brand-900);
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; float: right; color: var(--brand-500); font-weight: 700; }
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p { margin: 0.6rem 0 0; color: var(--brand-700); }

/* Cookie consent banner */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: var(--brand-900); color: #fff; padding: 1rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem;
  font-size: 0.9rem;
}
.cookie-banner p { margin: 0; max-width: 40rem; }
.cookie-banner .btn { flex-shrink: 0; }
