/*
Theme Name: Halaalified
Theme URI: https://halaalified.com
Author: Halaalified
Author URI: https://halaalified.com
Description: A custom theme for Halal Restaurants website.
Version: 1.4.1
Text Domain: halal-restaurants
*/

/* ===== MODERN TOGGLE FILTER BUTTONS ===== */

.filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: #8b5b5d;
  background-color: #f1e9ea;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  min-height: 44px; /* Touch-friendly minimum */
  min-width: 44px;
  white-space: nowrap;
}

.filter-toggle:hover {
  background-color: #e8d9da;
  border-color: #994d51;
}

.filter-toggle:focus {
  outline: 2px solid #994d51;
  outline-offset: 2px;
}

.filter-toggle:active {
  transform: scale(0.98);
}

/* Active state */
.filter-toggle.active {
  color: #ffffff;
  background-color: #994d51;
  border-color: #994d51;
  font-weight: 600;
}

.filter-toggle.active:hover {
  background-color: #8b5b5d;
  border-color: #8b5b5d;
}

/* Disabled state */
.filter-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Filter text styling */
.filter-toggle-text {
  user-select: none;
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .filter-toggle {
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
  }
}

/* ===== PHASE 2: Skeleton Loader Styles ===== */

/* Skeleton card container */
.skeleton-card {
  display: block;
  flex-shrink: 0;
  animation: fadeIn 0.3s ease-in;
}

/* Base skeleton element */
.skeleton-image,
.skeleton-text {
  position: relative;
  overflow: hidden;
  background-color: #e8e8e8;
}

/* Skeleton image placeholder */
.skeleton-image {
  background: linear-gradient(
    110deg,
    #e8e8e8 0%,
    #e8e8e8 45%,
    #f5f5f5 50%,
    #e8e8e8 55%,
    #e8e8e8 100%
  );
  background-size: 200% 100%;
  background-attachment: fixed;
  animation: shimmer 2s ease-in-out infinite;
}

/* Skeleton text placeholders */
.skeleton-text {
  border-radius: 4px;
  background: linear-gradient(
    110deg,
    #e8e8e8 0%,
    #e8e8e8 45%,
    #f5f5f5 50%,
    #e8e8e8 55%,
    #e8e8e8 100%
  );
  background-size: 200% 100%;
  background-attachment: fixed;
  animation: shimmer 2s ease-in-out infinite;
}

/* GPU-accelerated shimmer animation */
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Fade in animation for content */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

/* Performance optimization hints */
.skeleton-image,
.skeleton-text {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Ensure smooth transitions when skeletons are replaced */
.skeleton-card {
  transition: opacity 0.3s ease-out;
}

/* ===== HORIZONTAL SCROLLING & UTILITIES ===== */

/* Hide scrollbar for horizontal scroll */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Line clamp utility */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  word-break: break-word;
}

/* ===== LAZY LOADING IMAGES ===== */

.lazy-image {
  background-color: #e8e8e8;
  position: relative;
}

.lazy-image.loaded {
  animation: fadeIn 0.3s ease-in;
}

/* ===== GLOBAL STYLES ===== */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading state animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Focus states for accessibility */
.form-input:focus,
.form-select:focus {
  outline: 2px solid #994d51;
  outline-offset: 2px;
}

/* Button hover effects */
button {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

button:active {
  transform: scale(0.98);
}

/* Card hover effects */
.group:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease-in-out;
}

/* ===== LOAD MORE BUTTON ===== */

#load-more-btn {
  position: relative;
  overflow: hidden;
}

#load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#load-more-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(153, 77, 81, 0.2);
}

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

/* Responsive skeleton adjustments */
@media (max-width: 640px) {
  .skeleton-card {
    width: 100%;
    max-width: 158px;
  }
  
  /* Adjust filter layout on mobile */
  #js-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  #js-filters > * {
    width: 100%;
  }
  
  .filter-toggle {
    width: 100%;
    justify-content: center;
  }
}

/* ===== ACCESSIBILITY ===== */

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .skeleton-image,
  .skeleton-text {
    animation: none;
    background: #e8e8e8;
  }
  
  .fade-in {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  html {
    scroll-behavior: auto;
  }
  
  button,
  .filter-toggle,
  .group:hover {
    transition: none;
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .filter-toggle {
    border-width: 3px;
  }
  
  .filter-toggle.active {
    border-color: #000000;
  }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
  /* Future dark mode styles can go here */
}

/* ===== PRINT STYLES ===== */

@media print {
  .skeleton-card,
  #js-filters,
  #load-more-container {
    display: none;
  }
  
  .filter-toggle {
    display: none;
  }
}

