/* ──────────────────────────────────────────────────────────────
   Mobile/Tablet overrides for Home page
   - home.css remains the desktop/base stylesheet
   - This file contains ONLY responsive overrides
   - Keep desktop appearance unchanged
────────────────────────────────────────────────────────────── */

/* Global safety: prevent accidental horizontal scroll on small screens */
@media (max-width: 1200px) {
  /* FIX: overflow-x:hidden on body kills position:sticky on mobile browsers.
     Use overflow-x:clip instead — it clips visually but doesn't create a
     scroll container, so sticky keeps working. */
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  /* Also override the base body overflow-x: hidden from home.css */
  body {
    overflow-x: clip !important;
  }

  /* Reduce large horizontal paddings progressively */
  #o-nama,
  #usluge,
  #cjenik,
  #kontakt,
  footer {
    padding-left: 60px;
    padding-right: 60px;
  }

  /* Navigation: allow wrapping without overflow */
  #nav {
    gap: 24px;
    padding-left: 26px;
    padding-right: 26px;
  }

  .nav-links {
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Usluge: allow 2 columns on medium widths */
  .usluge-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 980px) {
  /* ── Header: always 100vh, adjust logo + positions ── */
  #header {
    height: 100vh;
    overflow: clip;
  }

  /* Swap to wide flat U wave on mobile */
  .header-wave--desktop { display: none; }
  .header-wave--mobile  { display: block; }

  .header-wave {
    height: 46vh;
    min-height: 200px;
  }

  .header-logo {
    max-width: 200px;
    width: min(200px, 54vw);
  }

  #header .hero-tagline {
    top: 12vh;
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    padding: 0 20px;
  }

  #header .btn-hero {
    bottom: 10vh;
  }

  /* ── Desktop nav: hide on mobile, replaced by hamburger ── */
  #nav {
    display: none !important;
  }

  /* ── Sections ── */
  #o-nama {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 3rem;
  }

  .o-nama-images { height: 420px; }
  .blob-1 { width: 72%; height: 76%; }
  .blob-2 { width: 56%; height: 56%; border-width: 5px; }
  .o-nama-stats { flex-wrap: wrap; gap: 22px; }

  #usluge { padding-top: 90px; padding-bottom: 110px; }
  .usluge-grid { grid-template-columns: repeat(2, 1fr); }
  #cjenik .cjenik-grid { grid-template-columns: 1fr; gap: 34px; }
  #kontakt { grid-template-columns: 1fr; gap: 44px; }
  .kontakt-form { padding: 40px; }

  /* Booking CTA block */
  .kontakt-booking { padding: 36px; }

  /* Maps section */
  #mapa { padding-left: 22px; padding-right: 22px; padding-bottom: 70px; }
  .mapa-embed iframe { height: 300px; }

  .footer-top { flex-direction: column; align-items: flex-start; gap: 28px; }
  .footer-links { width: 100%; gap: 40px; flex-wrap: wrap; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 14px; }

  .btn-hero {
    height: 54px;
    padding: 0 40px;
    font-size: .78rem;
  }
}

@media (max-width: 720px) {
  #header {
    height: 100vh;
  }

  .header-logo {
    max-width: 160px;
    width: min(160px, 44vw);
  }

  #header .hero-tagline {
    top: 10vh;
    font-size: clamp(1.4rem, 5.5vw, 2rem);
  }

  #header .btn-hero {
    bottom: 11vh;
  }

  /* Nav: tighter but still comfortable */
  #nav {
    padding: 10px 10px 10px;
    gap: 6px;
  }

  .nav-links {
    font-size: 1rem;
    gap: 0;
  }

  .nav-links a {
    min-height: 46px;
    padding: 0 10px;
    font-size: .95rem;
  }

  #nav > a.btn-primary {
    max-width: 100%;
    height: 50px;
    border-radius: 12px;
  }

  /* O nama blobs: reduce height so it doesn't dominate */
  #o-nama {
    padding-top: calc(32px + 2.5rem);
    padding-bottom: 90px;
  }

  .o-nama-images {
    height: 340px;
  }

  .blob-accent {
    width: 84px;
    height: 84px;
    bottom: 72px;
  }

  /* Usluge: 1 column */
  #usluge {
    padding: 90px 20px 100px;
  }

  .usluge-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .card-img {
    height: 200px;
  }

  /* Cjenik: stack row items if needed to avoid collisions */
  .price-row {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
  }

  .price-row .price {
    justify-self: end;
  }

  /* Kontakt: comfortable form padding */
  #kontakt {
    padding-top: 90px;
    padding-bottom: 70px;
  }

  .kontakt-form { padding: 28px; }
  .kontakt-booking { padding: 28px; }

  /* Maps section */
  #mapa { padding-left: 16px; padding-right: 16px; padding-bottom: 60px; }
  .mapa-embed iframe { height: 260px; }
  .mapa-actions { flex-wrap: wrap; }

  /* Closing line under contact: reduce side padding */
  section[style*="padding: 0 80px 90px"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* Footer: center a bit better on narrow screens */
  footer {
    padding-top: 54px;
    padding-bottom: 36px;
  }

  .footer-links {
    gap: 28px;
  }

  .footer-bottom {
    align-items: center;
    text-align: center;
  }

  /* ── Header CTA responsive (720px) ── */
  .header-cta {
    gap: 20px;
    padding: 0 20px 5rem;
  }

  .btn-hero {
    height: 54px;
    padding: 0 40px;
    font-size: .78rem;
  }
}

