/* ============================================================
   LOCAL CDMX — layout.css
   Header, search split view, landing sections, footer, responsive
   ============================================================ */

/* ==================== HEADER ==================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  z-index: var(--z-header);
  transition: box-shadow var(--transition), background var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
  background: rgba(255,255,255,0.98);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
}

.header-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary-gradient);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--white);
  box-shadow: var(--shadow-glow-primary);
  transition: transform var(--transition-spring);
}

.header-logo:hover .header-logo-icon {
  transform: scale(1.08) rotate(-3deg);
}

.header-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.header-logo-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.header-logo-name span {
  color: var(--primary);
}

.header-logo-subtitle {
  font-size: 0.6rem;
  color: var(--text-light);
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Header Search */
.header-search {
  flex: 1;
  max-width: 480px;
  margin: 0 var(--space-lg);
  position: relative;
}

.header-search-input {
  width: 100%;
  height: 42px;
  padding: 0 44px 0 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--border-radius-full);
  background: var(--bg);
  font-size: var(--font-size-sm);
  transition: all var(--transition);
}

.header-search-input:focus {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,127,63,0.12);
}

.header-search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 14px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.header-search-btn:hover {
  transform: translateY(-50%) scale(1.08);
  box-shadow: var(--shadow-glow-primary);
}

/* Header Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.header-nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.header-nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

.header-nav-link--cta {
  background: var(--primary-gradient);
  color: var(--white) !important;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.header-nav-link--cta:hover {
  box-shadow: var(--shadow-glow-primary);
  transform: translateY(-1px);
}

/* Mobile menu toggle */
.header-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}

.header-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.header-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.header-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.header-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav menu */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
  z-index: calc(var(--z-header) - 1);
  animation: fadeInDown 0.25s ease;
}

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

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px var(--space-md);
  border-radius: var(--border-radius);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition-fast);
}

.mobile-nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Body offset for fixed header */
#app {
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ==================== SEARCH PAGE SPLIT VIEW ==================== */
.search-page {
  display: flex;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

.search-map-panel {
  width: 35%;
  min-width: 300px;
  height: 100%;
  position: relative;
  border-right: 1px solid var(--border);
}

.search-map-panel #search-map {
  width: 100%;
  height: 100%;
}

.search-results-panel {
  width: 65%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.search-results-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-md);
}

.search-results-count {
  font-size: var(--font-size-sm);
  color: var(--text-light);
  font-weight: 500;
}

.search-results-count strong {
  color: var(--text);
}

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

.search-results-sort select {
  padding: 6px 32px 6px 10px;
  font-size: var(--font-size-xs);
  border-radius: var(--border-radius-full);
  border-color: var(--border);
  background-color: var(--white);
}

/* Results grid/list */
.results-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.results-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* Map overlay buttons */
.map-overlay-btn {
  position: absolute;
  z-index: 450;
  background: var(--white);
  border-radius: var(--border-radius-full);
  padding: 8px 18px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--border);
}

.map-overlay-btn:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  color: var(--primary);
}

.map-search-area-btn {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.map-my-location-btn {
  bottom: 20px;
  right: 12px;
}

/* ==================== LANDING SECTIONS ==================== */
.landing-page {
  overflow-x: hidden;
}

/* Hero */
.hero-section {
  position: relative;
  padding: var(--space-4xl) 0 var(--space-3xl);
  background: linear-gradient(175deg, var(--white) 0%, var(--primary-light) 40%, var(--bg) 100%);
  overflow: hidden;
}

/* Mesh gradient overlay */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  z-index: 0;
}

/* Floating decorative blob */
.hero-section::after {
  content: '';
  position: absolute;
  top: 10%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,127,63,0.1) 0%, rgba(255,127,63,0.04) 40%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  animation: floatSlow 20s ease-in-out infinite;
  z-index: 0;
}

/* Dot pattern overlay */
.hero-content::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -80px;
  right: -80px;
  bottom: -80px;
  background-image: radial-gradient(rgba(255,127,63,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  overflow: visible;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-xs);
}

.hero-title {
  font-size: clamp(2rem, 5vw, var(--font-size-4xl));
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-md);
  letter-spacing: -1px;
}

.hero-title .highlight {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-light);
  font-weight: 400;
  margin-bottom: var(--space-xl);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search-box {
  max-width: 640px;
  margin: 0 auto var(--space-xl);
  position: relative;
}

.hero-search-input {
  width: 100%;
  height: 64px;
  padding: 0 140px 0 56px;
  border: 2px solid rgba(255,127,63,0.2);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-md);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.8);
  transition: all var(--transition);
}

.hero-search-input:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow-xl), 0 0 0 4px rgba(255,127,63,0.1);
}

.hero-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.hero-search-submit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 50px;
  padding: 0 28px;
  background: var(--primary-gradient);
  color: var(--white);
  border-radius: var(--border-radius-full);
  font-weight: 600;
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-glow-primary);
  transition: all var(--transition);
}

.hero-search-submit:hover {
  transform: translateY(-50%) scale(1.03);
  box-shadow: 0 6px 24px rgba(255,127,63,0.4);
}

