/* ============================================================================
   DESKTOP.CSS - Desktop-specific styles (>= 1024px)
   Split layout: Fixed left image panel + Mobile-style app on right
   ============================================================================ */

/* ============================================================================
   HIDE DESKTOP-SPECIFIC MOBILE ELEMENTS
   ============================================================================ */

.page-title-mobile,
.back-button,
.topbar-mobile,
.breadcrumbs {
  display: none !important;
}

/* Sidebar - hidden by default but can be opened (desktop only - slides from right) */
@media screen and (min-width: 1024px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: 320px !important;
    height: 100vh !important;
    z-index: 100000 !important;
    transform: translateX(100%);
    background: var(--card) !important;
    border-left: 1px solid var(--stroke);
    border-right: none;
    transition: transform 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    pointer-events: auto !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
    display: block !important;
  }
}

/* Overlay when sidebar is open */
body.sidebar-open::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99999 !important;
  pointer-events: auto;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: 2px;
  transition: all .15s ease;
  font-size: 15px;
  font-weight: 500;
}

.sidebar-nav-item:hover {
  background: rgba(var(--primary-rgb), 0.08);
}

.sidebar-nav-item.active {
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--text);
  font-weight: 600;
}

.sidebar-nav-item i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: var(--muted);
}

.sidebar-nav-item.active i {
  color: var(--primary);
}

/* Sidebar submenu styles for desktop */
.sidebar-nav-group {
  margin-bottom: 2px;
}

.sidebar-nav-parent {
  display: flex;
  align-items: center;
}

.sidebar-nav-parent .sidebar-nav-item {
  flex: 1;
  margin-bottom: 0;
}

.sidebar-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all .15s ease;
  flex-shrink: 0;
}

.sidebar-nav-toggle:hover {
  background: rgba(0,0,0,.04);
  color: var(--text);
}

.sidebar-nav-toggle i {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.sidebar-nav-group.expanded .sidebar-nav-toggle i {
  transform: rotate(180deg);
}

.sidebar-nav-children {
  display: none;
  padding-left: 20px;
  margin-top: 2px;
  border-left: 2px solid var(--stroke);
  margin-left: 26px;
}

.sidebar-nav-group.expanded .sidebar-nav-children {
  display: block;
}

.sidebar-nav-child {
  padding: 10px 14px;
  font-size: 14px;
}

.sidebar-nav-child i {
  font-size: 14px;
  width: 16px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--stroke);
  margin-top: auto;
}

.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.15s ease;
  font-size: 14px;
}

.sidebar-footer-btn:hover {
  background: rgba(0,0,0,0.04);
}

.sidebar-footer-btn i {
  width: 20px;
  text-align: center;
  color: var(--muted);
}

.sidebar-footer-btn.sidebar-logout {
  color: var(--error, #ef4444);
}

.sidebar-footer-btn.sidebar-logout i {
  color: var(--error, #ef4444);
}

/* Divider between guidebook and portal nav items */
.sidebar-nav-divider {
  height: 1px;
  background: var(--stroke);
  margin: 12px 16px;
}

/* ============================================================================
   BODY
   ============================================================================ */

html, body {
  margin: 0;
  padding: 0 !important;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--card);
}

/* ============================================================================
   LEFT PANEL - FIXED IMAGE
   ============================================================================ */

.desktop-left-panel {
  position: fixed;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: calc(100% - 768px - 48px);
  background-image: var(--desktop-bg-image, url('https://app.hejguide.com/uploads/guidebooks/1/header-6956d3aa9b2f1-large.webp'));
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
  box-sizing: border-box;
  z-index: 1;
  border-radius: 24px;
  overflow: hidden;
}

/* Gradient overlay */
.desktop-left-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.6) 100%
  );
  z-index: 1;
  border-radius: 24px;
}

/* Remove old divider line */
.desktop-left-panel::after {
  display: none;
}

.desktop-branding {
  position: relative;
  z-index: 2;
  color: white;
  margin-bottom: 24px;
  max-width: 630px;
}

