/**
 * Download Festival Vendors CSS
 * A refactored, modular approach to the vendors page styling
 * 
 * This CSS file was created as part of a refactoring effort to:
 * 1. Extract inline CSS from vendors.html into a standalone file
 * 2. Organize the styles using a clean, modular structure
 * 3. Fix responsive design issues, particularly for mobile devices
 * 4. Ensure vendors "bubbles" stack vertically on small screens
 * 5. Improve maintainability and readability of the codebase
 * 
 * The refactored CSS also works alongside vendor-grid-responsive.js to ensure
 * consistent behavior across different devices and screen sizes.
 */

/* =======================================================
   TABLE OF CONTENTS
   =======================================================
   1. CSS Variables / Custom Properties
   2. Base / Reset Styles
   3. Layout Components
   4. Bubble Components (Common Styles)
   5. Zone Selector Bubbles
   6. Category/Type Selector Bubbles
   7. Vendor Bubbles
   8. Navigation Elements
   9. Popup/Modal Styles
   10. Animations
   11. Media Queries / Responsive Design
   ======================================================= */

/* =======================================================
   1. CSS Variables / Custom Properties
   ======================================================= */
:root {
  /* Color palette */
  --primary-color: #23bfcf;
  --primary-glow: rgba(35, 191, 207, 0.5);
  --primary-glow-transparent: rgba(35, 191, 207, 0);
  --accent-color: #00ffc3;
  --accent-glow: rgba(0, 255, 195, 0.5);
  --accent-glow-transparent: rgba(0, 255, 195, 0);
  --black-bg: #000;
  
  /* Animation */
  --transition-smooth: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  
  /* Border radius */
  --border-radius-bubble: 50%;
  --border-radius-text: 12px;
  
  /* Element sizing */
  --bubble-size-default: 180px;
  --bubble-size-tablet: 140px;
  --bubble-size-mobile: 110px;
  --bubble-size-small: 100px;
  
  /* Z-index layers */
  --z-index-base: 1;
  --z-index-bubble: 3;
  --z-index-bubble-content: 4;
  --z-index-back-button: 15;
  --z-index-popup: 100;
  --z-index-overlay: 99;
}

/* =======================================================
   2. Base / Reset Styles
   ======================================================= */
body.vendors-page {
  margin: 0;
  padding: 0 !important; /* Override any padding from other styles */
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)),
    url("../assets/timetable_background.png") center/cover no-repeat fixed;
  overflow: hidden !important; /* Force hidden overflow */
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: white;
  perspective: 1000px;
  width: 100%;
  height: 100vh;
  position: fixed; /* Prevent body scrolling */
}

/* =======================================================
   3. Layout Components
   ======================================================= */
/* Floating particles background */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-index-base);
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent-color);
  border-radius: 50%;
  animation: float-particle 8s infinite ease-in-out;
  opacity: 0.3;
}

/* Main container for all content */
.content-container {
  position: fixed;
  top: 80px;
  left: 0;
  width: 100vw; /* Use viewport width */
  height: calc(100vh - 80px);
  display: grid;
    grid-template-columns: 1fr; 
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  z-index: 10; /* Ensure it's above other elements */
}

/* Common selector styles for zone, category and type selectors */
.selector-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  transition: var(--transition-smooth);
  z-index: var(--z-index-base);
  padding-top: 80px;
  box-sizing: border-box;
}

.zone-selector,
.category-selector,
#typeSelector,
#vendorGrid {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  animation: morphIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Vendor grid layout */
.vendor-grid {
  position: relative;
  display: none;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  max-width: 90vw;
  overflow-y: auto;
  z-index: var(--z-index-base);
  animation: cascadeIn 0.6s ease forwards;
  padding-top: 80px;
  max-width: 1200px;
}

/* Utility class for mobile vendor grid */
/* .vendor-grid-mobile {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  width: 100% !important;
} */

/* =======================================================
   4. Bubble Components (Common Styles)
   ======================================================= */
.bubble {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  border-radius: var(--border-radius-bubble);
  background: var(--black-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  transform-style: preserve-3d;
  position: relative;
  overflow: visible;
  text-align: center;
  color: white;
  z-index: var(--z-index-bubble);
  outline: none;
  border: none;
  box-shadow: none;
  will-change: transform;
  margin: 0 auto;
  max-width: 180px;
}

/* Common glow effect for all bubbles */
.bubble::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-bubble);
  transform: translate(-50%, -50%) scale(1.3);
  z-index: -1;
  pointer-events: none;
  animation: pulse 3s infinite ease-in-out;
  animation-delay: var(--animation-delay, 0s);
  transition: var(--transition-smooth);
}

