
/* ================================
   MOBILE STYLES (Default - No media query)
   Mobile-first navigation bar
   ================================ */

/* Main Navigation Bar Container */
.navigation-bar {
  position: sticky;
  top: 0;
  z-index: 3000;
  width: 100%;
  margin: 0 auto;
  background-color: var(--color-base-white);
  font-family: var(--font-family-header);
  box-sizing: border-box;
}

/* WordPress Admin Bar Adjustment */
body.admin-bar .navigation-bar {
  top: var(--spacing-12);
}

/* Mobile Navigation Container - Default visible on mobile */
.mobile-nav-container {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

/* Mobile Navigation Bar */
.mobile-nav-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-2) var(--spacing-3);
  height: var(--spacing-10);
  position: relative;
  z-index: 3001;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  left: 0;
  right: 0;
  background: var(--color-base-white);
  box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.1);
}

.mobile-logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.mobile-logo {
  /* Larger logo for mobile: ~100px width, 30px height */
  width: calc(var(--spacing-24) + var(--spacing-1));
  height: calc(var(--spacing-8) - var(--spacing-1) - 2px);
  object-fit: contain;
}

/* Hamburger/Close Button - Toggles between states */
.hamburger-button {
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  width: var(--spacing-4);
  height: var(--spacing-4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: var(--spacing-3);
  top: 50%;
  transform: translateY(-50%);
  border-radius: var(--radius-sm);
  z-index: 3002;
  flex-shrink: 0;
  min-width: var(--spacing-4);
  min-height: var(--spacing-4);
}

.hamburger-button:hover {
  opacity: 0.8;
}

/* Hamburger Icon - Shows when menu is closed */
.hamburger-icon {
  width: var(--spacing-4);
  height: var(--spacing-4);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-primary-dark);
  border-radius: var(--radius-xs);
  transition: all 0.3s ease;
}

/* Close Icon - Shows when menu is open */
.close-icon {
  width: var(--spacing-4);
  height: var(--spacing-4);
  position: relative;
  display: none;
}

.close-icon::before,
.close-icon::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--color-default-text);
  top: 50%;
  left: 0;
  border-radius: var(--radius-xs);
}

.close-icon::before {
  transform: translateY(-50%) rotate(45deg);
}

.close-icon::after {
  transform: translateY(-50%) rotate(-45deg);
}

/* Toggle between hamburger and close icon */
.hamburger-button.active .hamburger-icon {
  display: none;
}

.hamburger-button.active .close-icon {
  display: block;
}

/* Add bordered box background when close button is showing */
.hamburger-button.active {
  background-color: var(--color-base-light-gray);
  padding: var(--spacing-1);
  width: calc(var(--spacing-4) + var(--spacing-1));
  height: calc(var(--spacing-4) + var(--spacing-1));
}

/* Mobile Sidebar - full-screen panel (Figma "Updated Mobile Mega Menu", 460px artboard -> 100vw) */
.mobile-sidebar {
  position: fixed;
  top: var(--spacing-10); /* Below 40px nav bar */
  right: -100%; /* off-screen when closed */
  left: auto;
  width: 100%; /* full-screen width per Figma (fixed → fills viewport, scrollbar-safe) */
  height: calc(100vh - var(--spacing-10));
  background-color: var(--color-deep-dark);
  z-index: 3000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: right 0.3s ease-in-out;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.2);
}

.mobile-sidebar.active {
  right: 0;
}

.mobile-sidebar-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-deep-dark);
  z-index: -1;
}

.mobile-sidebar-content {
  position: relative;
  z-index: 1;
  padding: 0;
}

/* Full-screen panel covers the viewport — no separate backdrop needed */
.mobile-sidebar.active::before {
  content: none;
}

/* Mobile Search Section - Figma specs: 20px height, 160px width */
.mobile-search-section {
  padding: var(--spacing-3) var(--spacing-3) var(--spacing-2) var(--spacing-3);
  position: relative;
}

.mobile-search-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-primary-dark);
  border-radius: var(--radius-md); /* Figma: 6px corner radius */
  padding: 0 var(--spacing-2); /* Figma mobile: 8px field padding */
  gap: var(--spacing-2);
  height: var(--spacing-10); /* 40px per updated Figma (mobile) */
  width: 100%; /* full-width search field per Figma */
  box-sizing: border-box;
  border: none;
  outline: none;
}

.mobile-search-input-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  flex: 1 1 auto;
  min-width: 0;
}