.desktop-title {
  font-size: 42px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.desktop-location {
  font-size: 18px;
  margin: 0;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.desktop-location i {
  font-size: 16px;
}

.desktop-subtitle {
  font-size: 18px;
  margin: 0;
  opacity: 0.9;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.desktop-category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.desktop-category i {
  font-size: 11px;
}

.desktop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  position: relative;
  z-index: 2;
}

.desktop-tag {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   TOGGLE PILLS - Featured / Map switch
   ============================================================================ */

.desktop-left-toggle {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: center;
  margin-bottom: auto;
}

.desktop-left-toggle-inner {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.desktop-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 22px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.desktop-toggle-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.desktop-toggle-pill.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.desktop-toggle-pill i {
  font-size: 13px;
}

/* ============================================================================
   LEFT PANEL MAP - Full panel Leaflet map
   ============================================================================ */

.desktop-left-map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  border-radius: 24px;
  overflow: hidden;
}

.desktop-left-map .leaflet-container {
  width: 100%;
  height: 100%;
  border-radius: 24px;
}

/* ============================================================================
   FEATURED CARD - Glassmorphism style
   ============================================================================ */

.desktop-featured-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 24px;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  max-width: 650px;
  overflow: hidden;
}

.desktop-featured-card:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.featured-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.featured-badge i {
  font-size: 11px;
  color: #fbbf24;
}

.featured-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.featured-description {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px;
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Featured excerpt with fade out - for body content */
.featured-excerpt {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 20px;
  opacity: 0.95;
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 60%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 60%,
    transparent 100%
  );
  flex: 1;
}

.featured-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  transition: all 0.2s ease;
}

.featured-link i {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.desktop-featured-card:hover .featured-link {
  background: rgba(255, 255, 255, 0.25);
}

.desktop-featured-card:hover .featured-link i {
  transform: translateX(4px);
}

/* ============================================================================
   PANEL RESIZER - DRAGGABLE DIVIDER
   ============================================================================ */

.panel-resizer {
  position: fixed;
  top: 16px;
  bottom: 16px;
  width: 16px;
  cursor: col-resize;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Position: right edge of left panel + gap */
  right: calc(768px + 16px);
}

.panel-resizer-handle {
  width: 4px;
  height: 48px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.2s, height 0.2s, transform 0.2s;
}

.panel-resizer:hover .panel-resizer-handle {
  background: rgba(0, 0, 0, 0.35);
  height: 64px;
}

.panel-resizer.dragging .panel-resizer-handle {
  background: var(--primary, #1e3a8a);
  height: 80px;
}

body.resizing {
  user-select: none !important;
  cursor: col-resize !important;
}

body.resizing * {
  cursor: col-resize !important;
}

/* ============================================================================
   RIGHT PANEL - MOBILE-STYLE APP
   ============================================================================ */

.app-layout {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 768px;
  background: var(--bg);
  z-index: 2;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  border-radius: 24px;
  overflow: hidden;
  container-type: inline-size;
  container-name: app-panel;
}

.main-content {
  width: 100%;
  height: 100%;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 100px;
  box-sizing: border-box;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  border-radius: 24px;
}

/* Hide scrollbar but keep scroll functionality */
.main-content::-webkit-scrollbar {
  display: none;
}

/* Visual separator above bottom nav */
.app-layout::after {
  content: '';
  position: fixed;
  bottom: 80px;
  right: 0;
  width: 768px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.03));
  pointer-events: none;
  z-index: 5;
}

/* ============================================================================
   DESKTOP TOPBAR
   ============================================================================ */

.topbar-desktop {
  display: none !important;
}

/* Show topbar only when no hero */
body:not(.has-hero) .topbar-desktop {
  display: flex !important;
  position: sticky;
  top: 0;
  background: var(--topbar-bg);
  color: var(--topbar-text);
  min-height: 60px;
  z-index: 100;
  border-radius: 24px 24px 0 0;
}

.topbar-desktop .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  width: 100%;
  position: relative;
}

/* Placeholder to balance layout when no back button */
.topbar-desktop .container::before {
  content: '';
  width: 40px;
  flex-shrink: 0;
}

