:root {
    --green: #2f5d3a;
    --yellow: #f7b500;
    --light: #f9f9f9;
    --gray: #777;
    --font-heading: "Montserrat", sans-serif;
    --font-body: "DM Sans", sans-serif;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", sans-serif;
}
body {
    background: #fff;
    color: #333;
    font-family: var(--font-body);
}
/* HERO */
.hero {
    background: linear-gradient(to right, #cfa06a88, #5b8fa888);
    position: relative;
    color: white;
    padding: 1.5rem;
}
#hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Apply your gradient and initial image */
    background: linear-gradient(to right, #cfa06a88, #5b8fa888), url('../images/oceanDesert.webp') center / cover no-repeat;
    transition: background-image 1.5s ease-in-out, opacity 1s ease-in-out;
}

/* Helper class for the fade effect */
.fade-out {
    opacity: 0;
}
.nav, .logo, .hero-text {
    position: relative;
    z-index: 2; /* Ensures text stays above background */

}
.nav {
    z-index: 3; /* Ensures text stays above background */
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: auto;
    padding: 0 1rem 0;
}
.nav ul {
    list-style: none;
    display: flex;
    gap: 1.2rem;
    color: var(--yellow);
}
.nav li a {
    color: #fff !important;
    font-weight: 500;
    text-decoration: none;
    text-shadow: 1px 2px 3px #0000003b;
    position: relative;
}
.nav li a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--yellow);
    text-underline-offset: 5px;
}
.nav li a.active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--yellow);
    text-underline-offset: 5px;
}
.nav li a.active:hover {
    text-decoration-thickness: 1px;
}
.nav ul y {
    text-shadow: 1px 2px 3px #0000003b;
}
.logo {
    font-size: 2.5rem;
}
.logo img {
    width: clamp(170px, 12vw, 200px);
}
.hero-text {
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 4rem;
}
.hero-text h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 4rem;
    text-shadow: rgba(0, 0, 0, 0.23) 1px 2px 3px;
}
.hero-text h1 span {
    color: var(--yellow);
    font-weight: 300;
    font-style: italic;
    display: block;
    margin-top: -30px;
    font-size: 83px;
    font-size: clamp(3.6rem, 6vw, 5rem);
}
.search-bar {
    margin: 1.5rem auto -50px;
    display: flex;
    justify-content: center;
    gap: .5rem;
    max-width: fit-content;
    background: #fff;
    padding: 6px;
    border-radius: 28px;
    margin-bottom: -7rem;
    box-shadow: 0 4px 12px #ccccccbd;
}
.search-bar input,
.search-bar select {
    padding: .6rem;
    border-radius: 20px;
    border: none;
}
.search-bar input::placeholder, .search-bar select::placeholder { /* Modern browsers */
  text-align: center;
}
.search-bar input:-moz-placeholder, .search-bar select:-moz-placeholder { /* Firefox 18- */
  text-align: center;
}
.search-bar input::-webkit-input-placeholder, .search-bar select::-webkit-input-placeholder { /* Chrome, Opera, Safari, Edge */
  text-align: center;
}
.search-bar input:-ms-input-placeholder, .search-bar select:-ms-input-placeholder { /* Internet Explorer 10+ */
  text-align: center;
}
.search-bar button, .listingForm button {
    background: var(--yellow);
    border: none;
    padding: .6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    gap: 8px;
}
.search-bar img {
    width: 15px;
}
/* CONTENT */
.container {
    max-width: 1100px;
    margin: auto;
    padding: 4rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.welcome {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-family: var(--font-heading);
    color: var(--green);
    font-weight: 300;
    font-size: clamp(14px, 4vw, 18px);
}
.welcome strong {
    font-weight: 700;
    display: block;
    margin-top: -4px;
    margin-bottom: 4px;
    font-size: clamp(20px, 4vw, 32px);
    line-height: 1;
}
.gallery .main-image {
    width: 100%;
    border-radius: 12px;
}
.thumbnails {
    display: flex;
    gap: .5rem;
    margin-top: .5rem;
    justify-content: center;
}
.thumbnails img {
    width: 100px;
    border-radius: 8px;
    opacity: .7;
    cursor: pointer;
}
.thumbnails img:hover {
    opacity: 1;
}
.thumbnails img.active {
    opacity: 1;
    box-shadow: 0 0 0 4px #f7b50063;
}
.description {
    margin: 2rem 0;
    line-height: 1.6;
    /* color: var(--gray); */
}
.meta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    color: var(--green);
}
.meta x {
    color: var(--yellow);
}
/* AMENITIES */
.amenities {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
    list-style: none;
    margin-bottom: 2rem;
}
.amenities li::before {
    content: url(../images/check.svg);
    margin-right: 0.4rem;
    top: 5px;
    position: relative;
}
/* CTA */
.cta {
    display: block;
    margin: auto;
    background: #f7b500;
    background: var(--yellow);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    animation: pulse 2.5s infinite;
}
.note {
    background: #fff0f0;
    max-width: 640px;
    padding: 24px 32px;
    margin: 0 auto -32px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--green);
}
.note.success {
    background: #ecf5e2;
}
.note h2, .welcome strong {    
    font-family: var(--font-heading);
}
.note h2 {    
    font-family: var(--font-heading);
    font-size: 16px;
}
.note ul {
    margin-left: 30px;
    line-height: 1.2;
    font-size: 14px;
}
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(247, 181, 0, 0.6);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(247, 181, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(247, 181, 0, 0);
    }
}
/* FOOTER */
footer {
    background: var(--light);
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}
.footer-cols {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: auto;
    justify-content: space-around;
}
footer h4 {
    color: var(--green);
    margin-bottom: .5rem;
    text-transform: uppercase;
    font-family: var(--font-heading);
}
.footerLogo img {
    width: 90px;
    margin-top: -12px;
    margin-right: -60px;
}
.footerAbout p {
    max-width: 290px;
    text-align: justify;
    hyphens: auto;
}
footer a, .note a {
    color: unset;
    text-decoration-color: var(--yellow);
    text-underline-offset: 4px;
}
footer a:hover, .note a:hover {
    text-decoration-thickness: 2px;
}
footer ul {
    list-style: none;
}
footer li {
    margin-bottom: .4rem;
}
footer .socials {
    display: flex;
    gap: 8px;
    max-width: fit-content;
    margin-top: 20px;
}
footer .socials img {
    height: 28px;
    opacity: 0.9;
}
footer .socials img:hover {
    opacity: 1;
}
.copyright {
    text-align: center;
    margin-top: 2rem;
    color: var(--green);
    font-weight: 600;
}
/* ========= Map Styling ========= */
.map-container { max-width: 740px; margin: auto; position: relative; }
/* ===== Toolbar ===== */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 auto .5rem;
    padding: 0 2%;
    justify-content: center;
    max-width: 540px;
}
.toolbar button {
    flex: 1 1 auto;
    padding: 0.2rem 0.75rem;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    max-width: fit-content;
}