/* Bubble hover effects */
.bubble:hover {
  transform: scale(1.05);
}

.bubble:hover::after {
  transform: translate(-50%, -50%) scale(1.5);
  opacity: 0.9;
  transition: var(--transition-smooth);
}

/* Common text styles for bubble text */
.bubble-text {
  position: relative;
  z-index: var(--z-index-bubble-content);
  background: rgba(0, 0, 0, 0.8);
  padding: 10px 16px;
  border-radius: var(--border-radius-text);
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  transition: var(--transition-smooth);
  will-change: transform;
}

.bubble:hover .bubble-text {
  transform: scale(1.05);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 3px 0 rgba(255, 255, 255, 0.2);
  transition: var(--transition-smooth);
}

/* =======================================================
   5. Zone Selector Bubbles
   ======================================================= */
.zone-bubble::after {
  background: radial-gradient(
    circle,
    var(--primary-glow) 0%,
    var(--primary-glow-transparent) 70%
  );
  animation-name: pulseCyan;
}

.zone-bubble:focus {
  outline: none;
  box-shadow: 0 0 50px var(--accent-color),
    0 0 100px var(--accent-color),
    inset 0 0 30px rgba(0, 255, 195, 0.2),
    0 20px 40px rgba(0, 0, 0, 0.3);
}

.zone-text {
  font-size: 1.1rem;
  border: 2px solid rgba(35, 191, 207, 0.5);
  color: var(--primary-color);
}

.zone-bubble:hover .zone-text {
  border-color: rgba(35, 191, 207, 0.8);
}

/* =======================================================
   6. Category/Type Selector Bubbles
   ======================================================= */
.category-bubble::after {
  background: radial-gradient(
    circle,
    var(--primary-glow) 0%,
    var(--primary-glow-transparent) 70%
  );
  animation-name: pulseCyan;
}

.category-bubble {
  flex-direction: column;
  font-size: 0.9rem;
  font-weight: 600;
}

.category-bubble .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  transition: transform 0.3s ease;
  position: relative;
  z-index: var(--z-index-base);
}

.category-bubble:hover .icon {
  transform: scale(1.1);
}

.type-text {
  position: relative;
  z-index: var(--z-index-bubble-content);
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 8px;
  border-radius: 10px;
  backdrop-filter: blur(15px);
  border: 2px solid rgba(35, 191, 207, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-color);
  transition: var(--transition-smooth);
}

.category-bubble:hover .type-text {
  transform: scale(1.05);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 3px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(35, 191, 207, 0.8);
}

/* =======================================================
   7. Vendor Bubbles
   ======================================================= */
.vendor-bubble {
    width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: var(--black-bg);
  box-shadow: 0 0 15px var(--primary-glow),
    0 0 30px rgba(35, 191, 207, 0.2),
    inset 0 0 10px rgba(35, 191, 207, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  animation: popIn 0.5s ease forwards;
  opacity: 0;
  transform: scale(0);
  transition: var(--transition-smooth);
  position: relative;
  padding: 10px;
  line-height: 1.2;
  animation-fill-mode: both;
}

.vendor-bubble::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-bubble);
  transform: translate(-50%, -50%) scale(1.3);
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    circle,
    var(--primary-glow) 0%,
    var(--primary-glow-transparent) 70%
  );
  animation: pulseCyan 3s infinite ease-in-out;
  animation-delay: var(--animation-delay, 0s);
  transition: var(--transition-smooth);
}

.vendor-bubble:hover {
  transform: scale(1.1);
}

.vendor-bubble:hover::after {
  transform: translate(-50%, -50%) scale(1.5);
  opacity: 0.9;
}

.vendor-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.vendor-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  transition: transform 0.3s ease;
}