/* Desktop back button in topbar */
.back-button-desktop {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: var(--topbar-text);
  text-decoration: none;
  transition: background 0.15s ease;
  flex-shrink: 0;
  z-index: 1;
}

/* Hide placeholder when back button exists */
.topbar-desktop .container:has(.back-button-desktop)::before {
  display: none;
}

.back-button-desktop:hover {
  background: rgba(255, 255, 255, 0.25);
}

.back-button-desktop i {
  font-size: 16px;
}

/* Floating back button over hero */
.back-button-desktop.floating {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  color: #ffffff;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.back-button-desktop.floating:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* Hide floating back button when no hero */
body:not(.has-hero) .back-button-desktop.floating {
  display: none !important;
}

.topbar-desktop .brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--topbar-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
  text-align: center;
}

/* Search icon only (not full search bar) */
.search-container-desktop {
  display: none !important;
}

/* Topbar pill - search + menu buttons in no-hero state */
.topbar-desktop .topbar-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 4px;
  margin-left: auto;
}

.topbar-desktop .topbar-pill .pill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--topbar-text);
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s ease;
}

.topbar-desktop .topbar-pill .pill-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Hide topbar pill when hero is visible - floating pill is used instead */
body.has-hero .topbar-desktop .topbar-pill {
  display: none;
}

/* ============================================================================
   BOTTOM NAVIGATION - SHOW ON DESKTOP (like mobile)
   ============================================================================ */

.bottom-nav {
  display: flex !important;
  position: fixed;
  bottom: 36px;
  right: 32px;
  width: calc(768px - 32px);
  background: var(--bottom-nav-bg);
  padding: 10px 8px;
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  border-radius: 999px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--bottom-nav-text);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.bottom-nav-item i {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.bottom-nav-item span {
  font-size: 11px;
  font-weight: 500;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--bottom-nav-active);
}

.bottom-nav-item.active i {
  transform: scale(1.1);
}

/* ============================================================================
   SEARCH TOGGLE (desktop - floating over hero)
   ============================================================================ */

/* Floating pill with search + menu buttons */
.floating-pill-desktop {
  position: fixed;
  top: 24px;
  right: 40px; /* 16px app-layout offset + 24px inner padding */
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 24px;
  padding: 6px;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.floating-pill-desktop .pill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: white;
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s ease;
}

.floating-pill-desktop .pill-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Hide floating pill when no hero - topbar has these buttons */
body:not(.has-hero) .floating-pill-desktop {
  display: none !important;
}

/* Old single search button - hidden, replaced by floating-pill-desktop */
.search-toggle-desktop {
  display: none !important;
}

.search-toggle-desktop:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* Hide when no hero - topbar has search icon instead */
body:not(.has-hero) .search-toggle-desktop {
  display: none !important;
}

/* Hide mobile search overlay by default on desktop - but allow it to be shown via JS */
.search-overlay-mobile {
  display: none;
  position: fixed !important;
  top: 16px !important;
  left: auto !important;
  right: 16px !important;
  bottom: 16px !important;
  width: 768px !important;
  background: var(--card) !important;
  z-index: 99999 !important;
  flex-direction: column !important;
  border-radius: 24px !important;
  overflow: hidden !important;
}

.search-overlay-mobile[style*="display: flex"],
.search-overlay-mobile[style*="display:flex"] {
  display: flex !important;
}