.mobile-search-icon {
  width: calc(var(--spacing-3) + 1px); /* 13px per Figma */
  height: calc(var(--spacing-3) + 1px);
  background-image: url("../images/search-icon.svg");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.mobile-search-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
  color: var(--color-base-ghost-white) !important;
  font-family: var(--font-family-header) !important;
  font-size: var(--font-size-p2-base) !important; /* legible input text (was 8px) */
  line-height: 1 !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  height: 100% !important;
  width: auto !important;
  min-width: 0 !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
}

.mobile-search-input:focus,
.mobile-search-input:active,
.mobile-search-input:hover {
  border: none !important;
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
  color: var(--color-base-ghost-white) !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.mobile-search-input::placeholder {
  color: var(--color-base-ghost-white) !important;
  opacity: 0.7 !important;
}

/* Mobile Search Close Button */
.mobile-search-close-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xs);
  padding: 2px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

/* Show mobile close button when search is focused */
.mobile-search-field.focused .mobile-search-close-button {
  display: flex;
}

/* Mobile close button hover state */
.mobile-search-close-button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  opacity: 0.9;
}

/* Mobile close button active state */
.mobile-search-close-button:active {
  background-color: rgba(255, 255, 255, 0.4);
  transform: scale(0.95);
}

/* Mobile close button icon (X symbol) */
.mobile-search-close-icon {
  width: 14px;
  height: 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* X icon using pseudo-elements */
.mobile-search-close-icon::before,
.mobile-search-close-icon::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 1.5px;
  background-color: var(--color-base-white);
  top: 50%;
  left: 50%;
  transition: background-color 0.2s ease;
}

.mobile-search-close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.mobile-search-close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Mobile Search Dropdown */
.mobile-search-dropdown {
  position: absolute;
  top: calc(100% + var(--spacing-2));
  left: var(--spacing-3);
  right: var(--spacing-3);
  width: auto;
  margin: 0;
  background-color: var(--color-base-ghost-white);
  border-radius: var(--radius-lg); /* tablet + mobile search results card — rounder corners (was radius-xs) */
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 3000;
  max-height: calc(
    var(--spacing-24) * 3
  ); /* Using calculation instead of 260px */
  overflow: hidden;
}

.mobile-search-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-search-results {
  padding: var(--spacing-3) var(--spacing-4) var(--spacing-8) var(--spacing-4);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  height: calc(var(--spacing-24) * 3); /* Using calculation instead of 260px */
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mobile-search-results::-webkit-scrollbar {
  display: none;
}

/* Empty state for mobile search */
.mobile-search-empty {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  color: var(--color-base-mid-gray);
  font-family: var(--font-family-header);
  font-size: var(--font-size-p3-caption);
  line-height: 1.4em;
  padding: var(--spacing-1) 0;
}

.mobile-search-empty-icon {
  width: var(--spacing-8);
  height: var(--spacing-8);
  border-radius: var(--radius-md);
  background-color: var(--color-base-white);
  border: var(--border-width-thin) solid var(--color-base-ghost-white);
  background-image: url("../images/search-icon.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  flex-shrink: 0;
}

.mobile-search-result-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  cursor: pointer;
  padding: var(--spacing-1) 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.mobile-search-result-item:hover {
  background-color: var(
    --color-base-light-gray
  ); /* Using solid light color for hover */
}

.mobile-search-result-icon {
  width: var(--spacing-10); /* 40px — larger than Figma's 25px, per Daniel/Jayson review */
  height: var(--spacing-10);
  border-radius: var(--radius-lg); /* N2: was radius-md 6px → +1 step to radius-lg 8px (matches desktop result icon) */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.mobile-search-result-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* default: 1:1 logos + landscape photos fill the slot */
  border-radius: var(--radius-lg); /* N2: match the icon container */
}

/* Wide brand logos (payment-method / game-provider): show the whole logo,
   letterboxed. Modifier set per result by its CPT in custom-navigation.js. */
.mobile-search-result-icon--contain img {
  object-fit: contain;
}

.mobile-search-result-text {
  font-family: var(--font-family-header);
  font-weight: var(--font-weight-regular); /* not bold (review) */
  font-size: 16px; /* explicit 16px per Jayson (p2-base resolves to 14/15px at these breakpoints) */
  line-height: 1.5;
  color: var(--color-default-text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-search-scrollbar {
  position: absolute;
  top: var(
    --spacing-4
  ); /* Aligns with first result item (results padding + item padding) */
  right: var(--spacing-2); /* S1: was spacing-1 (4px) → 8px on mobile, matching tablet */
  width: var(--spacing-2); /* 8px scrollbar width */
  min-height: var(--spacing-10); /* Minimum 40px height */
  background-color: var(--color-base-mid-gray);
  border-radius: var(--radius-xl);
  display: none; /* Hidden by default, shown by JS when content overflows */
  pointer-events: none;
}

/* Mobile Navigation Sections - Per Figma: 25px height, 9px font */
.mobile-nav-sections {
  padding: 0;
}

.mobile-nav-section {
  position: relative;
  cursor: pointer;
}

.mobile-nav-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(250, 250, 250, 0.2);
  pointer-events: none;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--spacing-4); /* Figma: 16px section-header indent */
  height: var(--spacing-15); /* 60px per updated Figma */
  background-color: var(--color-deep-dark);
  box-sizing: border-box;
}

.mobile-nav-title {
  font-family: var(--font-family-header);
  font-weight: var(--font-weight-bold); /* Figma: Bold section headers */
  font-size: var(--font-size-h6); /* h6: 16px mobile / 18px tablet (updated Figma) */
  line-height: var(--line-height-h6);
  color: var(--color-base-ghost-white);
  text-transform: uppercase;
  letter-spacing: 0;
}

.mobile-dropdown-arrow {
  width: 5px;
  height: 3px;
  background-image: url("../images/chevron-arrow.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.mobile-nav-section.expanded .mobile-dropdown-arrow {
  transform: rotate(0deg);
}

.mobile-nav-content {
  max-height: 0;
  overflow: hidden;
  background-color: var(--color-deep-dark);
  transition: max-height 0.4s ease-in-out;
}

.mobile-nav-section.expanded .mobile-nav-content {
  max-height: 800px;
}

/* Mobile Subsections - Per Figma: 25px height, primary dark background */
.mobile-casino-subsection {
  position: relative;
}

.mobile-casino-subsection::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(250, 250, 250, 0.2);
  pointer-events: none;
}

.mobile-subsection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--spacing-4) 0 var(--spacing-6); /* Figma: 24px sub-header indent */
  height: var(--spacing-15); /* 60px per updated Figma */
  background-color: var(--color-primary-dark);
  cursor: pointer;
  box-sizing: border-box;
}