/* ===== UTILITY CLASSES ===== */

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible (keyboard navigation) */
.focus-visible:focus {
  outline: 2px solid #994d51;
  outline-offset: 2px;
}
/* ===== RESTAURANT PROFILE PAGE ADDITIONS ===== */

/* Fade-in animation with delays (matches halaalified.js pattern) */
.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
}

/* Animation already defined in style.css, but ensure consistency */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Restaurant profile specific spacing */
#restaurant-details {
  min-height: 60vh;
}

/* Loading state for restaurant profile */
#loading-state {
  animation: fadeIn 0.3s ease-in;
}

/* Ensure smooth transitions for hover states */
button,
a {
  transition: all 0.2s ease-in-out;
}

/* Brand color utilities (using existing Halaalified colors) */
.text-brand-primary {
  color: #994d51;
}

.bg-brand-primary {
  background-color: #994d51;
}

.border-brand-primary {
  border-color: #994d51;
}

.text-brand-text {
  color: #1b0e0e;
}

.bg-brand-light {
  background-color: #f1e9ea;
}

/* Hover effects for CTA buttons */
button:hover,
a:hover {
  transform: translateY(-1px);
}

button:active,
a:active {
  transform: translateY(0);
}

/* Focus states for accessibility (matching filter-toggle pattern) */
button:focus,
a:focus {
  outline: 2px solid #994d51;
  outline-offset: 2px;
}

/* Responsive adjustments for restaurant profile */
@media (max-width: 768px) {
  #restaurant-details {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Stack CTA buttons on mobile */
  #restaurant-details .flex.flex-wrap.gap-3 {
    flex-direction: column;
  }
  
  #restaurant-details .flex.flex-wrap.gap-3 button {
    width: 100%;
  }
}

/* Map iframe responsive container */
iframe[title="Restaurant Location"] {
  border-radius: 0.5rem;
}

/* Ensure skeleton loaders work on profile page */
#loading-state .skeleton-card {
  width: 100%;
  max-width: none;
}

#loading-state .skeleton-image,
#loading-state .skeleton-text {
  background: linear-gradient(
    110deg,
    #e8e8e8 0%,
    #e8e8e8 45%,
    #f5f5f5 50%,
    #e8e8e8 55%,
    #e8e8e8 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

/* Error state styling */
[role="alert"] {
  animation: fadeIn 0.3s ease-in;
}

/* Reduced motion support for restaurant profile */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  button:hover,
  a:hover {
    transform: none;
  }
  
  #loading-state .skeleton-image,
  #loading-state .skeleton-text {
    animation: none;
    background: #e8e8e8;
  }
}

/* Print styles for restaurant profile */
@media print {
  #loading-state,
  button,
  iframe {
    display: none !important;
  }
  
  #restaurant-details {
    padding: 0;
    max-width: 100%;
  }
  
  .border,
  .rounded-lg {
    border: 1px solid #ccc !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .border {
    border-width: 2px;
  }
  
  button {
    border-width: 2px;
  }
  
  .bg-brand-primary {
    background-color: #000000;
  }
}

/* Ensure SVG icons inherit color properly */
svg {
  stroke: currentColor;
}

/* Grid responsiveness */
.grid.md\:grid-cols-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid.md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Spacing utilities */
.space-y-3 > * + * {
  margin-top: 0.75rem;
}

/* Text truncation utility (ensure line-clamp works) */
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Break long words in addresses/URLs */
.break-all {
  word-break: break-all;
}

/* Ensure flex gap works */
.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

/* ============================================
   NEW: LOCATION SELECTOR STYLES (v1.2.0)
   ============================================ */

.location-wrapper {
  padding: 1rem;
  background: #fff;
  border-bottom: 1px solid #f1e9ea;
}

.location-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 2px solid #994d51;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  color: #1b0e0e;
  min-height: 48px;
}

.location-button:hover {
  background: #f9f5f6;
  border-color: #7a3d40;
}

.location-button:active {
  transform: scale(0.98);
}

.location-button:focus {
  outline: 2px solid #994d51;
  outline-offset: 2px;
}

.location-icon {
  font-size: 1.25rem;
}

.location-text {
  flex: 1;
  text-align: left;
  font-weight: 500;
}

.location-chevron {
  font-size: 0.75rem;
  color: #994d51;
  transition: transform 0.2s;
}

.location-button.open .location-chevron {
  transform: rotate(180deg);
}

.location-button.has-location {
  border-color: #4caf50;
  background: #f1f8f4;
}

.location-button.has-location .location-icon {
  color: #4caf50;
}

/* ============================================
   BOTTOM SHEET
   ============================================ */

