/* Custom styles */

button, 
input[type="submit"],
input[type="button"],
.btn,
a.btn,
button.btn,
.button,
a.button {
  cursor: pointer;
}

header {
  /* position: fixed; */
  /* top: 1em; */
}

main {
  margin: 0 auto 120px auto !important;
}

.ts-wrapper.multi.has-items .ts-control {
  padding: calc(0.6rem - 5px);
}

.primary-nav {
  pointer-events: none;
  z-index: 1000;
  transform: none;
  bottom: max(0.5rem, env(safe-area-inset-bottom));
  /* position: fixed; */
  /* bottom: 10px; */
}

.primary-nav-items {
  pointer-events: auto;
  background-color: rgba(255, 255, 255, 0.6); /* semi-transparent */
  backdrop-filter: blur(20px); /* adds blur to the background */
  -webkit-backdrop-filter: blur(20px); /* for Safari */
}

/* Ensure map is visible and positioned correctly */
#map {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* Map needs to be accessible */
}

/* Make content backgrounds semi-transparent to show map */
/* .bg-white {
  background-color: rgba(255, 255, 255, 0.95) !important;
} */

.bg-gray-50 {
  background-color: rgba(249, 250, 251, 0.95);
}

/* Content should be above map but allow clicks through empty areas (desktop only) */
@media (min-width: 768px) {
  header, main {
    z-index: 10 ;
    pointer-events: none; /* Allow clicks to pass through */
  }

  /* Only actual content should capture clicks */
  header *, main * {
    pointer-events: auto;
  }

  /* Containers should not block clicks */
  .container {
    pointer-events: none;
  }

  .container > * {
    pointer-events: auto;
  }
}

/* On mobile, ensure main container doesn't interfere */
@media (max-width: 767px) {
  main {
    padding: 10px;
    margin: 0;
  }

   header, main {
    z-index: 10;
    pointer-events: none; /* Allow clicks to pass through */
  }

  /* Only actual content should capture clicks */
  header *, main * {
    pointer-events: auto;
  }

  /* Containers should not block clicks */
  .container {
    pointer-events: none;
  }

  /* But container content should be clickable */
  .container > * {
    pointer-events: auto;
  }

  /* Main Cerca header - clear background to match desktop */

  header .container {
    padding-bottom: 0;
    width: 100%;
  }

  header nav {
    padding-bottom: 0;
  }

  .mobile-header-icon {
    width: 1.5rem; /* 24px */
    height: 1.5rem; /* 24px */
  }
}

/* Mapbox Popup Styling */
.mapboxgl-popup-content {
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 0;
}

.mapboxgl-popup-close-button {
  font-size: 24px;
  padding: 8px 12px;
  color: #6B7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  right: 4px;
  top: 4px;
}

.mapboxgl-popup-close-button:hover {
  color: #1F2937;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
}

.mapboxgl-popup-tip {
  border-top-color: white;
}

/* Hide Mapbox's default geolocate control since we have a custom one */
.mapboxgl-ctrl-geolocate {
  display: none;
}

/* Custom location button active state */
#custom-locate-button:active {
  transform: scale(0.95);
}

#custom-locate-button:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* ========================================
   MOBILE-SPECIFIC STYLES
   ======================================== */

/* Mobile Layout Adjustments */
@media (max-width: 767px) {
  /* Bottom navigation - smaller on mobile */
  .primary-nav-items {
    width: 340px; /* Reduced from 400px */
    padding: 10px 16px; /* Reduced padding */
    margin-bottom: 12px; /* Reduced margin */
  }

  .primary-nav-items svg {
    width: 20px; /* Slightly smaller icons */
    height: 20px;
  }

  .primary-nav-items .text-xs {
    font-size: 0.7rem; /* Smaller text */
  }

  .primary-nav-items .flex.flex-col.items-center.gap-1 {
    gap: 0.25rem; /* Tighter spacing */
  }

  .primary-nav-items .w-8.h-8 {
    width: 28px; /* Smaller add button */
    height: 28px;
  }

  /* Hide desktop header elements on mobile */
  header.desktop-header {
    display: none;
  }
}