/* =====================================================
   MOBILE — full app-like experience
   ===================================================== */

@media (max-width: 1024px) {
  .bottom-nav { display: block; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0)); padding-top: 64px !important; }
  /* Admin nema topbar/header — reset padding-a */
  body.is-admin { padding-top: 0 !important; padding-bottom: 0 !important; }
  .mobile-cta { display: none !important; }
  .topbar { display: none !important; }

  /* Header UVEK fiksan na vrhu, BEZ backdrop-filter (da ne pravi containing block) */
  .header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 200 !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .menu-toggle { position: relative; z-index: 210; }

  /* Burger button — premium */
  .menu-toggle {
    width: 46px !important; height: 46px !important;
    background: var(--brand-700) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px -3px rgba(13,148,136,.4) !important;
  }
  .menu-toggle:hover { background: var(--brand-800) !important; }
  .menu-toggle.is-open {
    background: #fff !important;
    color: var(--ink-900) !important;
    box-shadow: 0 4px 12px -3px rgba(0,0,0,.15) !important;
    border: 1px solid var(--line) !important;
  }

  /* === FULL-SCREEN MENU === */
  .nav { display: none; }
  .nav.open {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    background: #fff !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    pointer-events: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    animation: navFadeIn .22s ease !important;
  }
  @keyframes navFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  body.nav-open { overflow: hidden !important; height: 100vh; }
  body.nav-open .bottom-nav { display: none !important; }
  /* Drawer je premesten na document.body kroz JS portal — slobodno možemo
     da sakrijemo glavni header bez bojazni da uticamo na drawer */
  body.nav-open .header,
  body.nav-open .topbar { display: none !important; }

  /* Header drawer-a — brand SKROZ levo, X SKROZ desno */
  .nav-mobile-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid var(--line) !important;
    background: #fff !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
    width: 100% !important;
    margin: 0 !important;
    gap: 12px !important;
  }
  .nav-mobile-head .brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: var(--ink-900) !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  .nav-mobile-head .brand-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    flex-shrink: 0 !important;
  }
  .nav-mobile-head .brand small { display: none !important; }
  .menu-close {
    width: 44px !important;
    height: 44px !important;
    background: var(--bg-soft) !important;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    display: grid !important;
    place-items: center !important;
    color: var(--ink-800) !important;
    cursor: pointer !important;
    transition: all .15s !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .menu-close:hover { background: var(--ink-100) !important; }

  /* Linkovi — SKROZ levo, FULL width, bez padding-a kontejnera */
  .nav-links {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    gap: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    list-style: none !important;
  }
  .nav.open .nav-links a {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 16px 20px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    color: var(--ink-800) !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    text-decoration: none !important;
    transition: background .12s, color .12s !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    justify-content: flex-start !important;
    text-align: left !important;
    border-bottom: 1px solid var(--line) !important;
  }
  .nav.open .nav-links a:last-of-type {
    border-bottom: 0 !important;
  }
  .nav.open .nav-links a .ico {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--ink-700);
    display: grid; place-items: center;
    flex-shrink: 0;
    transition: all .15s;
  }
  .nav.open .nav-links a:hover { background: var(--bg-soft) !important; }
  .nav.open .nav-links a.is-active {
    background: var(--brand-50) !important;
    color: var(--brand-800) !important;
  }
  .nav.open .nav-links a.is-active .ico {
    background: var(--brand-700);
    color: #fff;
  }

  /* CTA dugmad — JEDNO PORED DRUGOG (Zakaži + Nalog) */
  .nav.open .nav-mobile-cta {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 16px !important;
    margin: 0 !important;
    border-top: 1px solid var(--line) !important;
    background: var(--bg-soft) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .nav.open .nav-mobile-cta a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 16px !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    border: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .nav.open .nav-mobile-cta a:nth-child(1) {
    background: var(--accent-500) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px -4px rgba(245,158,11,.45);
  }
  .nav.open .nav-mobile-cta a:nth-child(2) {
    background: var(--bg-soft) !important;
    color: var(--ink-800) !important;
  }

  /* Kontakt info na dnu — SAKRIJ na mobile drawer-u (već je u glavnom topbar/footer) */
  .nav.open .nav-mobile-contact,
  .nav-mobile-contact {
    display: none !important;
  }
  .nav-mobile-contact a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-800);
    text-decoration: none;
    padding: 6px 0;
  }
  .nav-mobile-contact a strong { color: var(--ink-900); font-weight: 700; }
  .nav-mobile-hours {
    display: flex; align-items: center; gap: 8px;
    color: var(--ink-500); font-size: 13px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px dashed var(--ink-200);
  }
}

