/* WauWauMap Schweiz - Master Stylesheet 🇨🇭
   Fully Responsive for Desktop, Tablet & Mobile (320px - 1440px+)
   Zero Horizontal Overflow, Meter-exact Layouts & High-Performance UI */

:root {
  --g: #285a43;
  --gd: #153c2b;
  --y: #f5aa1c;
  --y-hover: #f7b733;
  --c: #f6f3ec;
  --text: #17352a;
  --text-muted: #52665b;
  --white: #ffffff;
  --border: #cfe0d6;
  --danger: #e74c3c;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 20px rgba(28, 73, 50, 0.08);
  --shadow-lg: 0 16px 40px rgba(21, 60, 43, 0.18);
  --shadow-modal: 0 25px 70px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   Universal Reset & Mobile-First Box-Sizing
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: 'Outfit', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--g);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

/* Container */
.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 22px;
  box-sizing: border-box;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--gd);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.nav {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.logo-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}
.logo-box img {
  height: 46px;
  border-radius: 10px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}

.links {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}
.links a {
  color: #e5f0ea;
}
.links a:hover {
  color: var(--y);
}

.langs {
  display: flex;
  gap: 4px;
  align-items: center;
}
.langs button {
  background: transparent;
  color: #fff;
  opacity: 0.8;
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.langs button.active,
.langs button:hover {
  background: var(--y);
  color: #183a2b;
  opacity: 1;
}

.nav-auth-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.nav-user-btn {
  background: #285a43;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}
.nav-user-btn:hover {
  background: #326e53;
  border-color: rgba(255, 255, 255, 0.4);
}

.nav-biz-btn {
  background: var(--y);
  color: #183a2b;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(245, 170, 28, 0.25);
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}
.nav-biz-btn:hover {
  background: var(--y-hover);
  transform: translateY(-1px);
}

/* General Buttons */
.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.btn.primary {
  background: var(--y);
  color: #183a2b;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(245, 170, 28, 0.3);
}
.btn.primary:hover {
  background: var(--y-hover);
  transform: translateY(-1px);
}
.btn.outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
}
.btn.outline:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  color: #fff;
  padding: 55px 0 40px;
  background: linear-gradient(180deg, var(--gd) 0%, var(--g) 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 35px;
  align-items: center;
}
.hero-eyebrow {
  color: var(--y);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  margin-bottom: 10px;
  display: inline-block;
  background: rgba(245, 170, 28, 0.15);
  padding: 5px 12px;
  border-radius: 999px;
}
h1 {
  font-size: 44px;
  line-height: 1.15;
  margin: 10px 0 16px;
  font-weight: 800;
}
.hero p {
  font-size: 18px;
  line-height: 1.55;
  color: #e5f0ea;
  margin-bottom: 24px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.hero-stats b {
  font-size: 24px;
  display: block;
  color: var(--y);
  font-weight: 800;
}
.hero-stats span {
  font-size: 13px;
  color: #cbe0d5;
}

/* Slider */
.slider {
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(10, 35, 24, 0.4);
  position: relative;
  background: #000;
  width: 100%;
}
.slide {
  display: none;
  position: relative;
  animation: wwmFadeSlide 0.5s ease-in-out;
}
.slide.active {
  display: block;
}
@keyframes wwmFadeSlide {
  from { opacity: 0.3; }
  to { opacity: 1; }
}
.slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}
.caption {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(21, 60, 43, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  backdrop-filter: blur(8px);
}

/* ==========================================================================
   Sections & Toolbars
   ========================================================================== */
.section {
  padding: 60px 0;
  background: var(--c);
}
.section.white {
  background: #fff;
}
.section.green {
  background: var(--g);
  color: #fff;
}
.section h2 {
  font-size: 34px;
  margin: 0 0 10px;
  font-weight: 800;
  color: #17352a;
}
.section.green h2 {
  color: #fff;
}
.section-p {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0 0 24px;
}
.section.green .section-p {
  color: #d6e8dd;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0 15px;
  align-items: center;
}
.toolbar input,
.toolbar select {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #ccdcd2;
  min-width: 180px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: #17352a;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--g);
  box-shadow: 0 0 0 3px rgba(40, 90, 67, 0.15);
}
.btn-locate {
  background: var(--y);
  color: #183a2b;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(245, 170, 28, 0.25);
  font-family: inherit;
  transition: all 0.2s ease;
}
.btn-locate:hover {
  background: var(--y-hover);
  transform: translateY(-1px);
}

#map {
  height: 560px;
  width: 100%;
  border-radius: 20px;
  background: #e7eee9;
  color: #17352a;
  box-shadow: 0 12px 35px rgba(23, 53, 42, 0.15);
  z-index: 1;
}

.notice {
  padding: 12px 18px;
  border-radius: 12px;
  background: #fff4d2;
  color: #604800;
  margin: 12px 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--y);
}
.notice.success {
  background: #eaf7ee;
  color: #1b5e32;
  border-left-color: #2e7d32;
}