.hero-popular {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.hero-popular-label {
  font-size: var(--font-size-sm);
  color: var(--text-light);
  font-weight: 500;
}

.hero-popular-tag {
  padding: 5px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hero-popular-tag:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* Section common */
.section {
  padding: 80px 0;
  position: relative;
}

.section--alt {
  background: #f8f6f3;
}

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

.section-eyebrow {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, var(--font-size-3xl));
  font-weight: 800;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-light);
  font-weight: 400;
}

/* Categories grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
}

/* How it works */
.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  position: relative;
}

/* Connecting line between steps */
.how-it-works-grid::before {
  content: '';
  position: absolute;
  top: 50px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--primary) 0px, var(--primary) 6px,
    transparent 6px, transparent 14px
  );
  border-radius: 2px;
  opacity: 0.25;
}

/* Featured carousel */
.featured-section {
  overflow: hidden;
}

.featured-carousel-wrapper {
  position: relative;
  margin: 0 calc(-1 * var(--space-lg));
}

.featured-carousel {
  display: flex;
  gap: var(--space-lg);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-sm) var(--space-lg) var(--space-xl);
  scrollbar-width: none;
}

.featured-carousel::-webkit-scrollbar {
  display: none;
}

.featured-carousel > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.carousel-nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.carousel-nav-btn:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow-primary);
}

/* CTA section */
.cta-section {
  background: var(--gradient-cta);
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
  padding: var(--space-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.5' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E")
    repeat;
  background-size: 40px 40px;
}

/* Floating decorative shapes for CTA */
.cta-section::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatSlow 15s ease-in-out infinite;
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-title {
  font-size: clamp(1.6rem, 3.5vw, var(--font-size-3xl));
  color: var(--white);
  font-weight: 800;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.cta-text {
  font-size: var(--font-size-md);
  color: rgba(255,255,255,0.9);
  max-width: 520px;
  margin: 0 auto var(--space-xl);
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 18px 42px;
  background: var(--white);
  color: var(--primary);
  font-weight: 700;
  font-size: var(--font-size-md);
  border-radius: var(--border-radius-full);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition);
}

.cta-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-xl);
  color: var(--primary-dark);
}

/* ==================== FOOTER ==================== */
.site-footer {
  background: #1A1A2E;
  color: rgba(255,255,255,0.75);
  padding: var(--space-3xl) 0 var(--space-xl);
  position: relative;
}

/* Gradient divider at top */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--pro-gold), var(--primary));
}

/* Subtle grid pattern */
.site-footer::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  position: relative;
  z-index: 1;
}

.footer-brand {
  max-width: 300px;
}

.footer-brand .header-logo-name {
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: var(--space-sm);
}

.footer-brand .header-logo-name span {
  color: var(--primary);
}

.footer-brand-desc {
  font-size: var(--font-size-sm);
  line-height: 1.7;
  margin-top: var(--space-sm);
  color: rgba(255,255,255,0.45);
}

.footer-col-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--space-md);
  text-shadow: none;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-link {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.5);
  transition: color var(--transition-fast);
  position: relative;
  display: inline-block;
  width: fit-content;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width var(--transition);
}

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

.footer-link:hover::after {
  width: 100%;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.35);
  position: relative;
  z-index: 1;
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
}

.footer-social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  transition: all var(--transition);
}

.footer-social-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(255,127,63,0.4);
}

/* ==================== RESPONSIVE ==================== */

/* Large desktop */
@media (max-width: 1200px) {
  .header-search {
    max-width: 360px;
  }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-xl);
  }
}

/* Tablet landscape */
@media (max-width: 992px) {
  .search-page {
    flex-direction: column;
  }
  .search-map-panel {
    width: 100%;
    height: 260px;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .search-results-panel {
    width: 100%;
    height: calc(100vh - var(--header-height) - 260px);
  }
  .header-nav {
    display: none;
  }
  .header-hamburger {
    display: flex;
  }
  .header-search {
    max-width: 400px;
    margin-right: auto;
  }
  .how-it-works-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  .how-it-works-grid::before {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tablet portrait */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --space-3xl: 48px;
    --space-4xl: 64px;
  }

  .header-search {
    max-width: none;
    flex: 1;
    margin: 0 var(--space-sm);
  }

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

  .hero-search-input {
    height: 52px;
    padding-right: 52px;
    font-size: var(--font-size-base);
  }

  .hero-search-submit {
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 0;
  }

  .hero-search-submit::before {
    content: '🔍';
    font-size: 18px;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--space-sm);
  }

  .featured-carousel {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .results-mosaic {
    grid-template-columns: 1fr;
  }

  .search-map-panel {
    height: 200px;
  }
  .search-results-panel {
    height: calc(100vh - var(--header-height) - 200px);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --space-lg: 16px;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .hero-subtitle {
    font-size: var(--font-size-base);
  }

  .section-title {
    font-size: 1.4rem;
  }

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

  .search-results-scroll {
    padding: var(--space-md);
  }

  .header-logo-text {
    display: none;
  }
}
