:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --brand: #e8590c;
  --brand-dark: #c94a08;
  --accent: #0e7490;
  --line: #e5e0d8;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

header.site {
  position: relative;
  background: linear-gradient(135deg, #f59f00 0%, var(--brand) 60%, #d6336c 130%);
  color: #fff;
  padding: 2.2rem 1.5rem 2.6rem;
}

.lang-picker {
  position: absolute; top: 0.8rem; right: 0.9rem;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  overflow: hidden;
}
.lang-picker button {
  border: none; cursor: pointer;
  background: transparent; color: #fff;
  padding: 0.3rem 0.75rem; font-size: 0.85rem;
}
.lang-picker button.on { background: rgba(255, 255, 255, 0.28); font-weight: 600; }
.lang-picker button:hover:not(.on) { background: rgba(255, 255, 255, 0.14); }
header.site .wrap { max-width: 960px; margin: 0 auto; }
header.site h1 { margin: 0 0 0.3rem; font-size: 2rem; letter-spacing: -0.02em; }
header.site p { margin: 0; opacity: 0.92; }
header.site a { color: #fff; }

/* The negative margin overlaps the header. main must be positioned so it
   paints above header.site (also positioned, for .lang-picker) — positioned
   elements always paint over static ones, regardless of DOM order. */
main { position: relative; max-width: 960px; margin: -1.4rem auto 3rem; padding: 0 1.5rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 1px 3px rgba(31, 41, 51, 0.06);
}

.gallery { position: relative; margin-bottom: 1rem; }
.gallery .tour-media { margin-bottom: 0; }
.gallery img.tour-media { cursor: zoom-in; }

.lightbox {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 20, 25, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  cursor: default;
}
.lightbox .gal-nav {
  width: 2.9rem; height: 2.9rem; font-size: 1.9rem;
  background: rgba(255, 255, 255, 0.16);
}
.lightbox .gal-nav:hover { background: rgba(255, 255, 255, 0.32); }
.lightbox .gal-prev { left: 1rem; }
.lightbox .gal-next { right: 1rem; }
.lb-close {
  position: absolute; top: 0.9rem; right: 0.9rem;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.16); color: #fff;
  font-size: 1.15rem; line-height: 1;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.32); }
.lb-counter {
  position: absolute; bottom: 1rem; left: 0; right: 0;
  text-align: center; color: #fff; font-size: 0.9rem; opacity: 0.85;
}
.gal-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(31, 41, 51, 0.55); color: #fff;
  font-size: 1.4rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.gal-nav:hover { background: rgba(31, 41, 51, 0.8); }