/* ==========================================================================
   Leaflet & Marker Clusters
   ========================================================================== */
.custom-map-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.custom-map-pin:hover {
  transform: scale(1.18);
}
.leaflet-popup-content-wrapper {
  border-radius: 16px !important;
  padding: 8px !important;
  box-shadow: 0 10px 25px rgba(21, 60, 43, 0.25) !important;
}
.leaflet-popup-content {
  margin: 10px 14px !important;
  line-height: 1.4 !important;
  font-family: inherit !important;
}
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
  background-color: rgba(245, 170, 28, 0.6) !important;
}
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background-color: #153c2b !important;
  color: #ffffff !important;
  font-weight: bold !important;
  font-family: inherit !important;
}

/* ==========================================================================
   Guide Shell & Tours
   ========================================================================== */
.guide-shell {
  background: #fff;
  border: 1px solid #dce9e1;
  border-radius: 22px;
  padding: 24px;
  margin: 18px 0 26px;
  box-shadow: 0 10px 28px rgba(28, 73, 50, 0.08);
}
.guide-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.guide-head h3 {
  font-size: 26px;
  margin: 4px 0 7px;
  color: #17352a;
  font-weight: 800;
}
.guide-head p {
  margin: 0;
  color: #65766e;
  max-width: 720px;
  font-size: 14px;
}
.guide-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #3b7c59;
  text-transform: uppercase;
}
.guide-controls {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(160px, 220px) 1fr;
  gap: 12px;
  margin-top: 18px;
}
.guide-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 750;
  color: #53665d;
}
.guide-controls select,
.guide-controls input {
  width: 100%;
  border: 1px solid #cfddd5;
  border-radius: 12px;
  padding: 11px 13px;
  background: #fbfdfb;
  font: inherit;
  color: #17352a;
  font-size: 14px;
  box-sizing: border-box;
}

.tour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  margin-top: 25px;
}
.tour-card {
  background: #fff;
  border: 1px solid #dce9e1;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(28, 73, 50, 0.06);
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}
.tour-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.tour-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tour-meta-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}
.tour-pill {
  font-size: 12px;
  font-weight: 750;
  background: #eaf4ed;
  color: #285a43;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tour-pill.water { background: #e3f2fd; color: #0d47a1; }
.tour-pill.shade { background: #e8f5e9; color: #1b5e32; }

/* Canton Grid Buttons */
.canton-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08) !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: #102e22;
  color: #fff;
  padding: 45px 0 30px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1.2fr 1fr 1.2fr;
  gap: 25px;
  margin-bottom: 30px;
}
.footer a {
  color: #cbe0d5;
  display: block;
  margin: 8px 0;
}
.footer a:hover {
  color: var(--y);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  color: #88a396;
  font-size: 13px;
}

/* ==========================================================================
   WauWauMap Modal Architecture (Zero Layout Shift, Fixed Viewport, Mobile-First)
   ========================================================================== */