.search-overlay-mobile .search-overlay-header {
  background: var(--topbar-bg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-overlay-mobile .search-overlay-close {
  background: none;
  border: none;
  color: var(--topbar-text);
  font-size: 20px;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
}

.search-overlay-mobile .search-box {
  flex: 1;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-overlay-mobile .search-input {
  background: transparent;
  border: none;
  font-size: 15px;
  width: 100%;
  padding: 10px 36px;
  color: var(--topbar-text);
  outline: none;
}

.search-overlay-mobile .search-input::placeholder {
  color: rgba(255,255,255,0.6);
}

.search-overlay-mobile .search-icon {
  position: absolute;
  left: 12px;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}

.search-overlay-mobile .search-results-mobile {
  flex: 1;
  overflow-y: auto;
}

/* ============================================================================
   HERO & CONTENT
   ============================================================================ */

.hero-container {
  position: relative;
  width: 100%;
  height: 350px;
  overflow: hidden;
  margin: 0;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
}

.hero-container img {
  width: 100%;
  height: 100%;
  max-height: 350px;
  object-fit: cover;
  object-position: 50% 50%;
}

.hero-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-title {
  position: absolute;
  bottom: 56px;
  left: 20px;
  right: 20px;
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  z-index: 2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  margin: 0;
}

/* Hero text container (when description/tags present) */
.hero-text {
  position: absolute;
  bottom: 40px;
  left: 20px;
  right: 20px;
  z-index: 2;
}

.hero-text .hero-title {
  position: static;
  font-size: 32px;
  margin-bottom: 12px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Hero badge (e.g., Local Tip) */
.hero-badge {
  position: absolute;
  bottom: 52px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  z-index: 3;
}

.hero-badge i {
  font-size: 12px;
}

/* Content card - slides over hero like mobile */
.content-card {
  position: relative;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  margin-top: -32px;
  z-index: 10;
  padding: 24px;
  padding-bottom: 40px;
  box-sizing: border-box;
}

.has-hero .content-wrapper {
  padding: 0;
}

body:not(.has-hero) .main-content {
  padding-top: 0;
}

.content-wrapper {
  padding: 24px;
  box-sizing: border-box;
}

/* Page title for non-hero pages */
.page-title-desktop {
  display: block;
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 20px 0;
  color: var(--text);
}

.has-hero .page-title-desktop {
  display: none;
}

/* Hide right-panel maps on desktop (left panel already has the map) */
.overview-map-container,
.detail-map {
  display: none;
}

/* ============================================================================
   TILES GRID
   ============================================================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  box-sizing: border-box;
}

/* Responsive grids based on app panel width */
@container app-panel (max-width: 550px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nearby-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tile {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  position: relative;
  /* Square using padding-bottom for Android compatibility */
  padding-bottom: 100%;
  height: 0;
  overflow: hidden;
}

.tile-inner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tile:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.tile-icon {
  width: 60%;
  aspect-ratio: 1;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 12px;
  color: var(--primary);
}

.tile-icon i {
  font-size: clamp(20px, 4vw, 30px);
}

.tile-image {
  width: 85%;
  aspect-ratio: 1;
  margin: 0 auto 8px;
}

.tile-title {
  font-weight: 600;
  font-size: clamp(12px, 1.8vw, 14px);
  line-height: 1.3;
}

.tile-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Tiles with images - cleaner look */
.tile-has-image {
  background: transparent;
  border: none;
}

.tile-has-image:hover {
  border-color: transparent;
  box-shadow: none;
}

.tile-has-image .tile-image {
  width: 88%;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile-has-image:hover .tile-image {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Mixed grid - align icon tiles with image tiles */
.grid-mixed .tile:not(.tile-has-image) .tile-icon {
  width: 75%;
  border-radius: 14px;
}

/* Tip badge - desktop refinements */
.tile-badge {
  top: 10px;
  right: 10px;
}

/* ============================================================================
   HIGHLIGHT SLIDER
   ============================================================================ */

.hero-container .highlight-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-container .highlight-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  text-decoration: none;
  display: block;
}

.hero-container .highlight-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-container .highlight-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.hero-container .highlight-dots {
  position: absolute;
  bottom: 100px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 3;
}

.hero-container .highlight-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-container .highlight-dot.active {
  background: white;
  width: 24px;
  border-radius: 4px;
}

/* ============================================================================
   CONTENT PAGES
   ============================================================================ */

.content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.content h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
}

.content h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 10px;
}

.content p {
  margin: 0 0 16px;
}

.content ul, .content ol {
  padding-left: 24px;
  margin: 0 0 16px;
}

.content li {
  margin-bottom: 8px;
}

.content a {
  color: var(--primary);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
  display: none;
}

/* ============================================================================
   EMERGENCY PAGE
   ============================================================================ */

.emergency-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--error-dark);
  color: white;
  text-decoration: none;
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  transition: background 0.15s ease;
  margin-bottom: 16px;
}

.emergency-button:hover {
  background: var(--error);
}

/* ============================================================================
   GUIDEBOOK HEADER/FOOTER CONTENT
   ============================================================================ */

.guidebook-header,
.guidebook-footer {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 20px;
}

.guidebook-footer {
  margin-top: 32px;
  margin-bottom: 0;
  padding-top: 20px;
  border-top: 1px solid var(--stroke);
}

/* ============================================================================
   SMALL DESKTOP (1024px - 1199px) - Percentage based layout
   ============================================================================ */

@media (min-width: 1024px) and (max-width: 1199px) {
  .desktop-left-panel {
    width: calc(40% - 32px);
    padding: 32px;
  }
  
  .desktop-title {
    font-size: 32px;
  }
  
  .desktop-location {
    font-size: 16px;
  }
  
  .app-layout {
    width: calc(60% - 32px);
    left: auto;
    right: 16px;
  }

  .panel-resizer {
    right: calc(60% - 16px);
  }

  .app-layout::after {
    width: calc(60% - 32px);
  }

  .bottom-nav {
    width: calc(60% - 64px);
    right: 32px;
  }

  .search-overlay-mobile {
    width: calc(60% - 32px) !important;
    right: 16px !important;
  }

  /* Branding adjustments */
  .desktop-subtitle {
    font-size: 15px;
  }
  
  /* Featured card adjustments */
  .desktop-featured-card {
    padding: 20px;
    max-width: 100%;
  }
  
  .featured-title {
    font-size: 18px;
  }
  
  .featured-description {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
  
  .featured-excerpt {
    font-size: 13px;
    -webkit-line-clamp: 6;
  }
}

/* ============================================================================
   DESKTOP (>= 1200px) - Fixed 768px app width
   ============================================================================ */

@media (min-width: 1200px) {
  .desktop-left-panel {
    width: calc(100% - 768px - 48px);
    padding: 48px;
  }
  
  .app-layout {
    width: 768px;
    left: auto;
    right: 16px;
  }
  
  .app-layout::after {
    width: 768px;
  }
  
  .bottom-nav {
    width: calc(768px - 32px);
    right: 32px;
  }
  
  .search-overlay-mobile {
    width: 768px !important;
  }
}

/* ============================================================================
   LARGE DESKTOP (>= 1400px) - Larger fonts only
   ============================================================================ */

@media (min-width: 1400px) {
  .desktop-left-panel {
    padding: 64px;
  }
  
  .desktop-title {
    font-size: 52px;
  }
  
  .desktop-location {
    font-size: 20px;
  }
  
  .desktop-subtitle {
    font-size: 20px;
  }
  
  .featured-excerpt {
    -webkit-line-clamp: 10;
  }
}





/* Desktop branding */
@media (min-width: 1024px) {
  .powered-by {
    position: fixed;
    bottom: 110px;
    right: 16px;
    width: 768px;
    left: auto;
    padding: 20px;
    z-index: -1;
    pointer-events: none;
  }
  
  .powered-by > span {
    font-size: 11px;
  }
  
  .powered-by a {
    font-size: 16px;
    pointer-events: auto;
  }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .powered-by {
    width: calc(60% - 32px);
  }
}

/* Hide bottom nav when product sheet is open */
body:has(.sheet-overlay.active) .bottom-nav {
    display: none !important;
}

/* Product sheet - constrain to app-layout on desktop */
.sheet-overlay {
    top: 16px;
    right: 16px;
    bottom: 16px;
    left: auto;
    width: 768px;
    border-radius: 24px;
}

.product-sheet {
    right: 16px;
    bottom: 0;
    left: auto !important;
    width: 768px;
    max-width: 768px;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
}

.product-sheet.active {
    transform: translateY(0) !important;
}

/* Detail action buttons - equal width distribution */
.detail-actions {
    flex-direction: row;
}

.detail-action-btn {
    flex: 1;
    width: auto;
    justify-content: center;
}