.mobile-subsection-title {
  font-family: var(--font-family-header);
  font-weight: var(--font-weight-bold); /* Figma: Bold sub-headers */
  font-size: var(--font-size-h6); /* h6: 16px mobile / 18px tablet (updated Figma) */
  line-height: var(--line-height-h6);
  color: var(--color-base-ghost-white);
  text-transform: uppercase;
  letter-spacing: 0;
  margin: 0;
}

.mobile-subsection-arrow {
  width: 5px;
  height: 3px;
  background-image: url("../images/chevron-arrow.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.mobile-casino-subsection.expanded .mobile-subsection-arrow {
  transform: rotate(0deg);
}

.mobile-menu-items,
.mobile-menu-links {
  max-height: 0;
  overflow: hidden;
  background-color: var(--color-primary-dark);
  transition: max-height 0.4s ease-in-out;
}

.mobile-casino-subsection.expanded .mobile-menu-items,
.mobile-casino-subsection.expanded .mobile-menu-links {
  max-height: 600px;
}

/* Mobile Menu Items with Icons - Per Figma: 25px height */
.mobile-menu-items {
  padding: 0;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  padding: 0 var(--spacing-4) 0 var(--spacing-9); /* Figma: 36px item indent */
  height: var(--spacing-15); /* 60px per updated Figma */
  text-decoration: none;
  color: var(--color-base-ghost-white);
  font-family: var(--font-family-header);
  font-size: var(--font-size-p2-base); /* p2-base: 14px mobile / 15px tablet */
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-p2-base);
  gap: var(--spacing-2);
  box-sizing: border-box;
  transition: opacity 0.2s ease;
  position: relative;
}

.mobile-menu-item::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(250, 250, 250, 0.2);
  pointer-events: none;
}

.mobile-menu-item:hover {
  opacity: 0.8;
}

.mobile-menu-item span {
  color: var(--color-base-ghost-white);
}

.mobile-menu-icon {
  /* 28px icon box (Jayson), radius-xs. */
  width: var(--spacing-7); /* 28px */
  height: var(--spacing-7);
  flex-shrink: 0;
  position: relative;
  border-radius: var(--radius-sm); /* N1: sidebar icon, was radius-xs 2px → +1 step to radius-sm 4px */
  overflow: hidden;
  box-sizing: border-box;
}

.mobile-menu-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* default: 1:1 logos + landscape photos fill the 48px slot */
  display: block;
}

/* Wide brand logos (payment-method / game-provider): show the whole logo,
   letterboxed in the slot, instead of cropping the sides. Modifier set per menu
   item by its CPT (fc_is_logo_cpt) in custom-navigation-shortcode.php. */
.mobile-menu-icon--contain img {
  object-fit: contain;
}

