/* =========================================
   BUSINESS PAGE STYLES
   ========================================= */

.filters-section {
  padding: 120px 0 40px; /* Account for fixed header */
  background: linear-gradient(to bottom, #0a0a0a, #111);
  border-bottom: 1px solid #222;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.filter-group {
  position: relative; /* Needed for dropdown positioning */
}

.filter-group label {
  display: block;
  color: var(--text-gray);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 10px 15px;
  background: #000;
  border: 1px solid #333;
  color: #fff;
  border-radius: 8px;
  font-family: var(--font-body);
}

.filter-input:focus,
.filter-select:focus {
  border-color: var(--primary-neon);
  outline: none;
}

/* --- CUSTOM MULTI-SELECT DROPDOWN --- */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-btn {
  width: 100%;
  padding: 10px 15px;
  background: #000;
  border: 1px solid #333;
  color: #fff;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.dropdown-btn:hover {
  border-color: #555;
}

.dropdown-btn::after {
  content: "\f078"; /* FontAwesome Chevron Down */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.8rem;
  color: #666;
}

.dropdown-content {
  display: none; /* Hidden by default */
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  margin-top: 5px;
  z-index: 100;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Show when active */
.custom-dropdown.active .dropdown-content {
  display: block;
}

.custom-dropdown.active .dropdown-btn {
  border-color: var(--primary-neon);
}

/* Checkbox Item Styling inside Dropdown */
.checkbox-item {
  display: flex;
  align-items: center;
  padding: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #ddd;
  border-radius: 4px;
  transition: background 0.2s;
}

.checkbox-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.checkbox-item input {
  margin-right: 10px;
  accent-color: var(--primary-neon);
  width: 16px;
  height: 16px;
}

/* Business Grid */
.business-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 40px 0;
}

.business-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.business-card:hover {
  transform: translateY(-5px);
  border-color: var(--secondary-neon);
  box-shadow: 0 10px 30px rgba(0, 255, 255, 0.1);
}

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gradient-main);
  color: #000;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-img {
  width: 100%;
  /* Removed fixed height: 200px */
  aspect-ratio: 3 / 2; /* Sets the 3:2 width-to-height ratio */
  object-fit: cover;
  background: #222;
  transition: transform 0.5s ease;
}

.business-card:hover .card-img {
  transform: scale(1.05);
}

.card-img-wrapper {
  overflow: hidden;
  position: relative;
}

.card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  color: var(--text-gray);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1rem;
  align-items: center;
}

.card-meta span {
  display: flex;
  align-items: center;
}

.card-meta i {
  color: var(--primary-neon);
  margin-right: 6px;
  font-size: 0.9rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto; /* Pushes tags to bottom if content is short */
}

.tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  color: #ccc;
  text-transform: uppercase;
}

/* Modal specific styling */
.modal-content-wrapper {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.modal-left-col {
  flex: 1;
  min-width: 250px;
  position: relative;
  overflow: visible !important; /* Allow logo to hang out */
}

.modal-right-col {
  flex: 1.5;
  min-width: 250px;
}

.modal-cover-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid #333;
}

/* Circular Logo on Modal - UPDATED */
.modal-logo-circle {
  position: absolute;
  bottom: -20px; /* Hang off the bottom edge */
  right: 10px; /* Right align */
  width: 60px; /* Smaller size */
  height: 60px;
  border-radius: 50%;
  background: #000;
  border: 2px solid #333; /* No pink outline, just dark border */
  object-fit: cover;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
  z-index: 10;
}

.modal-section-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
}

.modal-contact-item {
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.modal-contact-item i {
  color: var(--secondary-neon);
  margin-top: 4px;
}

.modal-website-link {
  color: var(--secondary-neon);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: 0.3s;
}

.modal-website-link:hover {
  border-color: var(--secondary-neon);
}

.modal-desc-box {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #ddd;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: #333 #000;
}

/* Modal Gallery */
.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 1rem;
}

.modal-gallery img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid transparent;
}

.modal-gallery img:hover {
  transform: scale(1.05);
  border-color: var(--primary-neon);
}

/* Media Viewer (Lightbox) - UPDATED for Navigation */
.media-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 11000; /* Higher than modal */
  display: none;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  animation: fadeIn 0.3s ease;

  /* Flexbox for positioning arrows next to image */
  flex-direction: row;
  gap: 20px;
}

.media-viewer-img {
  max-width: 80%; /* Reduced width to fit arrows */
  max-height: 90%;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
  border: 2px solid #333;
  animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 1;
}

.media-viewer-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 11003;
}

