/* ============================================
   Wheely Bike Tours — Main Stylesheet
   Mobile-first, responsive, China-compatible
   ============================================ */

/* ---- CSS Variables ---- */
:root {
  --color-primary: #f0783c;
  --color-primary-dark: #e0682c;
  --color-primary-light: #fef5f0;
  --color-secondary: #000000;
  --color-accent: #fad2be;
  --color-text: #333333;
  --color-text-dark: #1a1a1a;
  --color-text-muted: #666666;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f8f8;
  --color-border: #e0e0e0;
  --color-success: #28a745;
  --color-error: #dc3545;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  --container-max: 1200px;
  --container-narrow: 800px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary-dark);
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-dark);
  margin-bottom: var(--space-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: var(--space-md);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--color-text-muted); }
.text-small { font-size: 0.875rem; }
.text-large { font-size: 1.125rem; }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--space-2xl) 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
}

.btn-dark {
  background: var(--color-secondary);
  color: white;
  border-color: var(--color-secondary);
}

.btn-dark:hover {
  background: #333;
  border-color: #333;
  color: white;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ---- Cards ---- */
.card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--color-border);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--color-bg-alt);
}

.card-body {
  padding: var(--space-lg);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.card-text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.card-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text-dark);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(240, 120, 60, 0.15);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.form-row {
  display: grid;
  gap: var(--space-md);
}

/* ---- Navigation ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo img {
  height: 36px;
  width: auto;
}

.nav-desktop {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--color-text-dark);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
}

/* Language switcher */
.lang-switcher {
  position: relative;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0.5rem 1.5rem 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.lang-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.lang-flag {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Mobile menu toggle */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-dark);
  transition: all 0.2s;
}

/* Mobile nav */
.nav-mobile {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
}

.nav-mobile.active {
  display: block;
}

.nav-mobile .nav-list {
  flex-direction: column;
  gap: var(--space-md);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-secondary) 0%, #2a2a2a 100%);
  color: white;
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f0783c' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-title {
  font-size: 2.5rem;
  color: white;
  margin-bottom: var(--space-md);
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-xl);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
  justify-content: center;
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  padding: var(--space-md) 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs .sep {
  margin: 0 var(--space-sm);
  color: var(--color-border);
}

.breadcrumbs .current {
  color: var(--color-text);
  font-weight: 500;
}

/* ---- Section Components ---- */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.section-title {
  margin-bottom: var(--space-md);
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

/* ---- Tour Cards ---- */
.tour-card {
  position: relative;
}

.tour-card .card-image {
  aspect-ratio: 16 / 10;
}

.tour-meta {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.tour-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.tour-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.tour-price-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ---- Featured Tour ---- */
.featured-tour {
  display: grid;
  gap: var(--space-xl);
  align-items: start;
}

.featured-tour-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 3.5rem;
}

.featured-tour-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.featured-tour-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.featured-tour-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
}

/* ---- Partners ---- */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  align-items: stretch;
}

/* Homepage partners - fit on one row */
.home-partners .partner-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.home-partners .partner-item {
  padding: var(--space-sm);
  min-height: 80px;
}

.partner-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.2s;
  min-height: 120px;
}

.partner-item:hover {
  box-shadow: var(--shadow-md);
}

.partner-item img {
  max-height: 80px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

/* ---- Footer ---- */
.footer {
  background: var(--color-secondary);
  color: rgba(255,255,255,0.7);
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer a {
  color: rgba(255,255,255,0.7);
}

.footer a:hover {
  color: var(--color-primary);
}

.footer-grid {
  display: grid;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-title {
  color: white;
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

.footer-list {
  list-style: none;
}

.footer-list li {
  margin-bottom: var(--space-sm);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-lg);
  text-align: center;
  font-size: 0.875rem;
}

.social-links {
  display: flex;
  gap: var(--space-md);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transition: background 0.2s;
}

.social-link:hover {
  background: var(--color-primary);
}

/* ---- Booking Form ---- */
.booking-form {
  max-width: 600px;
  margin: 0 auto;
}

.price-calculator {
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.price-calculator-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--color-text-dark);
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.price-row.total {
  border-bottom: none;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text-dark);
  padding-top: var(--space-md);
  margin-top: var(--space-sm);
  border-top: 2px solid var(--color-primary);
}

/* ---- WhatsApp CTA ---- */
.whatsapp-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.25rem;
  background: #25d366;
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: background 0.2s;
}

.whatsapp-cta:hover {
  background: #128c7e;
  color: white;
}

/* ---- TripAdvisor Badge ---- */
.tripadvisor-block {
  text-align: center;
  padding: var(--space-xl);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

/* ---- Gallery Layout ---- */
.gallery-video-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.gallery-video {
  flex-shrink: 0;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.gallery-top-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  flex: 1;
  align-content: start;
}

.gallery-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.gallery-item {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-bg-alt);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Desktop: Video + 3x2 grid side by side */
@media (min-width: 1024px) {
  .gallery-video-section {
    flex-direction: row;
    align-items: stretch;
  }

  .gallery-video {
    width: 320px;
    max-width: 320px;
    margin: 0;
  }

  .gallery-top-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    align-content: start;
  }

  .gallery-bottom-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 640px) {
  .gallery-bottom-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-bottom-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---- Guide Cards ---- */
.guide-card {
  padding: var(--space-xl);
}

.guide-avatar {
  width: 140px;
  height: 140px;
  margin: 0 auto var(--space-md);
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-primary-light);
  border: 4px solid var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.guide-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Gallery Modal ---- */
.gallery-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.gallery-modal.active {
  display: flex;
}

.gallery-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-modal-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.gallery-modal-caption {
  color: white;
  margin-top: var(--space-md);
  font-size: 1rem;
  text-align: center;
  opacity: 0.9;
}

.gallery-modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  z-index: 10;
}

.gallery-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.gallery-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2.5rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
  z-index: 10;
}

.gallery-modal-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-modal-prev {
  left: var(--space-md);
}

.gallery-modal-next {
  right: var(--space-md);
}

.gallery-modal-counter {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 0.875rem;
  opacity: 0.7;
}

@media (max-width: 768px) {
  .gallery-modal-nav {
    width: 44px;
    height: 44px;
    font-size: 1.75rem;
  }

  .gallery-modal-prev {
    left: var(--space-sm);
  }

  .gallery-modal-next {
    right: var(--space-sm);
  }

  .gallery-modal-close {
    top: var(--space-sm);
    right: var(--space-sm);
    font-size: 2rem;
    width: 40px;
    height: 40px;
  }
}

/* ---- Utility Classes ---- */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

.hidden { display: none !important; }
.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;
}

/* ---- Responsive ---- */
@media (min-width: 640px) {
  .hero-title {
    font-size: 3rem;
  }

  .hero-cta {
    flex-direction: row;
  }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: repeat(2, 1fr); }
  .partner-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile booking form improvements */
@media (max-width: 639px) {
  .booking-form {
    padding: 0;
  }

  .price-calculator {
    margin-top: var(--space-xl);
  }

  .form-row {
    gap: var(--space-sm);
  }

  .form-group {
    margin-bottom: var(--space-md);
  }
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
  }

  .menu-toggle {
    display: none;
  }

  .nav-mobile {
    display: none !important;
  }

  .featured-tour {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .partner-grid { grid-template-columns: repeat(4, 1fr); }
  .home-partners .partner-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Print ---- */
@media print {
  .header, .footer, .nav-mobile, .menu-toggle {
    display: none !important;
  }

  .hero {
    min-height: auto;
    background: white !important;
    color: black !important;
  }

  .hero-title {
    color: black !important;
  }
}