/* Mobile Menu Links - Per Figma: 25px height, no icons */
.mobile-menu-links {
  padding: 0;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  padding: 0 var(--spacing-4) 0 var(--spacing-9); /* Figma: 36px item indent */
  height: var(--spacing-15); /* 60px per updated Figma */
  text-decoration: none;
  color: var(--color-base-white);
  font-family: var(--font-family-header);
  font-size: var(--font-size-p2-base); /* p2-base: 14px mobile / 15px tablet */
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-p2-base);
  box-sizing: border-box;
  transition: opacity 0.2s ease;
  position: relative;
}

.mobile-menu-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(250, 250, 250, 0.2);
  pointer-events: none;
}

.mobile-menu-link:hover {
  opacity: 0.8;
}

/* Remove close button from sidebar - it's now in the nav bar */
.mobile-close-button {
  display: none;
}

/* Desktop Navigation - Hidden on mobile by default */
.desktop-nav-container {
  display: none;
}

/* ================================
   TABLET STYLES (768px and up)
   Enhanced mobile navigation for tablets
   ================================ */
@media (min-width: 768px) {
  /* WordPress Admin Bar Adjustment for tablet */
  body.admin-bar .navigation-bar {
    top: var(--spacing-12);
  }

  /* Enhanced Navigation Bar for Tablet */
  .mobile-nav-bar {
    padding: var(--spacing-3) var(--spacing-6);
    height: var(--spacing-12); /* 48px vs 40px mobile */
  }

  /* Larger Logo for Tablet */
  .mobile-logo {
    /* ~130px width, 36px height */
    width: calc(var(--spacing-24) + var(--spacing-8));
    height: var(--spacing-9);
  }

  /* Larger Hamburger Button */
  .hamburger-button {
    width: var(--spacing-6); /* 24px vs 16px mobile */
    height: var(--spacing-6);
    right: var(--spacing-6);
  }

  .hamburger-icon {
    width: var(--spacing-6);
    height: var(--spacing-6);
  }

  .hamburger-icon span {
    height: 3px; /* Thicker lines */
  }

  .close-icon {
    width: var(--spacing-6);
    height: var(--spacing-6);
  }

  .close-icon::before,
  .close-icon::after {
    height: 3px;
  }

  .hamburger-button.active {
    padding: var(--spacing-2);
    width: calc(var(--spacing-6) + var(--spacing-2));
    height: calc(var(--spacing-6) + var(--spacing-2));
  }

  /* Tablet: same full-screen panel as mobile; only the top offset differs (48px nav bar) */
  .mobile-sidebar {
    top: var(--spacing-12); /* Below 48px nav bar */
    right: -100%;
    width: 100%;
    height: calc(100vh - var(--spacing-12));
  }

  /* Full-screen panel covers the viewport — no backdrop on tablet either */
  .mobile-sidebar.active::before {
    content: none;
  }

  /* Enhanced Search Section for Tablet */
  .mobile-search-section {
    padding: var(--spacing-7) var(--spacing-3) var(--spacing-3) var(--spacing-3); /* Figma tablet: 28px top */
  }

  .mobile-search-field {
    padding: 0 var(--spacing-4);
    gap: var(--spacing-3);
    height: calc(var(--spacing-12) + 2px); /* 50px per Figma, full-width */
  }

  .mobile-search-icon {
    width: calc(var(--spacing-3) + 1px); /* 13px per Figma */
    height: calc(var(--spacing-3) + 1px);
  }

  .mobile-search-input {
    font-size: var(--font-size-p2-base) !important; /* legible input text */
  }

  /* Enhanced Search Dropdown for Tablet */
  .mobile-search-dropdown {
    top: calc(100% + var(--spacing-3));
    left: var(--spacing-3); /* N3: was spacing-5 (20px) → 12px so the card aligns with the search input width */
    right: var(--spacing-3);
    max-height: calc(var(--spacing-24) * 4); /* 360px vs 260px mobile */
  }

  .mobile-search-results {
    padding: var(--spacing-4) var(--spacing-5) var(--spacing-10)
      var(--spacing-5);
    gap: var(--spacing-3);
    height: calc(var(--spacing-24) * 4);
  }

  .mobile-search-empty {
    gap: var(--spacing-4);
    font-size: var(--font-size-h7); /* 13px vs 11px mobile */
    padding: var(--spacing-2) 0;
  }

  .mobile-search-empty-icon {
    width: var(--spacing-10); /* 40px vs 32px mobile */
    height: var(--spacing-10);
    background-size: var(--spacing-5) var(--spacing-5); /* 20px icon */
  }

  .mobile-search-result-item {
    gap: var(--spacing-3);
    padding: var(--spacing-2) 0;
  }

  .mobile-search-result-icon {
    width: var(--spacing-10); /* 40px */
    height: var(--spacing-10);
  }

  .mobile-search-result-text {
    font-size: 16px; /* matches mobile — explicit 16px per Jayson */
    font-weight: var(--font-weight-regular);
  }

  /* Tablet matches the unified Figma spec (60px rows, 16px indent, h6 headers) */
  .mobile-nav-header {
    padding: 0 var(--spacing-4);
    height: var(--spacing-15); /* 60px per updated Figma */
  }

  .mobile-nav-title {
    font-size: var(--font-size-h6); /* h6: 18px tablet */
    font-weight: var(--font-weight-bold);
    letter-spacing: 0;
  }

  .mobile-dropdown-arrow {
    width: var(--spacing-2); /* 8px vs 5px mobile */
    height: var(--spacing-1); /* 5px vs 3px mobile */
  }

  /* Tablet matches the unified Figma spec */
  .mobile-subsection-header {
    padding: 0 var(--spacing-4) 0 var(--spacing-6);
    height: var(--spacing-15); /* 60px per updated Figma */
  }

  .mobile-subsection-title {
    font-size: var(--font-size-h6); /* h6: 18px tablet */
    font-weight: var(--font-weight-bold);
  }

  .mobile-subsection-arrow {
    width: var(--spacing-2); /* 8px vs 5px mobile */
    height: var(--spacing-1); /* 5px vs 3px mobile */
  }

  /* Tablet matches the unified Figma spec (60px rows, 36px indent, p2-base text) */
  .mobile-menu-item {
    padding: 0 var(--spacing-4) 0 var(--spacing-9);
    height: var(--spacing-15); /* 60px per updated Figma */
    font-size: var(--font-size-p2-base); /* p2-base: 14px mobile / 15px tablet */
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-p2-base);
    gap: var(--spacing-2);
  }

  /* Tablet inherits base mobile-menu-icon: 18x18 (see base rule above) */

  /* Tablet matches the unified Figma spec */
  .mobile-menu-link {
    padding: 0 var(--spacing-4) 0 var(--spacing-9);
    height: var(--spacing-15); /* 60px per updated Figma */
    font-size: var(--font-size-p2-base); /* p2-base: 14px mobile / 15px tablet */
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-p2-base);
  }

  /* Add spacing between navigation sections for tablet */
  .mobile-nav-sections {
    padding: var(--spacing-2) 0;
  }

  .mobile-nav-section {
    margin-bottom: var(--spacing-1); /* Add space between sections */
  }

  .mobile-nav-section:last-child {
    margin-bottom: 0;
  }

  /* Add padding to expanded content for better spacing */
  .mobile-nav-content {
    transition: max-height 0.5s ease-in-out;
    padding-top: var(--spacing-2); /* Add top padding when expanded */
  }

  .mobile-nav-section.expanded .mobile-nav-content {
    max-height: 1200px; /* Increased for tablet content with better spacing */
  }

  .mobile-casino-subsection:last-child {
    margin-bottom: 0;
  }

  .mobile-menu-items,
  .mobile-menu-links {
    transition: max-height 0.5s ease-in-out;
    padding-top: var(--spacing-1); /* Add padding when expanded */
  }

  .mobile-casino-subsection.expanded .mobile-menu-items,
  .mobile-casino-subsection.expanded .mobile-menu-links {
    max-height: 1000px; /* Increased for tablet content with better spacing */
  }

  /* Enhanced scrollbar for tablet */
  .mobile-search-scrollbar {
    top: var(--spacing-5);
    right: var(--spacing-2);
    width: var(--spacing-3); /* 12px scrollbar width */
    min-height: var(--spacing-12); /* 48px minimum height */
  }
}