.media-viewer-nav {
  /* Static relative positioning for flexbox layout */
  position: static;
  transform: none;
  color: #fff;
  font-size: 2rem;
  padding: 0;
  cursor: pointer;
  z-index: 11002;
  transition: color 0.3s;
  background: rgba(0, 0, 0, 0.5); /* Slight background for visibility */
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.media-viewer-nav:hover {
  color: var(--primary-neon);
  background: rgba(0, 0, 0, 0.8);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes scaleUp {
  from {
    transform: scale(0.8);
  }
  to {
    transform: scale(1);
  }
}

/* Loading Screen */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  flex-direction: column;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-neon);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Result count styling */
.result-count-label {
  margin-top: 1rem;
  text-align: right;
  color: #666;
  font-size: 0.9rem;
  font-family: var(--font-body);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .modal-content-wrapper {
    flex-direction: column;
  }

  .filters-section {
    padding-top: 100px;
  }

  .modal-logo-circle {
    bottom: -15px;
    right: 10px;
  }

  /* Mobile: Full width image, absolute arrows */
  .media-viewer-img {
    max-width: 100%;
    max-height: 80%;
  }

  .media-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
  }

  .media-viewer-nav.prev {
    left: 10px;
  }
  .media-viewer-nav.next {
    right: 10px;
  }
}

.modal-contact-item {
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* Ensure map button link behaves like website link */
#bm-map-btn {
  color: var(--secondary-neon);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: 0.3s;
}

#bm-map-btn:hover {
  border-color: var(--secondary-neon);
}

/* Add these styles to your businesses.css file to fix modal scrolling */

/* Modal Overlay - should allow scrolling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Changed from center to flex-start */
  overflow-y: auto; /* Enable vertical scrolling */
  padding: 20px 0; /* Add padding top/bottom for breathing room */
}

/* Modal Box - constrain height and enable internal scrolling */
.modal-box {
  position: relative;
  background: var(--bg-card, #1a1a1a);
  border-radius: 16px;
  padding: 2rem;
  max-width: 800px;
  width: 90%;
  max-height: calc(
    100vh - 40px
  ); /* Leave 40px space (20px top + 20px bottom) */
  overflow-y: auto; /* Enable scrolling inside modal */
  margin: auto; /* Center vertically when content is smaller than viewport */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);

  /* Custom scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: #333 #000;
}

/* Webkit scrollbar styling for modal */
.modal-box::-webkit-scrollbar {
  width: 8px;
}

.modal-box::-webkit-scrollbar-track {
  background: #000;
  border-radius: 4px;
}

.modal-box::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.modal-box::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Close button - keep it fixed at top right of modal */
.close-modal {
  position: sticky; /* Changed from absolute to sticky */
  top: 0;
  right: 0;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  z-index: 10001;
  float: right;
  line-height: 1;
  margin-bottom: 1rem;
}

.close-modal:hover {
  color: var(--primary-neon, #ff00ff);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 10px 0;
  }

  .modal-box {
    width: 95%;
    max-height: calc(100vh - 20px);
    padding: 1.5rem;
  }

  .close-modal {
    font-size: 1.5rem;
  }
}
/* =========================================
   MOBILE FILTER COLLAPSE STYLES
   ========================================= */

/* Default: Hide Mobile Bar on Desktop */
.mobile-filter-bar {
  display: none;
}

/* DESKTOP (Larger than 768px) */
@media (min-width: 769px) {
  .filters-grid {
    display: grid !important; /* Always show grid on desktop */
  }
}

/* MOBILE (768px and smaller) */
@media (max-width: 768px) {
  /* Show Mobile Bar */
  .mobile-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
  }

  /* Style Mobile Search Input */
  .mobile-search {
    flex: 1; /* Take available space */
    border: 1px solid #444;
  }

  /* Style Toggle Button */
  .filter-toggle-btn {
    background: #222;
    border: 1px solid #444;
    color: var(--primary-neon, #fff); /* Fallback to white if var not found */
    padding: 0 15px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body, sans-serif);
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.3s ease;
  }

  .filter-toggle-btn.active {
    background: var(--primary-neon, #0ff);
    color: #000;
    border-color: var(--primary-neon, #0ff);
  }

  /* Hide Desktop Search Group on Mobile */
  .desktop-only-search {
    display: none;
  }

  /* Hide the Main Grid by Default on Mobile */
  #main-filters-grid {
    display: none;
    grid-template-columns: 1fr; /* Stack vertically */
    gap: 15px;
    background: #111;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
    margin-top: 10px;
    animation: slideDown 0.3s ease-out;
  }

  /* When Toggled Active */
  #main-filters-grid.active {
    display: grid;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