.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.bottom-sheet-overlay.open {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 1rem 1rem 0 0;
  padding: 1.5rem;
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
  transform: translate3d(0, 100%, 0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  -webkit-overflow-scrolling: touch;
}

.bottom-sheet.open {
  transform: translate3d(0, 0, 0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 auto 1rem;
}

.bottom-sheet-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1b0e0e;
  margin-bottom: 1.5rem;
  text-align: center;
}

.use-current-location-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  background: #994d51;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1.5rem;
  min-height: 48px;
  transition: background 0.2s;
  touch-action: manipulation;
}

.use-current-location-btn:hover {
  background: #7a3d40;
}

.use-current-location-btn:active {
  transform: scale(0.98);
}

.use-current-location-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.use-current-location-btn .icon {
  font-size: 1.5rem;
}

.manual-address-section {
  margin-bottom: 1.5rem;
}

.manual-address-label {
  display: block;
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.manual-address-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  min-height: 44px;
}

.manual-address-input:focus {
  outline: none;
  border-color: #994d51;
  box-shadow: 0 0 0 3px rgba(153, 77, 81, 0.1);
}

.autocomplete-suggestions {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.autocomplete-suggestions.open {
  display: block;
}

.suggestion-item {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: #f9f5f6;
}

.suggestion-item:active {
  background: #f1e9ea;
}

.radius-selector {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f1e9ea;
}

.radius-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1b0e0e;
  margin-bottom: 0.75rem;
}

.radius-options {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.radius-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radius-option input[type="radio"] {
  display: none;
}

.radius-option label {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #f9f5f6;
  border: 2px solid #f1e9ea;
  border-radius: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radius-option input:checked + label {
  background: #994d51;
  border-color: #994d51;
  color: #fff;
}

.clear-location-btn {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  color: #994d51;
  border: 1px solid #994d51;
  border-radius: 0.5rem;
  cursor: pointer;
  margin-top: 1rem;
  font-size: 0.875rem;
  min-height: 44px;
}

.clear-location-btn:hover {
  background: #f9f5f6;
}

/* Desktop Overrides */
@media (min-width: 768px) {
  .bottom-sheet {
    position: absolute;
    left: 0;
    right: auto;
    bottom: auto;
    top: 100%;
    width: 400px;
    max-height: 500px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
    margin-top: 0.5rem;
  }
  
  .bottom-sheet-overlay {
    display: none;
  }
  
  .bottom-sheet-handle {
    display: none;
  }
}

.loading {
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #994d51;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Nearby Restaurants Prompt (when no location set) */
.nearby-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: #f9f5f6;
  border: 2px dashed #994d51;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.nearby-prompt-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.nearby-prompt-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1b0e0e;
  margin-bottom: 0.5rem;
}

.nearby-prompt-text {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1rem;
}

.nearby-prompt-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: #994d51;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.nearby-prompt-button:hover {
  background: #7a3d40;
}
/* ============================================
   CUISINE & FILTER PILLS (v1.4.1)
   - Horizontally scrollable pill list with fade
   - Compatible with role="switch" + aria-pressed/checked
   - Overrides .filter-toggle safely via ID selectors
   - Mobile-first, a11y + reduced-motion + high-contrast
   ============================================ */

/* Wrapper positions the right-side fade overlay */
.cuisine-pills-wrapper {
  position: relative;
  overflow: hidden;
}

/* Horizontal scroller with spacing */
.cuisine-pills-scroll {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
  scroll-snap-type: x proximity;   /* gentle snapping */
  touch-action: pan-x;              /* better touch scroll */
  scroll-padding-inline: 16px;      /* keep focused pill off the edge */
}

/* Hide scrollbar (webkit + firefox) */
.cuisine-pills-scroll::-webkit-scrollbar { display: none; }
.cuisine-pills-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* Right fade gradient to indicate overflow content */
.cuisine-pills-fade {
  position: absolute;
  top: 0;
  right: 0;
  width: 56px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), #ffffff);
}
/* Optional left fade, if needed */
.cuisine-pills-fade--left {
  left: 0;
  right: auto;
  background: linear-gradient(to left, rgba(255, 255, 255, 0), #ffffff);
}

/* ============================================
   FILTER PILLS ROW (v1.4.1)
   Groups Top Rated & Popular pills side-by-side
   ============================================ */

.filter-pills-row {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
  scroll-snap-type: x proximity;
  touch-action: pan-x;
  scroll-padding-inline: 16px;
}

/* Hide scrollbar */
.filter-pills-row::-webkit-scrollbar {
  display: none;
}
.filter-pills-row {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Base pill (also applied to the two filter IDs for consistency) */
.cuisine-pill,
#filter-toprated,
#filter-popularity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  height: 56px;
  min-height: 44px; /* touch target */
  padding: 12px 20px;

  border-radius: 28px;
  border: 2px solid #e5e7eb;
  background: transparent;
  color: #1b0e0e;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;

  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease-in-out, background-color 0.2s, border-color 0.2s, color 0.2s;

  /* smoother hover/press animations when lots of pills exist */
  will-change: transform;
  scroll-snap-align: start;
}

/* Hover/active/focus (match theme feel) */
.cuisine-pill:hover,
#filter-toprated:hover,
#filter-popularity:hover {
  transform: translateY(-1px);
  border-color: #994d51;
}
.cuisine-pill:active,
#filter-toprated:active,
#filter-popularity:active {
  transform: translateY(0);
}
.cuisine-pill:focus,
#filter-toprated:focus,
#filter-popularity:focus {
  outline: 2px solid #994d51;
  outline-offset: 2px;
}