.vendor-name {
  position: relative;
  z-index: var(--z-index-bubble-content);
  background: rgba(0, 0, 0, 0.8);
  padding: 6px 10px;
  border-radius: 10px;
  backdrop-filter: blur(15px);
  border: 2px solid rgba(35, 191, 207, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-color);
  transition: var(--transition-smooth);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vendor-bubble:hover .vendor-icon {
  transform: scale(1.1);
}

.vendor-bubble:hover .vendor-name {
  transform: scale(1.05);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 3px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(35, 191, 207, 0.8);
}

/* =======================================================
   8. Navigation Elements
   ======================================================= */

/* Main Navigation Bar */
#main-nav-placeholder {
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 255, 195, 0.2) !important;
    border-bottom: 1px solid rgba(35, 191, 207, 0.3) !important;
}

.main-nav {
  width: 100% !important;
  height: 80px !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 20px !important;
  z-index: 200 !important;
}

/* Logo styling */
.main-nav-logo {
  height: 60px !important;
  display: flex !important;
  align-items: center !important;
}

.main-nav-logo img {
  height: 40px !important;
  max-width: 180px !important;
  object-fit: contain !important;
}

/* Countdown styling */
.main-nav-countdown {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.countdown-label {
  font-size: 0.8rem !important;
  color: rgba(255, 255, 255, 0.7) !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  font-weight: 500 !important;
}

.countdown-timer {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: var(--accent-color) !important;
  text-shadow: 0 0 10px rgba(0, 255, 195, 0.5) !important;
}

.countdown-timer span {
  display: inline-block !important;
  min-width: 25px !important;
  text-align: center !important;
  font-weight: 800 !important;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  width: 50px !important;
  height: 50px !important;
  background: rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(35, 191, 207, 0.4) !important;
  border-radius: 10px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  padding: 10px !important;
  z-index: 201 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 15px rgba(35, 191, 207, 0.2) !important;
}

.sidebar-toggle span {
  display: block !important;
  width: 100% !important;
  height: 2px !important;
  background-color: var(--primary-color) !important;
  margin: 3px 0 !important;
  transition: all 0.3s ease !important;
  border-radius: 2px !important;
  box-shadow: 0 0 8px rgba(35, 191, 207, 0.5) !important;
}

.sidebar-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg) !important;
  background-color: var(--accent-color) !important;
}

.sidebar-toggle.active span:nth-child(2) {
  opacity: 0 !important;
}

.sidebar-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg) !important;
  background-color: var(--accent-color) !important;
}

.sidebar-toggle:hover {
  border-color: var(--accent-color) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 
              0 0 25px rgba(35, 191, 207, 0.4) !important;
}

.sidebar-toggle.active {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 20px var(--accent-color),
              0 0 40px rgba(0, 255, 195, 0.2) !important;
}

/* Sidebar Menu */
.sidebar-menu {
  position: fixed !important;
  top: 80px !important; /* Below the main nav */
  right: 0 !important; /* Changed from left to right */
  left: auto !important; 
  width: 280px !important;
  height: calc(100vh - 80px) !important;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  z-index: 100 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  transform: translateX(100%) !important; /* Changed to slide from right */
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  display: flex !important;
  flex-direction: column !important;
  border-left: 1px solid rgba(35, 191, 207, 0.2) !important; /* Changed from border-right */
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5) !important; /* Changed shadow direction */
}

/* Sidebar neon edge */
.sidebar-menu::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important; /* Changed from right to left */
  height: 100% !important;
  width: 3px !important;
  background: linear-gradient(to bottom, 
    var(--accent-color), 
    var(--primary-color), 
    var(--accent-color)) !important;
  box-shadow: 0 0 20px var(--accent-color), 
              0 0 40px var(--accent-color) !important;
  z-index: 1 !important;
}

/* When sidebar is open */
body:not(.sidebar-closed) .sidebar-menu {
  transform: translateX(0) !important;
}

/* REMOVE or COMMENT OUT these margin adjustments that cause the content to shift */
@media (min-width: 769px) {
  .content-container {
    margin-right: 0 !important; 
    width: 100% !important;
  }
  
  /* Remove this rule that shifts content */
  /*
  body:not(.sidebar-closed) .content-container {
    margin-right: 280px !important;
    width: calc(100vw - 280px) !important;
  }
  */
  
  /* Keep other styles as needed */
  /* ...existing code... */
}

/* =======================================================
   9. Popup/Modal Styles
   ======================================================= */
.popup {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 0 50px var(--accent-color),
    0 0 100px rgba(0, 255, 195, 0.3),
    inset 0 0 30px rgba(0, 255, 195, 0.1);
  z-index: var(--z-index-popup);
  width: 80%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0;
  box-sizing: border-box;
  margin: 0;
}