/* Transparent toggles with colored border + dot, black text */
.toolbar button[type-toggle]{
  background: transparent;
  border: 2px solid #000;  /* updated by JS */
  color: #000;             /* black text as requested */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity .2s ease, transform .05s ease;
}
.toolbar button[type-toggle]:active{ transform: scale(.98); }
.toolbar button[type-toggle].off{ opacity: .45; }
.toolbar button[type-toggle] .dot{
  width: 10px; height: 10px; border-radius: 50%; display: inline-block; top: 1px; position: relative;
}

/* ===== Map ===== */
.map-wrapper{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.96;
  overflow: hidden;        /* keep zoom/drag clean */
  border-radius: 8px;
  touch-action: none;
}
.map{
  position: absolute; inset: 0;
  background: url(../images/namibiaMap.webp) center / cover no-repeat;
  transform-origin: 0 0;
}

/* Layers (order matters) */
#overlays   { position: absolute; inset: 0; z-index: 5;  pointer-events: none; }
#listingPins{ position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.listing-pin{ pointer-events: auto; position: absolute; }

/* ===== Towns ===== */
.town-pin {
    position: absolute; width:12px; height:12px;
    background: #0aa55d;
    border-radius: 50% 50% 0 50%;
    transform: translate(-50%, -90%) rotate(45deg);
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px #ffffff00 !important;
}
.town-pin::after, .listing-pin::after {
    content: "";
    width: 5px;
    height: 5px;
    background: #fff;
    position: absolute;
    left: 3px;
    top: 3px;
    border-radius: 60px;
}
.town-pin.capital {
  background:#d73513 !important; box-shadow:0 0 0 3px #d7351366, 0 0 0 5px #d7341300;
    /* width: 16px;
    height: 16px; */
}
.town-label {
  position: absolute; transform: translate(-50%, 40%);
  font-size: 11px; color:#fff; white-space: nowrap; text-shadow:0 1px 3px #000;
  pointer-events: none;
}
.capital-label { font-weight:700; text-transform: uppercase; }

/* ===== Regions ===== */
.region-label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 700;
    color: #ffd145;
    text-shadow: 0 1px 3px #000;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    pointer-events: none;
}