/* Disabled */
.cuisine-pill:disabled,
#filter-toprated:disabled,
#filter-popularity:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== Selected states =====
   Support .selected/.active and ARIA pressed/selected/checked.
*/
.cuisine-pill.selected,
.cuisine-pill.active,
.cuisine-pill[aria-pressed="true"],
.cuisine-pill[aria-selected="true"],
.cuisine-pill[aria-checked="true"] {
  border-color: #994d51;
  background: #994d51;
  color: #ffffff;
}
.cuisine-pill.selected:hover,
.cuisine-pill.active:hover,
.cuisine-pill[aria-pressed="true"]:hover,
.cuisine-pill[aria-selected="true"]:hover,
.cuisine-pill[aria-checked="true"]:hover {
  background: #8b5b5d;
  border-color: #8b5b5d;
}

/* ===== Themed Filter Pills (IDs override .filter-toggle.active) ===== */

/* Top Rated (Amber) */
#filter-toprated {
  border-color: #fcd34d;   /* amber-300-ish */
  background: #fffaf0;     /* soft hint */
}
#filter-toprated.selected,
#filter-toprated.active,
#filter-toprated[aria-pressed="true"],
#filter-toprated[aria-selected="true"],
#filter-toprated[aria-checked="true"] {
  border-color: #f59e0b;   /* amber-500 */
  background: #f59e0b;
  color: #ffffff;
}
#filter-toprated.selected:hover,
#filter-toprated.active:hover,
#filter-toprated[aria-pressed="true"]:hover,
#filter-toprated[aria-selected="true"]:hover,
#filter-toprated[aria-checked="true"]:hover {
  background: #d97706;     /* amber-600 */
  border-color: #d97706;
}

/* Popular (Purple) */
#filter-popularity {
  border-color: #ddd6fe;   /* violet-200-ish */
  background: #faf5ff;     /* soft hint */
}
#filter-popularity.selected,
#filter-popularity.active,
#filter-popularity[aria-pressed="true"],
#filter-popularity[aria-selected="true"],
#filter-popularity[aria-checked="true"] {
  border-color: #8b5cf6;   /* violet-500 */
  background: #8b5cf6;
  color: #ffffff;
}
#filter-popularity.selected:hover,
#filter-popularity.active:hover,
#filter-popularity[aria-pressed="true"]:hover,
#filter-popularity[aria-selected="true"]:hover,
#filter-popularity[aria-checked="true"]:hover {
  background: #7c3aed;     /* violet-600 */
  border-color: #7c3aed;
}

/* ===== Responsive tweaks ===== */
@media (max-width: 640px) {
  .cuisine-pills-scroll,
  .filter-pills-row { 
    padding: 8px 12px; 
    gap: 10px; 
  }
  .cuisine-pill,
  #filter-toprated,
  #filter-popularity {
    height: 48px;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 24px;
  }
  .cuisine-pills-fade { width: 40px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .cuisine-pill,
  #filter-toprated,
  #filter-popularity { transition: none; transform: none; }
}

/* ===== High contrast ===== */
@media (prefers-contrast: high) {
  .cuisine-pill,
  #filter-toprated,
  #filter-popularity { border-width: 3px; }
}

/* ===== Print ===== */
@media print {
  .cuisine-pills-fade,
  .filter-pills-row { display: none; }
}

/* ============================================
   COMPATIBILITY NOTE with existing .filter-toggle
   Your JS toggles `.selected` on Top Rated / Popular.
   Treat it like `.active` for visual parity.
   ============================================ */
.filter-toggle.selected {
  color: #ffffff;
  background-color: #994d51;
  border-color: #994d51;
  font-weight: 600;
}