.popup.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.popup h3 {
  margin: 0;
  color: var(--accent-color);
  font-size: 1.4rem;
  font-weight: 700;
}

.popup-close {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 1.8rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-close:hover {
  transform: scale(1.2) rotate(90deg);
}

.popup-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 15px;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.popup-section {
  margin-bottom: 1.5rem;
}

.popup-section h4 {
  color: #ff6b6b;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.popup-description {
  color: #ccc;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.popup-details {
  display: grid;
  gap: 0.8rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.detail-icon {
  font-size: 1.2rem;
  color: #4ecdc4;
  width: 20px;
  text-align: center;
}

.menu-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.menu-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 10px;
  border-left: 3px solid #4ecdc4;
}

.menu-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.menu-item-name {
  font-weight: 600;
  color: var(--accent-color);
}

.menu-item-price {
  font-weight: 700;
  color: #ff6b6b;
}

.menu-item-description {
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.3;
}

.dietary-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.dietary-tag {
  background: #4ecdc4;
  color: #000;
  padding: 0.2rem 0.5rem;
  border-radius: 15px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  backdrop-filter: blur(5px);
  z-index: var(--z-index-overlay);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.popup-overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* =======================================================
   10. Animations
   ======================================================= */
@keyframes float-particle {
  0%, 100% {
    transform: translateY(100vh) translateX(0) scale(0.5);
    opacity: 0;
  }
  50% {
    opacity: 0.8;
    transform: translateY(0) translateX(50px) scale(1);
  }
}

@keyframes pulseCyan {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.9;
  }
}

@keyframes morphIn {
  0% {
    opacity: 0;
    transform: scale(0.3) rotateY(90deg);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1) rotateY(0deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
  }
}

@keyframes cascadeIn {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0) rotateZ(180deg);
  }
  70% {
    transform: scale(1.1) rotateZ(0deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateZ(0deg);
  }
}

@keyframes slideOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0) rotateY(90deg);
  }
}

@keyframes backButtonIn {
  0% {
    opacity: 0;
    transform: translateX(calc(-50% + -42% - 50px)) !important;
  }
  70% {
    transform: translateX(calc(-50% + -42% + 25px)) !important;
  }
  100% {
    opacity: 1;
    transform: translateX(calc(-50% + -42% + 20px)) !important;
  }
}

/* =======================================================
   11. Media Queries / Responsive Design
   ======================================================= */
@media (max-width: 1366px) {
    .selector-grid {
        padding-top: 30px;
    }

    #typeSelector {
        padding-top:120px;
    }

    .category-selector {
        padding-top: 120px;
    }
}

@media (max-width: 991px) {
    .zone-selector,
    .category-selector,
    #typeSelector,
    #vendorGrid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Tablet-sized screens */
@media (max-width: 768px) {
  body.vendors-page {
    overflow: hidden; /* Prevent body scroll */
  }

  .main-nav {
    height: 150px !important;
  }

  .content-container {
    top: 160px;
    height: calc(100vh - 120px);
    padding: 10px;
    width: 100vw; /* Use viewport width */
    left: 0;
    margin: 0;
    overflow-x: hidden;
  }

  .bubble-text {
    padding: 12px 20px;
    font-size: 1rem;
    letter-spacing: 1px;
  }

  .category-bubble .icon {
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
  }

  .vendor-grid {
    max-width: calc(100vw - 30px); /* Prevent overflow */
    padding-top: 80px;
    gap: 1.2rem;
  }

  .popup {
    width: 95vw;
    max-width: none;
    max-height: calc(100vh - 40px);
    padding: 1.5rem;
    margin: 10px;
    border-radius: 15px;
  }

  .popup-image {
    height: 150px;
    margin-bottom: 1rem;
  }

  .popup h3 {
    font-size: 1.2rem;
  }

  .popup-close {
    font-size: 1.6rem;
    width: 35px;
    height: 35px;
    min-width: 44px;
    min-height: 44px;
  }
}

/* Mobile-sized screens */
@media (max-width: 640px) {
  .content-container {
    top: 132px;
    height: calc(100vh - 80px);
    width: 100vw;
    padding: 0;
    overflow-x: hidden;
  }

  .selector-grid,
  #vendorGrid {
    gap: 2rem;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0;
    box-sizing: border-box;
    padding-top: 30px;
  }

  #vendorGrid {
    padding-top: 100px;
  }

  .bubble {
    font-size: 0.9rem;
  }

  .back-button {
    top: 90px;
    left: 20px;
    padding: 10px 16px;
    font-size: 0.9rem;
    z-index: 20; /* Ensure it's above other content */
  }
}

