/* Mobile app-like layer.
   This file only changes small-screen layout and can be removed to restore the previous mobile web UI. */

.nav-desktop-only {
  display: none;
}

@media (min-width: 769px) {
  .nav-desktop-only { display: inline-flex; }
}

@media (max-width: 768px) {
  :root {
    --mobile-page-pad: 18px;
    --mobile-bottom-nav: 78px;
  }

  html {
    scroll-padding-top: 82px;
  }

  body {
    background: var(--color-cream);
    padding-bottom: calc(var(--mobile-bottom-nav) + env(safe-area-inset-bottom));
  }

  .container,
  .container-narrow {
    padding-left: var(--mobile-page-pad);
    padding-right: var(--mobile-page-pad);
  }

  .site-header {
    left: 0;
    top: 0;
    transform: none;
    width: 100%;
    max-width: none;
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    pointer-events: none;
  }

  .header-inner {
    height: 54px;
    padding: 0 16px;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(15, 2, 0, 0.08);
    pointer-events: auto;
  }

  .logo {
    display: block;
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.02;
    color: var(--color-dark);
  }

  .logo span {
    display: block;
    color: var(--color-accent);
  }

  .menu-toggle {
    display: none !important;
  }

  .nav-links,
  .nav-links.open {
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(15, 2, 0, 0.08);
    border-radius: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 4px 20px rgba(15, 2, 0, 0.12);
    display: flex;
    flex-direction: row;
    gap: 2px;
    height: 56px;
    justify-content: flex-start;
    left: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 8px;
    position: fixed;
    right: 16px;
    top: auto;
    transform: none;
    width: auto;
    z-index: 1200;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links::-webkit-scrollbar,
  .filters::-webkit-scrollbar,
  .quick-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    align-items: center;
    border: 0;
    border-radius: 10px;
    color: #666;
    display: inline-flex;
    flex: 1 1 0;
    font-size: 0.75rem;
    font-weight: 600;
    justify-content: center;
    min-height: 42px;
    padding: 0 10px;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    width: auto;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
  }

  .nav-links .nav-mobile-tab {
    display: inline-flex;
  }

  .nav-links a[href="index.html"] { order: 1; }
  .nav-links a[href="attractions.html"] { order: 2; }
  .nav-links a[href="tours.html"] { order: 3; }
  .nav-links a[href="guide.html"] { order: 4; }
  .nav-links a[href="where-to-stay.html"] { order: 5; }
  .nav-links a[href="eat-and-drink.html"] { order: 6; }
  .nav-links a[href="bars.html"] { order: 7; }
  .nav-links a[href="whats-on.html"] { order: 8; }
  .nav-links a[href="history.html"] { order: 9; }
  .nav-links a[href="local-tips.html"] { order: 10; }

  .header-inner > .lang-toggle {
    position: fixed;
    bottom: calc(76px + env(safe-area-inset-bottom));
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.95);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    z-index: 1201;
    cursor: pointer;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }

  .lang-toggle {
    background: var(--color-white);
    border-color: var(--color-border);
    border-radius: 8px;
    color: var(--color-dark);
    flex: 0 0 auto;
    margin-left: 2px;
    min-height: 46px;
    padding: 0 14px;
  }

  .hero {
    align-items: flex-end;
    min-height: min(680px, 86vh);
    padding: 92px 0 24px;
  }

  .hero-bg::after {
    background: linear-gradient(to top, rgba(15, 2, 0, 0.72), rgba(15, 2, 0, 0.16));
  }

  .hero-layout {
    display: block;
    padding: 0 var(--mobile-page-pad);
  }

  .hero-text {
    max-width: 100%;
    padding-bottom: 14px;
  }

  .hero-text h1 {
    color: #fff;
    font-size: 3rem !important;
    line-height: 0.96;
    margin-bottom: 14px;
  }

  .hero-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 18px;
  }

  .hero-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .hero-actions .btn,
  .btn {
    border-radius: 8px;
    justify-content: center;
    min-height: 48px;
  }

  .plan-widget {
    display: none;
  }

  .page-hero {
    min-height: 58vh;
    padding-top: 88px;
  }

  .page-hero-content {
    padding: 0 var(--mobile-page-pad) 32px;
  }

  .page-hero h1 {
    font-size: 3rem !important;
    line-height: 0.95;
  }

  .page-hero .subtitle {
    color: rgba(255, 255, 255, 0.86);
    font-size: 1rem;
    line-height: 1.55;
  }

  .section {
    padding: 40px 0;
  }

  .section-header {
    margin-bottom: 24px;
    text-align: left;
  }

  .section-header h2 {
    font-size: 2rem !important;
    line-height: 1.05;
    margin-bottom: 10px;
  }

  .section-header p {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .section-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
  }

  .card-grid,
  .card-grid-2,
  .card-grid-3,
  .card-grid-4,
  .info-grid,
  .info-grid-3,
  .features-grid,
  .explore-sections-grid,
  .explore-bottom-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
  }

  .card,
  .info-box,
  .listing-card,
  .hotel-card,
  .nav-card,
  .explore-featured,
  .explore-side-card {
    border-radius: 8px !important;
    box-shadow: 0 6px 22px rgba(15, 2, 0, 0.06);
  }

  .card {
    padding: 0;
  }

  .card:hover,
  .info-box:hover,
  .hotel-card:hover,
  .nav-card:hover {
    transform: none;
  }

  .card-image {
    height: 190px;
  }

  .card-body {
    padding: 18px;
  }

  .card-body h3 {
    font-family: var(--font-sans);
    font-size: 1.25rem !important;
    font-weight: 900;
  }

  .card-body p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .card-meta {
    border-top-color: var(--color-border-light);
    gap: 8px;
  }

  .card-meta-item,
  .tag,
  .amenity-tag {
    border-radius: 8px !important;
  }

  .filters,
  .quick-links {
    justify-content: flex-start;
    margin-left: calc(var(--mobile-page-pad) * -1);
    margin-right: calc(var(--mobile-page-pad) * -1);
    overflow-x: auto;
    padding: 0 var(--mobile-page-pad) 8px;
  }

  .filter-btn,
  .tag {
    border-radius: 8px;
    flex: 0 0 auto;
    font-weight: 800;
    min-height: 42px;
    white-space: nowrap;
  }

  .stats-bar {
    border-radius: 8px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 40px;
  }

  .stat-item {
    padding: 20px 12px;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .info-box {
    padding: 22px 18px;
  }

  .info-box h3 {
    font-family: var(--font-sans);
    font-size: 1.05rem !important;
    font-weight: 900;
  }

  .site-footer {
    padding-bottom: calc(var(--mobile-bottom-nav) + 28px);
  }

  /* Homepage: native-app style planning rail */
  .home-page .section-white {
    background: var(--color-cream);
    overflow: hidden;
  }

  .home-page .section-white .section-header {
    margin-bottom: 18px;
  }

  .home-page .section-white .section-header h2::before {
    content: "Planifica rapid";
    color: var(--color-accent);
    display: block;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 2px;
    line-height: 1;
    margin-bottom: 8px;
    text-transform: uppercase;
  }

  .home-page .section-white .section-header .underline {
    display: none;
  }

  .home-page .section-white .card-grid-4 {
    display: flex;
    gap: 14px;
    grid-template-columns: none;
    margin-left: calc(var(--mobile-page-pad) * -1);
    margin-right: calc(var(--mobile-page-pad) * -1);
    overflow-x: auto;
    padding: 0 var(--mobile-page-pad) 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .home-page .section-white .card-grid-4::-webkit-scrollbar {
    display: none;
  }

  .home-page .section-white .card-grid-4 > .card {
    flex: 0 0 224px;
    min-height: 354px;
    scroll-snap-align: start;
  }

  .home-page .section-white .card-grid-4 .card-image {
    height: 132px !important;
  }

  .home-page .section-white .card-grid-4 .card-body {
    padding: 14px;
  }

  .home-page .section-white .card-grid-4 .card-body h3 {
    color: var(--color-dark) !important;
    font-family: var(--font-sans);
    font-size: 1.1rem !important;
    line-height: 1.05;
    margin-bottom: 10px;
  }

  .home-page .section-white .card-grid-4 .card-body p {
    display: -webkit-box;
    font-size: 0.86rem;
    line-height: 1.48;
    margin-bottom: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .home-page .section-white .card-grid-4 .card-tag {
    background: var(--color-accent) !important;
    border-radius: 8px !important;
    color: var(--color-white) !important;
    font-size: 0.62rem;
    letter-spacing: 1px;
    padding: 5px 9px !important;
  }

  .home-page .section-white .card-grid-4 .tag {
    background: #f7edea !important;
    color: var(--color-accent-dark);
    font-size: 0.68rem;
    min-height: auto;
    padding: 5px 8px !important;
  }

  .home-page .section-white .card-grid-4 .btn {
    border-radius: 8px;
    min-height: 42px;
    padding: 9px 14px !important;
  }

  .home-page .section-white .container > div[style*="justify-content: center"] {
    justify-content: center !important;
    margin-left: calc(var(--mobile-page-pad) * -1) !important;
    margin-right: calc(var(--mobile-page-pad) * -1) !important;
    margin-top: 24px !important;
    overflow-x: auto;
    padding: 0 var(--mobile-page-pad) 4px;
  }

  /* Homepage: native-app style section links */
  .home-page .explore-sections-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
  }

  .home-page .explore-sections-grid + .explore-bottom-grid {
    gap: 14px;
    margin-top: 14px;
  }

  .home-page .explore-featured {
    aspect-ratio: auto;
    min-height: 206px;
  }

  .home-page .explore-featured .nav-card-content {
    padding: 22px;
  }

  .home-page .explore-featured h3 {
    font-family: var(--font-sans);
    font-size: 1.72rem !important;
    font-weight: 900;
    line-height: 1.05;
  }

  .home-page .explore-featured p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.93rem !important;
    line-height: 1.45;
  }

  .home-page .explore-featured .btn,
  .home-page .explore-featured .card-arrow {
    display: none;
  }

  .home-page .explore-side-card {
    align-items: stretch;
    display: flex;
    flex-direction: row;
    min-height: 122px;
  }

  .home-page .explore-side-card > div:first-child {
    flex: 0 0 96px !important;
    height: auto !important;
    width: 96px !important;
  }

  .home-page .explore-side-card > div:last-child {
    padding: 16px 14px !important;
  }

  .home-page .explore-side-card h3 {
    color: var(--color-dark);
    font-family: var(--font-sans);
    font-size: 1.26rem !important;
    font-weight: 900;
    line-height: 1.1;
  }

  .home-page .explore-side-card p {
    display: -webkit-box;
    font-size: 0.86rem !important;
    line-height: 1.42;
    margin-bottom: 8px !important;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .home-page .explore-side-card span[style*="letter-spacing"] {
    color: var(--color-accent-dark) !important;
    font-size: 0.66rem !important;
    font-weight: 900 !important;
  }

  .home-page .explore-side-card span[style*="Vezi detalii"] {
    display: none !important;
  }

  .home-page .explore-bottom-grid {
    grid-template-columns: 1fr;
  }

  .home-page .explore-bottom-grid .nav-card {
    min-height: 138px;
  }

  .home-page .explore-bottom-grid .nav-card-content {
    padding: 18px;
  }

  .home-page .explore-bottom-grid .nav-card h3 {
    font-family: var(--font-sans);
    font-size: 1.28rem !important;
    font-weight: 900;
  }

  .guide-tabs {
    margin-bottom: 18px;
  }

  .guide-hub-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
  }

  .guide-hub-grid .explore-featured {
    aspect-ratio: auto;
    min-height: 206px;
  }

  .guide-hub-grid .explore-featured .nav-card-content {
    padding: 22px;
  }

  .guide-hub-grid .explore-featured h3 {
    font-family: var(--font-sans);
    font-size: 1.72rem !important;
    font-weight: 900;
    line-height: 1.05;
  }

  .guide-hub-grid .explore-side-card {
    align-items: stretch;
    display: flex;
    flex-direction: row;
    min-height: 122px;
  }

  .guide-hub-grid .explore-side-card > div:first-child {
    flex: 0 0 96px !important;
    height: auto !important;
    width: 96px !important;
  }

  .guide-hub-grid .explore-side-card > div:last-child {
    padding: 16px 14px !important;
  }

  .guide-hub-grid .explore-side-card h3 {
    color: var(--color-dark);
    font-family: var(--font-sans);
    font-size: 1.26rem !important;
    font-weight: 900;
    line-height: 1.1;
  }

  .guide-hub-grid .explore-side-card p {
    display: -webkit-box;
    font-size: 0.86rem !important;
    line-height: 1.42;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 480px) {
  :root {
    --mobile-page-pad: 16px;
  }

  .hero-text h1,
  .page-hero h1 {
    font-size: 2.45rem !important;
  }

  .nav-links a {
    padding: 0 11px;
  }
}