.wwm-modal-overlay,
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 35, 24, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.wwm-modal-card,
.auth-modal-content {
  position: relative;
  background: #ffffff;
  color: #17352a;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  box-shadow: var(--shadow-modal);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
  box-sizing: border-box;
  margin: auto;
  animation: wwmModalSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wwmModalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.wwm-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f1f6f3;
  color: #285a43;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}
.wwm-modal-close:hover {
  background: #e1ede5;
  color: #153c2b;
  transform: scale(1.08);
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  background: #eaf2ed;
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
  margin-top: 8px;
}
.modal-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: #436353;
  font-weight: 750;
  font-size: 13px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.modal-tab.active {
  background: #ffffff;
  color: #153c2b;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Form Groups & Controls inside Modals */
.form-group {
  margin-bottom: 14px;
  text-align: left;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 750;
  color: #1e4533;
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #cfe0d6;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fbfdfc;
  color: #17352a;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #285a43;
  box-shadow: 0 0 0 3px rgba(40, 90, 67, 0.15);
  background: #ffffff;
}

/* User Favorites List in Modal */
.user-fav-list {
  background: #f9fbf9;
  border: 1px solid #dce9e1;
  border-radius: 14px;
  padding: 14px;
  max-height: 220px;
  overflow-y: auto;
}
.fav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid #eef4f0;
  font-size: 13px;
}
.fav-item:last-child {
  border-bottom: none;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */

/* Tablet & Smaller Laptops (<= 900px) */
@media (max-width: 900px) {
  .links {
    display: none;
  }
  .nav {
    flex-wrap: wrap;
    min-height: auto;
    padding: 10px 0;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
  }
  .logo-box {
    order: 1;
  }
  .nav-auth-group {
    order: 2;
    margin-left: auto;
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .langs {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  h1 {
    font-size: 34px;
  }
  .hero p {
    font-size: 16px;
  }
  .guide-controls {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .langs {
    width: 100%;
    justify-content: center;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

/* Standard Mobile Phones (<= 768px) */
@media (max-width: 768px) {
  .wrap {
    padding: 0 16px;
  }
  header {
    padding: 4px 0;
  }
  .nav {
    padding: 6px 0;
  }
  .logo-box img {
    height: 38px;
  }
  .nav-auth-group {
    gap: 6px;
  }
  .nav-user-btn,
  .nav-biz-btn {
    padding: 7px 11px;
    font-size: 12px;
  }
  .langs button {
    padding: 5px 9px;
    font-size: 11px;
  }

  /* Hero Section */
  .hero {
    padding: 35px 0 25px;
  }
  h1 {
    font-size: 28px;
    line-height: 1.2;
    margin: 8px 0 14px;
  }
  .hero p {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
  }
  .hero-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 14px;
  }
  .hero-stats b {
    font-size: 22px;
  }
  .slider .slide img {
    height: 250px;
  }

  /* Sections */
  .section {
    padding: 40px 0;
  }
  .section h2 {
    font-size: 26px;
  }
  .section-p {
    font-size: 14px;
    margin-bottom: 18px;
  }

  /* Toolbar & Map */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .toolbar input,
  .toolbar select,
  .btn-locate {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  #map {
    height: 390px;
    border-radius: 16px;
  }

  /* Guide Shell */
  .guide-shell {
    padding: 18px 14px;
    border-radius: 16px;
  }
  .guide-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .guide-head h3 {
    font-size: 22px;
  }
  .tour-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Small Smartphone Viewports (<= 480px, iPhone SE, 360px-390px Android) */
@media (max-width: 480px) {
  .wrap {
    padding: 0 12px;
  }
  .logo-box img {
    height: 34px;
  }
  .nav-user-btn,
  .nav-biz-btn {
    padding: 6px 9px;
    font-size: 11px;
    gap: 4px;
  }
  .langs button {
    padding: 4px 7px;
    font-size: 10px;
  }

  h1 {
    font-size: 24px;
  }
  .hero-stats {
    gap: 8px;
  }
  .hero-stats b {
    font-size: 20px;
  }

  .wwm-modal-overlay,
  .auth-modal {
    padding: 8px;
    align-items: flex-end;
  }
  .wwm-modal-card,
  .auth-modal-content {
    padding: 20px 14px;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
  }
  .modal-tab {
    font-size: 12px;
    padding: 8px 4px;
  }
  .form-group input,
  .form-group select {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Extra Small Screens (<= 360px) */
@media (max-width: 360px) {
  .nav-auth-group {
    gap: 4px;
  }
  .nav-user-btn,
  .nav-biz-btn {
    padding: 5px 8px;
    font-size: 10px;
  }
}