.gal-prev { left: 0.6rem; }
.gal-next { right: 0.6rem; }
.gal-dots {
  position: absolute; bottom: 0.6rem; left: 0; right: 0;
  display: flex; justify-content: center; gap: 0.35rem;
}
.gal-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}
.gal-dots span.on { background: #fff; }

.tour-media {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.tour-media.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.tour-media.variant-0 { background: linear-gradient(120deg, #f59f00, #e8590c); }
.tour-media.variant-1 { background: linear-gradient(120deg, #0e7490, #38bdf8); }
.tour-media.variant-2 { background: linear-gradient(120deg, #7c2d92, #d6336c); }
.tour-media.variant-3 { background: linear-gradient(120deg, #15803d, #84cc16); }
.ph-icon { font-size: 3rem; line-height: 1; }
.ph-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.9; }

.tour-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.tour-head h2 { margin: 0; font-size: 1.3rem; }
.price { font-size: 1.25rem; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.price small { font-weight: 400; color: var(--muted); }
.duration { color: var(--muted); font-size: 0.9rem; margin: 0.15rem 0 0.6rem; }

details.itinerary { margin: 0.6rem 0 0.9rem; }
details.itinerary summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.itinerary ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
details.itinerary li { margin: 0.15rem 0; }

.departures { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dep-btn {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dep-btn:hover:not(:disabled) { border-color: var(--brand); }
.dep-btn.selected { background: var(--brand); border-color: var(--brand); color: #fff; }
.dep-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.dep-btn .left { display: block; font-size: 0.75rem; opacity: 0.75; }
.no-dates { color: var(--muted); font-style: italic; }

.book-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; }
label.field { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
label.field input, label.field select, label.field textarea {
  display: block; width: 100%; margin-top: 0.25rem;
  padding: 0.5rem 0.65rem; font-size: 1rem;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
label.field textarea { font-family: inherit; resize: vertical; }
label.field input:focus, label.field select:focus, label.field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }

.total { font-weight: 700; margin: 0.8rem 0 0.4rem; }

button.primary {
  background: var(--brand); color: #fff; border: none;
  border-radius: 8px; padding: 0.6rem 1.3rem; font-size: 1rem; font-weight: 600; cursor: pointer;
}
button.primary:hover { background: var(--brand-dark); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost {
  background: transparent; color: var(--accent); border: 1.5px solid var(--line);
  border-radius: 8px; padding: 0.45rem 1rem; font-size: 0.92rem; cursor: pointer;
}
button.ghost:hover { border-color: var(--accent); }

.msg { border-radius: 8px; padding: 0.7rem 0.9rem; margin-top: 0.8rem; font-size: 0.95rem; }
.msg.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.msg.success { background: #f0fdf4; color: var(--ok); border: 1px solid #bbf7d0; }

.badge { display: inline-block; border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.78rem; font-weight: 600; }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.warn { background: #fef3c7; color: var(--warn); }
.badge.full { background: #fee2e2; color: var(--danger); }
.badge.none { background: #f3f4f6; color: var(--muted); }

/* ------- admin ------- */
nav.tabs { display: flex; gap: 0.4rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
nav.tabs button {
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0.45rem 1.1rem; font-size: 0.95rem; cursor: pointer;
}
nav.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* "More" dropdown: houses the rarely-used tabs (Issues, Settings, Log out). */
details.menu { position: relative; margin-left: auto; }
details.menu summary {
  list-style: none; cursor: pointer; display: inline-block;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0.45rem 1.1rem; font-size: 0.95rem; position: relative;
}
details.menu summary::-webkit-details-marker { display: none; }
details.menu summary.active, details.menu[open] summary {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
details.menu summary.dot::after {
  content: ''; position: absolute; top: 0.3rem; right: 0.55rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
}
.menu-items {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 40;
  display: flex; flex-direction: column; gap: 0.15rem; min-width: 10rem;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 0.4rem; box-shadow: 0 6px 20px rgba(31, 41, 51, 0.15);
}
.menu-items button {
  background: none; border: none; text-align: left; cursor: pointer;
  padding: 0.55rem 0.9rem; border-radius: 8px; font-size: 0.95rem;
}
.menu-items button:hover { background: var(--bg); }
.menu-items button.active { background: var(--ink); color: #fff; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr.subrow td { background: #fbf9f5; }
td select { padding: 0.3rem 0.4rem; border-radius: 6px; border: 1.5px solid var(--line); font-size: 0.9rem; max-width: 160px; }

form.inline { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: end; margin-top: 1rem; }
form.inline label.field { min-width: 150px; flex: 1; }
form.inline button { height: 2.55rem; }

.photo-grid { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1rem; }
.photo-item { width: 150px; margin: 0; }
.photo-item img { width: 100%; height: 95px; object-fit: cover; border-radius: 6px; display: block; }
.photo-item > div { display: flex; gap: 0.3rem; align-items: center; margin-top: 0.3rem; }

.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(31, 41, 51, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.overlay-card { max-width: 620px; width: 100%; max-height: 85vh; overflow-y: auto; margin: 0; }

/* ------- boarding check-in (guide's phone) ------- */
.checkin-count { font-size: 1.3rem; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.pax { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }
.pax-main {
  flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.8rem;
  text-align: left; padding: 0.85rem 1rem; font-size: 1rem;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
}
.pax.done .pax-main { background: #f0fdf4; border-color: #86efac; }
.pax.partial .pax-main { background: #fffbeb; border-color: #fcd34d; }
.pax-name { font-weight: 700; font-size: 1.05rem; }
.pax.done .pax-name::before { content: '✓ '; color: var(--ok); }
.pax-meta { color: var(--muted); font-size: 0.85rem; }
.pax-hint { margin-left: auto; color: var(--accent); font-size: 0.82rem; }
.pax-step { display: flex; flex-direction: column; gap: 0.25rem; }
.pax-step button {
  flex: 1; width: 2.6rem; font-size: 1.15rem; line-height: 1; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 8px;
}
.pax-step button:disabled { opacity: 0.35; cursor: not-allowed; }
.pax-tel {
  display: flex; align-items: center; padding: 0 1rem; font-size: 1.25rem; text-decoration: none;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
}

.login-box { max-width: 380px; margin: 4rem auto; }
footer.site { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 2rem 0 3rem; }
footer.site a { color: var(--accent); }

/* ------- mobile ------- */
@media (max-width: 600px) {
  header.site { padding: 1.5rem 1rem 1.9rem; }
  header.site h1 { font-size: 1.55rem; }
  main { padding: 0 0.75rem; }
  .card { padding: 1rem 0.9rem; }
  th, td { padding: 0.45rem 0.5rem; }
  .overlay { padding: 0.5rem; }
  .overlay-card { max-height: 94vh; }
  .photo-item { width: calc(50% - 0.4rem); }
  form.inline label.field { min-width: 100%; }
  button.primary { width: 100%; }
  form.inline button.primary { width: auto; flex: 1; }
  .lightbox { padding: 0.5rem; }
  .lightbox .gal-prev { left: 0.4rem; }
  .lightbox .gal-next { right: 0.4rem; }
}

/* Bigger tap targets on touch devices. */
@media (pointer: coarse) {
  .gal-nav { width: 2.75rem; height: 2.75rem; }
  .lb-close { width: 2.9rem; height: 2.9rem; }
  .dep-btn { padding: 0.55rem 1rem; }
  button.ghost { padding: 0.55rem 1.1rem; }
  nav.tabs button { padding: 0.55rem 1.2rem; }
}