/* ================================
   DESKTOP STYLES (1280px and up)
   Show desktop navigation, hide mobile
   ================================ */
@media (min-width: 1280px) {
  /* Hide mobile navigation on desktop */
  .mobile-nav-container {
    display: none;
  }

  /* Show desktop navigation */
  .desktop-nav-container {
    display: block;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
  }

  /* Desktop Navigation Content */
  .nav-content {
    position: relative;
    display: flex;
    align-items: center;
    padding-top: var(--spacing-4);
    padding-left: clamp(var(--spacing-4), 3vw, var(--spacing-12));
    padding-right: clamp(var(--spacing-4), 3vw, var(--spacing-12));
    padding-bottom: var(--spacing-4);
    gap: clamp(var(--spacing-4), 3.5vw, var(--spacing-12));
    justify-content: space-between;
    height: 100%;
    width: 100%;
  }

  .logo-section {
    margin-right: 0;
    flex: 0 0 auto;
  }

  .logo {
    width: calc(
      var(--spacing-24) * 1.6
    ); /* Using calculation instead of 153.38px */
    height: var(--spacing-12);
    object-fit: contain;
  }

  .navigation-menu {
    display: flex;
    align-items: center;
    gap: clamp(var(--spacing-4), 3.5vw, var(--spacing-10)); /* max 40px so menu clears the search bar/logo (Daniel) */
    margin-right: 0;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .nav-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    cursor: pointer;
  }

  .nav-group:hover {
    opacity: 0.8;
  }

  .nav-group.has-dropdown:hover {
    opacity: 1;
  }

  .nav-group.has-dropdown:hover [id$="Dropdown"] {
    opacity: 1;
  }

  .nav-group.has-dropdown {
    position: relative;
  }

  .nav-text {
    font-family: var(--font-family-header);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-p2-base);
    line-height: 1.5em;
    color: var(--color-deep-dark);
    white-space: nowrap;
  }

  .dropdown-arrow {
    width: 9px;
    height: var(--spacing-1);
    object-fit: contain;
  }

  .nav-group.active .dropdown-arrow {
    transform: rotate(180deg);
  }

  /* Desktop Search Field */
  .navigation-bar .search-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--color-base-light-gray);
    border-radius: var(--radius-xl);
    padding: 7px 15px 7px 8px;
    gap: var(--spacing-2);
    width: 255px;
    position: relative;
    box-sizing: border-box;
    border: none;
    margin: 0;
    flex: 0 0 auto;
  }

  .navigation-bar .search-input-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    flex: 1 1 auto;
    min-width: 0;
  }

  .navigation-bar .search-icon {
    width: 18px;
    height: 18px;
    background-image: url("../images/search-icon.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
    display: block;
  }

  .navigation-bar .search-input {
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font-family-header);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-h7);
    line-height: 1.5384615384615385em;
    color: var(--color-base-mid-gray);
    width: calc(var(--spacing-24) * 2); /* Using calculation instead of 185px */
    height: calc(
      var(--spacing-5) + var(--spacing-1)
    ); /* Using calculation instead of 22px */
    margin: 0;
    padding: 0;
    box-shadow: none;
    box-sizing: border-box;
  }

  .navigation-bar .search-input::placeholder {
    color: var(--color-base-mid-gray);
    font-family: var(--font-family-header);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-h7);
    opacity: 1;
  }

  .navigation-bar .search-input:focus {
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
  }

  /* Search Close Button */
  .navigation-bar .search-close-button {
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: var(--color-base-light-gray);
    border-radius: var(--radius-sm);
    padding: 2px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
  }

  /* Show close button when search is focused */
  .navigation-bar .search-field.focused .search-close-button {
    display: flex;
  }

  /* Close button hover state */
  .navigation-bar .search-close-button:hover {
    background-color: var(--color-base-mid-gray);
    opacity: 0.9;
  }

  /* Close button active state */
  .navigation-bar .search-close-button:active {
    background-color: var(--color-base-mid-gray);
    transform: scale(0.95);
  }

  /* Close button icon (X symbol) */
  .navigation-bar .search-close-icon {
    width: 18px;
    height: 18px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* X icon using pseudo-elements */
  .navigation-bar .search-close-icon::before,
  .navigation-bar .search-close-icon::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 2px;
    background-color: var(--color-base-mid-gray);
    top: 50%;
    left: 50%;
    transition: background-color 0.2s ease;
  }

  .navigation-bar .search-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .navigation-bar .search-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  /* Hover state for X icon */
  .navigation-bar .search-close-button:hover .search-close-icon::before,
  .navigation-bar .search-close-button:hover .search-close-icon::after {
    background-color: var(--color-default-text);
  }

  /* Generic Dropdown Menu Styles - Using Flexbox instead of absolute positioning */
  [id$="Dropdown"] {
    position: absolute;
    /* Sit just below the nav-content (offset parent) with a small gap. */
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: calc(var(--spacing-24) * 5); /* Using calculation instead of 500px */
    height: auto;
    min-height: calc(
      var(--spacing-24) * 2
    ); /* Using calculation instead of 200px */
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    display: none;
  }

  [id$="Dropdown"].active {
    opacity: 1;
    visibility: visible;
    display: flex;
    transform: translateX(-50%);
  }

  /* Anchor dropdowns to the nav-content container rather than each
   * individual nav-group trigger. A 1026px mega-menu can't fit
   * center-anchored on any single nav item at viewports near the
   * 1280px breakpoint — the dropdown always clips on one side. By
   * promoting .nav-content as the offset parent and positioning the
   * dropdown to span the container, every nav-group's dropdown
   * shares the same horizontal position and stays within the nav. */
  .navigation-menu {
    position: static;
  }

  .nav-group.has-dropdown {
    position: static;
  }

  .nav-group [id$="Dropdown"],
  .nav-group [id$="Dropdown"].active {
    left: 0;
    right: 0;
    width: auto;
    max-width: calc(
      var(--sidebar-width) + (var(--gutter) * 2) +
        (var(--columns) * var(--column-width)) +
        ((var(--columns) - 1) * var(--gutter))
    );
    margin: 0 auto;
    transform: none;
  }

  .dropdown-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-base-white);
    border: var(--border-width-thin) solid var(--color-base-ghost-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 0;
  }

  .dropdown-sidebar {
    position: relative;
    width: 150px;
    height: auto;
    background-color: var(--color-base-ghost-white);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    z-index: 1;
  }

  .dropdown-content {
    position: relative;
    padding: var(--spacing-8);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-5);
    z-index: 1;
  }

  .dropdown-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
  }

  /* .dropdown-section already spaces its children with gap: spacing-3.
   * Remove the redundant margin-top from .section-cards AND the title's
   * margin-bottom so col 2/3 rows align vertically with col 1 (sidebar),
   * where block margins collapse. */
  .dropdown-section .section-cards {
    margin-top: 0;
  }

  .dropdown-section > .section-title {
    margin-bottom: 0;
  }

  .section-title {
    font-family: var(--font-family-header);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-h7) !important;
    line-height: 1.5em;
    color: var(--color-default-text) !important;
    margin: 0;
    text-transform: uppercase;
    margin-bottom: var(--spacing-3);
  }

  .section-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    margin-left: 0;
  }

  /* Section Cards for Desktop Template Design */
  .section-cards {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    margin-top: var(--spacing-3);
    margin-left: 0;
  }

  .section-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    cursor: pointer;
  }

  .section-card:hover {
    opacity: 0.8;;
  }

  .card-icon {
    width: var(--spacing-12);
    height: var(--spacing-12);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
  }

  .card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* default: 1:1 logos + landscape photos fill the slot */
    display: block;
  }

  /* Wide brand logos (payment-method / game-provider): show the whole logo,
     letterboxed in the slot. Modifier set per menu item by its CPT. */
  .card-icon--contain img {
    object-fit: contain;
  }

  .card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-2);
  }

  .card-title {
    font-family: var(--font-family-header);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-p2-base);
    line-height: 1.5em;
    color: var(--color-default-text);
    text-decoration: none;
  }

  .card-title:hover {
    color: var(--color-deep-dark);
    font-weight: var(--font-weight-semibold) !important;
  }

  /* Desktop Template Section - Using Grid Layout instead of absolute positioning */
  .casinos-dropdown .dropdown-section,
  .dropdown-section.no-deposit,
  .dropdown-section.free-spins,
  .dropdown-section.slot-types,
  .dropdown-section.by-provider,
  .dropdown-section.slot-guides,
  .dropdown-section.top-rated {
    position: static;
    width: auto;
    left: auto;
    top: auto;
    z-index: auto;
  }

  .casinos-dropdown .dropdown-section.most-popular,
  .casinos-dropdown .dropdown-section.casino-reviews {
    position: static;
    width: auto;
    z-index: auto;
  }

  .casinos-dropdown .dropdown-section.most-popular .section-cards,
  .casinos-dropdown .dropdown-section.casino-reviews .section-links {
    margin-left: 0;
  }

  .dropdown-link {
    font-family: var(--font-family-header);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-p2-base);
    line-height: 1.5em;
    color: var(--color-default-text);
    text-decoration: none;
    padding: var(--spacing-1) 0;
  }

  .dropdown-link:hover {
    color: var(--color-deep-dark);
    font-weight: var(--font-weight-semibold) !important;
  }

  /* Search Dropdown Styles */
  .search-dropdown {
    position: absolute;
    top: calc(100% + var(--spacing-2));
    right: 0;
    left: auto; /* Daniel: right-align so the card never overruns the search bar's right edge */
    width: 334px;
    background-color: var(--color-base-ghost-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    display: none;
    transform: translateY(0);
    justify-content: flex-start;
    align-items: stretch;
    gap: var(--spacing-2);
    padding: var(--spacing-3) var(--spacing-4) var(--spacing-3) var(--spacing-4);
    box-sizing: border-box;
  }

  .search-dropdown.active {
    opacity: 1;
    visibility: visible;
    display: flex;
    transform: translateY(0);
  }

  #searchDropdown {
    right: 0;
    left: auto; /* Daniel: right-align so the card never overruns the search bar's right edge */
    width: 334px;
    transform: none;
    top: calc(100% + var(--spacing-2));
    margin-top: 0;
  }

  #searchDropdown.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .search-results {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--spacing-4);
    flex: 1 1 auto;
    width: 100%;
    overflow: hidden;
    max-height: calc(
      var(--spacing-24) * 3
    ); /* Using calculation instead of 260px */
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .search-results::-webkit-scrollbar {
    display: none;
  }

  .search-empty {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    color: var(--color-base-mid-gray);
    font-family: var(--font-family-header);
    font-size: var(--font-size-h7);
    line-height: 1.4em;
    padding: var(--spacing-1) 0;
  }

  .search-empty-icon {
    width: var(--spacing-8);
    height: var(--spacing-8);
    border-radius: var(--radius-lg);
    background-color: var(--color-base-white);
    border: var(--border-width-thin) solid var(--color-base-ghost-white);
    background-image: url("../images/search-icon.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: var(--spacing-4);
    flex-shrink: 0;
  }

  .search-result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    /* Firefox follows the flexbox spec strictly: a column flex parent with
     * max-height shrinks children via flex-shrink: 1 by default, collapsing
     * result rows and preventing overflow/scroll. Lock each item to its
     * natural size so the list overflows and .search-results scrolls. */
    flex-shrink: 0;
    min-height: var(--spacing-12);
  }

  .search-result-item:hover {
    opacity: 0.8;
  }

  .search-result-icon {
    width: var(--spacing-12);
    height: var(--spacing-12);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .search-result-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* default: 1:1 logos + landscape photos fill the slot */
    border-radius: var(--radius-lg);
  }

  /* Wide brand logos (payment-method / game-provider): show the whole logo,
     letterboxed. Modifier set per result by its CPT in custom-navigation.js. */
  .search-result-icon--contain img {
    object-fit: contain;
  }

  .search-result-text {
    font-family: var(--font-family-header);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-p3-caption);
    color: var(--color-default-text);
    line-height: var(--line-height-p3-caption);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-scrollbar {
    position: absolute;
    top: var(--spacing-6); /* Initial position, updated by JS based on scroll */
    right: var(--spacing-2); /* S1: was spacing-4 (16px) → 8px, matching mobile/tablet */
    width: var(--spacing-2); /* 8px scrollbar width using design token */
    min-height: var(--spacing-10); /* Minimum 40px height */
    background-color: var(--color-base-mid-gray);
    border-radius: var(--radius-xl);
    display: none; /* Hidden by default, shown by JS when content overflows */
    pointer-events: none;
  }

  /* Dynamic Dropdown Overrides (fully dynamic columns) */
  .nav-dropdown {
    --columns: 1;
    --column-width: 280px;
    --sidebar-width: 322px;
    --gutter: var(--spacing-12);
    /* Width = sidebar + content padding (left + right) + N columns +
     * (N-1) gaps. The previous formula used (--gutter * 2) but ignored
     * the inter-column gap, so the rightmost column was clipped against
     * the panel edge. */
    width: calc(
      var(--sidebar-width) + (var(--gutter) * 2) +
        (var(--columns) * var(--column-width)) +
        ((var(--columns) - 1) * var(--gutter))
    );
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    align-items: stretch;
  }

  .nav-dropdown.active {
    opacity: 1;
    visibility: visible;
    display: grid;
  }

  .nav-dropdown .dropdown-content {
    display: grid;
    grid-template-columns: repeat(var(--columns, 1), minmax(var(--column-width), 1fr));
    gap: var(--spacing-12);
    padding: var(--spacing-12) var(--gutter);
    position: relative;
    z-index: 1;
    height: auto;
  }

  .nav-dropdown .dropdown-sidebar {
    width: var(--sidebar-width);
    position: relative;
    left: auto;
    top: auto;
    height: auto;
    z-index: 1;
  }

  .nav-group .nav-dropdown .dropdown-section {
    position: static;
    width: auto;
    left: auto;
    top: auto;
  }

  .nav-group .nav-dropdown .section-links,
  .nav-group .nav-dropdown .section-cards {
    margin-left: 0;
  }

  .nav-dropdown .sidebar-content {
    padding: var(--spacing-12) var(--gutter) var(--spacing-12) var(--gutter);
    box-sizing: border-box;
    height: 100%;
  }

  .nav-dropdown .sidebar-content .section-cards {
    margin-left: 0;
  }

  .nav-dropdown .sidebar-content .card-title {
    font-weight: var(--font-weight-medium);
  }
}