/* Sakri menu-mobile delove na desktop-u */
@media (min-width: 1025px) {
  .nav-mobile-head, .nav-mobile-contact { display: none !important; }
  .nav-links { display: contents !important; }
  .nav-links a .ico { display: none !important; }
}

@media (max-width: 720px) {
  /* GLOBALNI OVERRIDE — sve inline grid 2/3/4 kolone -> 1 kolona */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns:repeat(2"],
  div[style*="grid-template-columns: repeat(2"],
  div[style*="grid-template-columns:repeat(3"],
  div[style*="grid-template-columns: repeat(3"],
  div[style*="grid-template-columns:repeat(4"],
  div[style*="grid-template-columns: repeat(4"],
  div[style*="grid-template-columns:1fr 320px"],
  div[style*="grid-template-columns:1fr 280px"],
  div[style*="grid-template-columns:1.2fr 1fr"],
  div[style*="grid-template-columns:1.4fr 1fr"],
  div[style*="grid-template-columns:1fr 380px"],
  div[style*="grid-template-columns:80px 1fr auto"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  /* Appt-card ostaje 2-col sa malom datum kockicom levo */
  .appt-card[style*="grid-template-columns:80px"],
  div.appt-card {
    grid-template-columns: 64px 1fr !important;
    gap: 12px !important;
  }
  .appt-card > div:last-child {
    grid-column: 1 / -1;
    display: flex; gap: 6px; justify-content: flex-end;
  }

  /* Page-header heading row */
  div[style*="display:flex"][style*="space-between"][style*="flex-wrap"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* TYPO + SPACING */
  body { font-size: 15.5px; }
  h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); line-height: 1.15; }
  h2 { font-size: clamp(1.4rem, 5.5vw, 1.8rem); line-height: 1.2; }
  h3 { font-size: 1.1rem; }
  .container { padding-inline: 16px; }
  .section { padding-block: 40px; }
  .section-tight { padding-block: 28px; }
  .section-head { margin-bottom: 28px; }

  .topbar { display: none; }

  /* HEADER — clean spacing, burger SKROZ desno */
  .header { box-shadow: 0 1px 0 rgba(0,0,0,.04); }
  .header .container {
    height: 64px;
    gap: 10px;
    padding-inline: 14px;
    display: flex !important;
    align-items: center !important;
  }
  .brand { font-size: 16px; gap: 9px; flex-shrink: 0; }
  .brand-icon { width: 36px; height: 36px; border-radius: 10px; }
  .brand-name { font-size: 16px; }
  .brand-name small { display: none; }
  /* KRITIČNO: header-cta uvek skroz desno */
  .header-cta {
    gap: 6px !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
  }
  .header-cta .btn-primary { display: none; }
  .header-cta .btn-account { display: none; }
  .menu-toggle { width: 44px; height: 44px; margin-right: 0 !important; }

  /* FULL-SCREEN MENU — bela pozadina, jasna struktura, BEZ "card-in-card" */
  .nav.open {
    top: 0 !important;
    inset: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }
  /* Linkovi — full width, levo, sa border-bottom kao separator */
  .nav.open .nav-links a {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    border-radius: 0 !important;
    padding: 16px 20px !important;
    margin: 0 !important;
    font-size: 16px !important;
    box-shadow: none !important;
    text-align: left !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
  .nav.open .nav-links a:last-of-type {
    border-bottom: 0 !important;
  }
  .nav.open .nav-links a:hover {
    background: var(--bg-soft) !important;
  }
  .nav.open .nav-links a.is-active {
    background: var(--brand-50) !important;
    color: var(--brand-800) !important;
    font-weight: 700 !important;
    border-left: 3px solid var(--brand-700) !important;
    padding-left: 17px !important;
  }
  .nav.open .nav-links a.is-active .ico {
    background: var(--brand-700) !important;
    color: #fff !important;
  }
  .nav.open .nav-mobile-cta {
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding: 16px 20px !important;
  }
  .nav.open .nav-mobile-cta a {
    border: 0 !important;
    padding: 14px !important;
    margin-bottom: 0 !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    justify-content: center !important;
  }

  /* HERO */
  .hero { padding-block: 28px 32px; }
  .hero-grid { gap: 24px; }
  .hero-eyebrow { font-size: 12px; padding: 5px 12px; }
  .hero h1 { margin-bottom: 14px; }
  .hero p.lead { font-size: 16px; margin-bottom: 20px; }
  .hero-ctas { width: 100%; flex-direction: column; gap: 10px; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .trust-row { font-size: 13px; gap: 10px; margin-top: 18px; }
  .hero-art { aspect-ratio: 16/11; border-radius: 18px; }
  .hero-card { padding: 10px 12px; font-size: 12px; border-radius: 12px; }
  .hero-card.tl { top: 14px; left: 14px; }
  .hero-card.br { bottom: 14px; right: 14px; }
  .hero-card-icon { width: 32px; height: 32px; border-radius: 9px; }
  .mini-book { grid-template-columns: 1fr; padding: 10px; gap: 6px; border-radius: 14px; }
  .mini-book select, .mini-book input { padding: 12px 14px; font-size: 16px; }
  .mini-book .btn { width: 100%; justify-content: center; padding: 13px; }

  /* CARDS / GRIDS */
  .service-grid { grid-template-columns: 1fr; gap: 14px; }
  .service-card { padding: 18px; border-radius: 14px; }
  .service-card .icon-wrap { width: 44px; height: 44px; margin-bottom: 12px; }
  .service-card h3 { font-size: 1.05rem; }
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .therapist-card { border-radius: 14px; }
  .therapist-info { padding: 12px 14px; }
  .therapist-info h3 { font-size: 0.95rem; }
  .therapist-info .title { font-size: 11.5px; }
  .therapist-info .meta { font-size: 11.5px; }
  .review-grid { grid-template-columns: 1fr; }
  .review { padding: 18px; border-radius: 14px; }
  .post-grid { grid-template-columns: 1fr; gap: 14px; }
  .post-card { border-radius: 14px; }

  /* STEPS */
  .steps { gap: 20px; }
  .step-num { width: 48px; height: 48px; font-size: 18px; margin-bottom: 12px; }
  .step h3 { font-size: 1.05rem; }
  .step p { font-size: 14px; }

  /* PAGE HEADER */
  .page-header { padding: 24px 0 18px; }
  .breadcrumbs { font-size: 12px; margin-bottom: 10px; }
  .page-header p { font-size: 15px; }

  /* CTA BANNER */
  .cta-banner { padding: 28px 22px; border-radius: 18px; }
  .cta-banner h2 { font-size: 1.4rem; margin-bottom: 8px; }
  .cta-banner p { font-size: 15px; margin-bottom: 18px; }
  .cta-banner .btn { width: 100%; justify-content: center; }

  /* LOCATION */
  .location-grid { grid-template-columns: 1fr; gap: 24px; }
  .map { height: 260px; border-radius: 14px; }

  /* FOOTER */
  .footer { padding-block: 40px 16px; margin-top: 48px; }
  .footer-grid { gap: 28px; margin-bottom: 28px; }
  .footer h4 { margin-bottom: 12px; font-size: 13px; }
  .footer-tagline { font-size: 13.5px; }
  .footer-bottom { font-size: 12px; flex-direction: column; gap: 10px; align-items: flex-start; }

  /* FORMS */
  .field { margin-bottom: 14px; }
  .field input, .field select, .field textarea {
    padding: 14px 14px;
    font-size: 16px;
    border-radius: 12px;
  }
  .checkbox-row { padding: 6px 0; font-size: 14px; }
  .checkbox-row input { width: 22px; height: 22px; }
  .btn { padding: 13px 18px; font-size: 15px; border-radius: 12px; }
  .btn-lg { padding: 15px 22px; font-size: 16px; border-radius: 14px; }

  /* PRICING */
  .price-cat-head { padding: 12px 16px; font-size: 1rem; }
  .price-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 16px;
  }
  .price-row .name { font-size: 15px; }
  .price-row .name small { display: block; font-size: 13px; margin-top: 4px; }
  .price-row .duration { display: block; font-size: 12px; color: var(--ink-500); }
  .price-row .price { text-align: left; font-size: 17px; }
  .price-row .badges { margin-top: 8px; flex-wrap: wrap; }
  .price-row .badges .btn { width: 100%; padding: 10px; }

  /* FAQ */
  .faq-item { border-radius: 12px; margin-bottom: 8px; }
  .faq-q { padding: 16px 18px; font-size: 15px; }
  .faq-a { padding: 0 18px 16px; font-size: 14px; }

  /* THERAPIST PROFILE */
  .therapist-profile { gap: 24px; }
  .therapist-profile .photo {
    aspect-ratio: 16/12;
    max-width: none;
    border-radius: 16px;
    font-size: 60px;
  }
  .therapist-profile .meta-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .therapist-profile .meta-item { padding: 10px 12px; }
  .therapist-profile .meta-item small { font-size: 10px; }
  .therapist-profile .meta-item strong { font-size: 0.9rem; }

  /* SERVICE DETAIL */
  .service-side { padding: 18px; border-radius: 16px; }
  .service-side .price { font-size: 1.6rem; }

  /* BOOKING */
  .booking-shell .container { padding-top: 16px !important; padding-bottom: 32px !important; }
  .booking-progress { padding: 12px 0 18px; gap: 4px; }
  .booking-step .num { width: 28px; height: 28px; font-size: 13px; }
  .booking-step .label { display: none; }
  .booking-step + .booking-step::before { width: 14px; }
  .booking-content { padding: 18px !important; border-radius: 16px; }
  .booking-content h2 { font-size: 1.3rem; }
  .choice-grid { grid-template-columns: 1fr; gap: 10px; }
  .choice { padding: 14px; border-radius: 12px; }
  .choice .choice-icon { width: 36px; height: 36px; margin-bottom: 8px; }
  .choice h4 { font-size: 0.95rem; }
  .choice .meta { font-size: 12.5px; }
  .booking-footer { padding-top: 18px; margin-top: 18px; gap: 8px; }
  .booking-footer .btn { padding: 12px 16px; font-size: 14px; flex: 1; justify-content: center; }
  .booking-step2-grid { gap: 18px; }
  .cal-month {
    padding: 12px;
    border-radius: 14px;
    overflow: hidden;
    max-width: 100%;
  }
  .calendar-month {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    min-width: 0;
  }
  .cal-cell { min-width: 0; }
  .cal-cell.cell-avail.is-selected,
  .calendar-month .cal-cell.is-selected {
    box-shadow: none !important;
  }
  .cal-weekdays { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  body, html { overflow-x: hidden; }
  .cal-nav h3 { font-size: 0.95rem; }
  .cal-nav button { width: 36px; height: 36px; }
  .cal-weekdays { gap: 4px; margin-bottom: 8px; padding-bottom: 8px; }
  .cal-weekdays span { font-size: 10px; }
  .calendar-month { gap: 4px; }
  .cal-cell { min-height: 46px; border-radius: 8px; padding: 2px; }
  .cal-cell .day { font-size: 0.95rem; }
  .cal-cell .count { font-size: 9px; margin-top: 2px; }
  .cal-legend { font-size: 11px; gap: 12px; }
  .slots-side { padding: 14px; border-radius: 14px; }
  .slots-grid-compact { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .slot { padding: 11px 6px; font-size: 13.5px; }
  .summary { padding: 18px; border-radius: 14px; }
  .summary-row { font-size: 13.5px; }
  .summary-total { font-size: 16px; }

  /* MOJ NALOG */
  .filter-bar {
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .chip { padding: 8px 12px; font-size: 13px; flex-shrink: 0; white-space: nowrap; }

  /* TABELE -> KARTICE */
  .tbl, .tbl thead, .tbl tbody, .tbl th, .tbl td, .tbl tr { display: block; }
  .tbl thead { display: none; }
  .tbl tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 10px;
    padding: 14px 16px;
  }
  .tbl tr + tr td { border-top: 0; }
  .tbl td {
    padding: 6px 0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    text-align: right;
  }
  .tbl td:first-child { padding-top: 0; }
  .tbl td > strong:first-child { text-align: left; }
  .tbl td::before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
    text-align: left;
  }

  /* ADMIN */
  .admin-shell { flex-direction: column; padding-bottom: 0; }
  .admin-sidebar {
    width: 100%;
    padding: 12px 14px;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .admin-sidebar::-webkit-scrollbar { display: none; }
  .admin-sidebar .brand { display: none; }
  .admin-sidebar .brand-name, .admin-nav a span { display: inline; }
  .admin-nav {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav a {
    flex-shrink: 0;
    padding: 8px 12px;
    margin: 0;
    font-size: 13px;
    white-space: nowrap;
    border-radius: 10px;
  }
  .admin-nav > div {
    display: flex;
    border-top: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .admin-main { padding: 16px; }
  .admin-header { margin-bottom: 18px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .admin-header h1 { font-size: 1.4rem; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
  .kpi { padding: 14px; }
  .kpi small { font-size: 10px; }
  .kpi .val { font-size: 1.5rem; }

  /* AUTH cards */
  .booking-shell .container { padding-inline: 16px !important; }
}

/* Tablet */
@media (min-width: 721px) and (max-width: 1024px) {
  .bottom-nav .bottom-nav-grid { max-width: 480px; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Veoma mali ekrani */
@media (max-width: 360px) {
  .container { padding-inline: 12px; }
  h1 { font-size: 1.55rem; }
  .booking-content { padding: 14px !important; }
  .cal-cell { min-height: 40px; }
  .cal-cell .day { font-size: 0.9rem; }
  .slots-grid-compact { grid-template-columns: repeat(2, 1fr); }
}

button, a { -webkit-tap-highlight-color: rgba(13,148,136,.15); }