/* ===== Listing pins ===== */
.listing-pin {
    width: 12px;
    height: 12px;
    border-radius: 50% 50% 0 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    box-shadow: 0 0 0 3px #ffffff, 0 0 4px #0006;
    cursor: pointer;
}
/* Optional: Add a subtle bounce animation (example from CodePen) */
@keyframes bounce {
  0% { transform: translate(-50%, -50%) rotate(45deg); }
  20% { transform: translate(-50%, -100%) rotate(45deg); }
  40% { transform: translate(-50%, -50%) rotate(45deg); }
}
.listing-pin:hover, .town-pin:hover {
  animation: bounce 1s infinite;
}
/* ===== Floating labels (global, outside map wrapper) ===== */
#globalLabelLayer {
  position: fixed; /* viewport coordinates */
  inset: 0;
  z-index: 10;
  pointer-events: none; /* allow clicks through except on labels themselves */
}
.floating-label {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translate(-65%, -100%);
    position: absolute;
    background: rgba(0,0,0,.85);
    color: #fff;
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 4px;
    white-space: nowrap;
    display: none;
    pointer-events: auto; /* allow clicking links */
}
.floating-label a {    
    color: #7e6107;
    text-decoration: none;
    display: block;
    background: #ffd147;
    border-radius: 24px;
    padding: 2px 10px;
    margin: 4px auto;
    font-weight: 500;
    text-align: center;
}
.floating-label a:hover {
    background: #edb200;
}
.floating-label span {
    display: none;
}

/* ===== Zoom buttons ===== */
.zoom-controls{
  position: absolute; bottom: 8px; right: 8px;
  display: flex; flex-direction: column; gap: 4px; z-index: 20;
}
.zoom-controls button{
  width: 36px; height: 36px; border: none; border-radius: 6px;
  background: rgba(0,0,0,.7); color: #fff; font-size: 20px; cursor: pointer;
}
/* ---------- COORDINATES ---------- */
.coords {
    display: flex;
    display: none !important;
    gap: .5rem;
    margin-top: .5rem;
}
.coords input {
    flex: 1;
    padding: .4rem;
    border: none;
}

/* ---------- FORMS ---------- */
#listingForm {
    background: #fcfcfc;
    padding: 26px 0 8px;
}
.listingForm {
    margin: 0 auto 16px;
    padding: 0 10px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.listingForm div {
    display: flex;
    flex-direction: column;
}
.listingForm label {
    font-size: 12px;
    font-weight: 600;
    color: #213e23;
    margin: 0 auto 2px;
}
.listingForm label + * {
    padding: 6px 6px;
    border-radius: 4px;
    border: none;
    margin-top: 3px;
    box-shadow: 0 0 0 1px #f7b5004d;
    font-size: 16px;
}
small {
    font-style: italic;
    opacity: .7;
    margin-left: 4px;
}
#descCount {
    font-weight: 600;
}
.listingForm button {
    padding: .3rem 1.2rem;
    max-width: fit-content;
    margin: 0 auto;
    font-size: 16px;
}
/* ---------- MEDIA QURIES ---------- */
@media only screen and (max-width: 960px) {
    .nav ul {
        gap: 0.4rem;
    }
    .hero-text h1 span {
        margin-top: -24px;
    }
    .thumbnails img {
        width: 60px;
    }
}
@media only screen and (max-width: 760px) {
    .map-container {
        padding: 0 2%;
        border-radius: 2px;
    }
    .toolbar {
        gap: .3rem .5rem;
    }
}
@media only screen and (max-width: 600px) {
    .nav li a {
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-decoration-color: var(--yellow);
        text-underline-offset: 5px;
    }
    .hero-text h1 {
        margin-bottom: 0rem;
    }
    ul.nav-left li:nth-child(n+3), nav y, .footerLogo {
        display: none;
    }
    .nav ul {
        gap: 0.8rem;
    }
    .search-bar select {
        display: none;
    }
    .search-bar button {
        padding: .6rem 0.9rem;
    }
    .search-bar button span {
        display: none;
    }
    .welcome {
        margin-top: 0rem;
        margin-bottom: 0rem;
    }
    .gallery .main-image {
        border-radius: 6px;
    }
    .thumbnails img {
        width: 50px;
        border-radius: 4px;
    }
    .thumbnails {
        gap: 0.3rem;
    }
    .thumbnails img.active {
        box-shadow: 0 0 0 3px #f7b50063;
    }
    .footer-cols {
        justify-content: flex-start;
    }
    /* footer .socials {
        margin: 20px auto 10px;
    } */
}