@media (max-width: 480px) {
  #header {
    height: 100vh;
  }

  .header-wave {
    height: 48vh;
    min-height: 200px;
  }

  .header-cta {
    display: contents;
  }

  .header-logo {
    max-width: 140px;
    width: min(140px, 44vw);
  }

  #header .hero-tagline {
    top: 9vh;
    font-size: clamp(1.3rem, 6vw, 1.8rem);
    padding: 0 16px;
  }

  #header .btn-hero {
    bottom: 12vh;
  }

  /* Nav: keep generous targets on smallest phones */
  #nav {
    padding: 8px 8px;
    gap: 4px;
  }

  .nav-links {
    font-size: .95rem;
    letter-spacing: .06em;
    gap: 0;
  }

  .nav-links a {
    min-height: 48px;
    min-width: 48px;
    padding: 0 8px;
    font-size: .9rem;
  }

  #nav > a.btn-primary {
    height: 52px;
    font-size: .78rem;
  }

  /* O nama image composition */
  .o-nama-images {
    height: 300px;
  }

  /* Stats: allow wrapping cleanly */
  .o-nama-stats {
    gap: 16px;
  }

  /* Cards */
  .card-img {
    height: 180px;
  }

  /* Form */
  .kontakt-form { padding: 22px; }
  .kontakt-booking { padding: 22px; }
  .booking-title { font-size: 2rem; }
  .btn-booking { width: 100%; justify-content: center; }

  /* Maps */
  .mapa-embed iframe { height: 220px; }
  .btn-maps { width: 100%; justify-content: center; }

  /* ── Header CTA responsive (480px) ── */
  .hero-tagline {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
  }

  .btn-hero {
    height: 52px;
    padding: 0 36px;
    width: 100%;
    max-width: 300px;
  }
}

/* Touch devices: ensure default cursor behavior */
@media (hover: none), (pointer: coarse) {
  body {
    cursor: auto;
  }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE HAMBURGER MENU  (all breakpoints — always hidden on desktop)
══════════════════════════════════════════════════════════════ */

/* The hamburger toggle button — fixed pill in top-right corner */
.mob-toggle {
  display: none; /* hidden on desktop */
}

/* Overlay: completely out of layout on desktop */
.mob-menu {
  display: none;
}

@media (max-width: 980px) {
  .mob-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;

    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 100001; /* above the overlay */

    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--dark, #2a2520);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .22);
    cursor: pointer;
    padding: 0;

    transition: background .25s, transform .2s;
  }

  .mob-toggle:active {
    transform: scale(.93);
  }

  /* Three bars */
  .mob-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--cream, #f5f0e8);
    transition: transform .3s cubic-bezier(.23,1,.32,1), opacity .2s;
    transform-origin: center;
  }

  /* Animate to × when open */
  .mob-toggle.is-open .mob-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mob-toggle.is-open .mob-toggle__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .mob-toggle.is-open .mob-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ── Full-screen overlay ── */
  .mob-menu {
    /* hidden by default */
    position: fixed;
    inset: 0;
    z-index: 100000;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;

    background: var(--dark, #2a2520);

    /* Start invisible + slightly scaled */
    opacity: 0;
    pointer-events: none;
    transform: scale(1.04);
    transition: opacity .32s cubic-bezier(.23,1,.32,1), transform .32s cubic-bezier(.23,1,.32,1);
  }

  .mob-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  /* Nav links inside the overlay */
  .mob-menu__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 0 32px;
  }

  .mob-menu__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 340px;
    height: 68px;
    border-radius: 16px;

    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--cream, #f5f0e8);

    transition: background .2s, color .2s;
    text-decoration: none;
  }

  .mob-menu__link:active,
  .mob-menu__link:focus-visible {
    background: rgba(255, 255, 255, .07);
  }

  /* Prominent CTA button */
  .mob-menu__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    width: 100%;
    max-width: 340px;
    height: 62px;
    border-radius: 999px;

    background: var(--warm, #c8a98a);
    color: var(--dark, #2a2520);
    font-family: 'Jost', sans-serif;
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    text-decoration: none;

    transition: background .2s, transform .2s;
  }

  .mob-menu__cta:active {
    transform: scale(.97);
    background: #d4b99a;
  }

  /* Small footer label at bottom of overlay */
  .mob-menu__footer {
    position: absolute;
    bottom: 28px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Jost', sans-serif;
    font-size: .75rem;
    font-weight: 300;
    letter-spacing: .12em;
    color: rgba(245, 240, 232, .35);
    text-transform: uppercase;
  }
}