/* Small mobile screens */
@media (max-width: 480px) {
  body.vendors-page {
    padding: 0 !important;
    overflow: hidden !important;
    width: 100vw;
    position: fixed;
  }

  .content-container {
    top: 132px;
    height: calc(100vh - 80px);
    padding: 0;
    width: 100vw;
    left: 0;
    overflow-x: hidden !important;
    position: fixed;
  }

  .selector-grid,
  #vendorGrid {
    gap: 0.8rem;
    grid-template-columns: 1fr;
    padding-top: 40px;
  }

  #vendorGrid {
    padding-top: 100px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .selector-grid,
  #vendorGrid {
    grid-template-columns: 1fr; /* Keep 2 columns */
    gap: 0.6rem;
    padding: 10px;
    padding-top: 60px;
  }
}

/* Add this important fix to make sure vendor grid doesn't cause horizontal scrolling */
#vendorGrid {
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Fix header and navigation layout for vendors page */
#navigation-placeholder {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100% !important;
  z-index: 100 !important;
}

/* Additional fix for the Tailwind padding that might be causing issues */
.p-2,
.p-4,
.sm\:p-4 {
  padding: 0 !important;
}

/* Back Button - Updated positioning with edge alignment */
.back-button {
  position: fixed !important;
  top: 100px; /* Position below the main nav */
  left: 20px !important; /* Align with the logo's left edge */
  background: rgba(0, 0, 0, 0.7) !important;
  color: var(--accent-color) !important;
  border: 2px solid var(--accent-color) !important;
  padding: 10px 20px !important;
  border-radius: 30px !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  letter-spacing: 1px !important;
  transition: all 0.3s ease !important;
  z-index: var(--z-index-back-button) !important;
  opacity: 0 !important;
  box-shadow: 0 0 15px rgba(0, 255, 195, 0.3) !important;
  text-shadow: 0 0 8px rgba(0, 255, 195, 0.5) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none !important; /* Initially not clickable */
  font-family: 'Rajdhani', sans-serif;
  text-transform: uppercase;
  font-size: 1.1rem;
  transform: translateY(-100px);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.back-button::before {
  content: "" !important;
  position: absolute !important;
  inset: -2px !important;
  background: linear-gradient(45deg, var(--accent-color), transparent, var(--accent-color)) !important;
  z-index: -1 !important;
  filter: blur(8px) !important;
  opacity: 0.5 !important;
  border-radius: 30px !important;
  transition: opacity 0.3s ease !important;
}

.back-button.show {
  transform: translateY(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important; /* Make it clickable when shown */
}

.back-button:hover {
  background-color: rgba(0, 255, 208, 0.2) !important;
  box-shadow: 0 0 20px rgba(0, 255, 208, 0.7) !important;
  transform: scale(1.05) !important;
}

.back-button:hover::before {
  opacity: 0.8 !important;
}

/* Media queries for the back button */
@media (max-width: 768px) {
  .back-button {
    top: 170px;
    left: 20px !important; /* Maintain alignment with logo */
    padding: 10px 18px !important;
    font-size: 0.95rem !important;
    min-width: 44px !important;
    min-height: 44px !important;
    z-index: 900 !important;
  }
}

@media (max-width: 640px) {
#typeSelector {
    grid-template-columns: repeat(2, 1fr);
}

#categorySelector {
    padding-top: 120px;
}

  .back-button {
    top: 170px; /* Position below stacked nav */
    left: 20px !important; /* Keep consistent with logo alignment */
    padding: 8px 16px !important;
    font-size: 0.9rem !important;
  }
}

@media (max-width: 480px) {
  .back-button {
    left: 20px; /* Keep consistent alignment with logo edge */
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
  }

  #typeSelector {
    grid-template-columns: 1fr;
}
}

/* Add specific alignment to match the logo's edge precisely */
@media (max-width: 400px) {

  .back-button {
    left: 15px; /* Fine-tune for very small screens if logo edge changes */
  }
}