/* ===========================
   LAYOUT — Premium Taxi v7
   v7: Fluid font-size (clamp) za hero p, calc-header h2, contact h2.
       Nav collision guard: max-width: calc(100% - 380px) na desktopu.
=========================== */

/* ===================== PAGES ===================== */
.page        { display:none; min-height:100vh; padding-top:var(--h-h); }
.page.active { display:block; animation:fadeUp .4s ease both; }

/* ===================== HEADER ===================== */
header {
  position: fixed; top:0; left:0; right:0; z-index:900;
  height: var(--h-h);
  /* Solid fallback first (Firefox Android, older browsers) */
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  transition: background .35s, border-color .35s;
}
/* Progressive enhancement: blur only where supported */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  header {
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

.header-inner {
  /* TWO-ZONE grid: logo | actions (nav is now a sibling outside header) */
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 var(--px);
  max-width: 1280px;
  margin: 0 auto;
  gap: 0.5rem;
}

/* Logo — zone 1 */
.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; font-weight: 500; letter-spacing: .05em;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: .48rem;
  user-select: none; -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.logo-icon {
  width: 27px; height: 27px;
  border: 1.5px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .76rem; color: var(--gold); flex-shrink: 0;
}
.logo span { color: var(--gold); }

/* Nav — desktop: fixed within header zone height; mobile: see responsive.css */
nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: var(--h-h);
  z-index: 901; /* above header (900), outside its backdrop-filter stacking context */
  display: flex; align-items: center; justify-content: center;
  gap: 0; min-width: 0;
  /* Collision guard: never wider than viewport minus logo+actions space */
  max-width: calc(100% - 380px);
  overflow: hidden;
  pointer-events: auto;
}
nav a {
  font-size: .7rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text2); text-decoration: none;
  padding: .36rem .58rem; border-radius: var(--radius);
  transition: color .2s; white-space: nowrap; flex-shrink: 1; min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
nav a:hover, nav a.active { color: var(--gold); }

/* Actions — zone 3 */
.header-actions {
  display: flex; align-items: center; gap: .5rem; flex-shrink: 0;
}

.theme-toggle {
  width: 33px; height: 33px; border: 1px solid var(--border); border-radius: 50%;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: .88rem; flex-shrink: 0;
  transition: border-color .2s, color .2s, transform .3s;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); transform: rotate(18deg); }

.hamburger {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: var(--radius); width: 34px; height: 34px; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text); flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}
.hamburger.hamburger--visible { display: flex !important; }
.hamburger span { display: block; width: 15px; height: 1.5px; background: currentColor; transition: all .26s; border-radius: 2px; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ===================== HERO ===================== */
.hero {
  position: relative; min-height: calc(100vh - var(--h-h));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--bg);
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 65% 55% at 80% 35%, rgba(201,168,76,.07) 0%, transparent 68%),
    radial-gradient(ellipse 45% 60% at 15% 75%, rgba(201,168,76,.04) 0%, transparent 60%);
}
.hero-lines { position: absolute; inset: 0; overflow: hidden; opacity: .05; pointer-events: none; }
.hero-lines::before, .hero-lines::after { content: ''; position: absolute; top: -50%; width: 1px; height: 200%; background: var(--gold); }
.hero-lines::before { left: 42%; transform: rotate(11deg); }
.hero-lines::after  { left: 65%; transform: rotate(11deg); }

.hero-content {
  position: relative; z-index: 2; max-width: 780px; text-align: center;
  padding: 3rem var(--px); animation: fadeUp .82s ease both;
}
.hero h1 { font-size: clamp(2.6rem,7.5vw,5.2rem); font-weight: 300; line-height: 1.06; margin-bottom: 1.3rem; }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero p  { font-size: clamp(.92rem, 1.5vw, 1.05rem); color: var(--text2); max-width: 490px; margin: 0 auto 2.3rem; }
.hero-actions { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }

/* ===================== PAGE HERO ===================== */
.page-hero, .pricing-hero {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg) 100%);
  padding: 3.25rem var(--px) 2.25rem; text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-hero h1, .pricing-hero h1 { font-size: clamp(1.85rem,4.5vw,3.1rem); margin-bottom: .3rem; }
.page-hero p, .pricing-hero p   { color: var(--text2); font-size: .96rem; max-width: 42rem; margin-left: auto; margin-right: auto; }

/* Full-width centered separator treatment for hero and calculator headers */
.page-hero .ornament,
.pricing-hero .ornament,
.calc-header .ornament,
.slider-header .ornament {
  justify-content: center !important;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - (var(--px) * 2)), var(--max-w));
  max-width: none;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.page-hero .ornament::before,
.page-hero .ornament::after,
.pricing-hero .ornament::before,
.pricing-hero .ornament::after,
.calc-header .ornament::before,
.calc-header .ornament::after,
.slider-header .ornament::before,
.slider-header .ornament::after {
  max-width: none;
}

.page-hero .divider,
.pricing-hero .divider {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - (var(--px) * 2)), var(--max-w));
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.calc-header,
.slider-header {
  max-width: 48rem;
}

.calc-header h2,
.slider-header h2,
.page-hero h1,
.pricing-hero h1,
.contact-left h2,
.contact-right h2 {
  text-wrap: balance;
}

.calc-header p,
.slider-header p {
  max-width: 42rem;
  line-height: 1.7;
}

/* ===================== ROUTE CALCULATOR ===================== */
.calc-section { background: var(--bg2); padding: 2.75rem var(--px); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calc-inner   { max-width: var(--max-w); margin: 0 auto; }
.calc-header  { margin-bottom: 1.6rem; }
.calc-header h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); margin-bottom: .2rem; }
.calc-header p  { color: var(--text2); font-size: .85rem; }

.calc-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-bottom: 1.1rem; }

/* Waypoints */
.wp-label { font-size:.7rem; letter-spacing:.11em; text-transform:uppercase; color:var(--text3); font-weight:500; margin-bottom:.55rem; display:block; }
.wp-row { display:flex; gap:.45rem; margin-bottom:.4rem; align-items:center; }
.wp-row .wp-input {
  flex:1; background:var(--input-bg); border:1px solid var(--border-hard);
  border-radius:var(--radius); padding:.62rem .82rem; color:var(--text);
  font-size:.88rem; transition:border-color .18s,box-shadow .18s; min-width:0; width:100%;
  -webkit-appearance:none; touch-action:manipulation;
}
.wp-row .wp-input:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,168,76,.13); }
.wp-row .wp-input::placeholder { color:var(--text3); }
.wp-icon   { font-size:.9rem; width:22px; text-align:center; flex-shrink:0; line-height:1; }
.wp-rm-btn { background:none; border:1px solid var(--border-hard); border-radius:var(--radius); padding:.33rem .52rem; color:var(--text3); cursor:pointer; font-size:.78rem; flex-shrink:0; transition:all .2s; line-height:1; -webkit-tap-highlight-color:transparent; }
.wp-rm-btn:hover { border-color:var(--error); color:var(--error); }
.wp-add-btn { background:none; border:1px dashed var(--border-hard); border-radius:var(--radius); padding:.46rem 1rem; color:var(--text3); cursor:pointer; font-size:.79rem; transition:all .2s; width:100%; text-align:center; -webkit-tap-highlight-color:transparent; }
.wp-add-btn:hover { border-color:var(--gold); color:var(--gold); }

.calc-btn-row { display:flex; gap:.7rem; flex-wrap:wrap; margin-top:1.1rem; margin-bottom:1.35rem; }

/* Geo / Share buttons */
.geo-btn {
  display: flex; align-items: center; gap: .4rem;
  font-size: .73rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text2); background: var(--card-bg);
  border: 1px solid var(--border-hard); border-radius: var(--radius);
  padding: .4rem .85rem; cursor: pointer;
  transition: all .2s; -webkit-tap-highlight-color: transparent;
  font-family: 'DM Sans', sans-serif;
}
.geo-btn:hover { border-color: var(--gold); color: var(--gold); }
.geo-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
  animation: pulseDot 1.8s ease infinite; flex-shrink: 0;
}
.geo-btn.is-loading .geo-dot {
  background: transparent; border: 2px solid var(--gold);
  animation: spin .7s linear infinite; width: 10px; height: 10px;
}

.share-loc-btn {
  display: none; align-items: center; gap: .4rem;
  font-size: .73rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text2); background: var(--card-bg);
  border: 1px solid var(--border-hard); border-radius: var(--radius);
  padding: .4rem .85rem; cursor: pointer;
  transition: all .2s; -webkit-tap-highlight-color: transparent;
  font-family: 'DM Sans', sans-serif;
}
.share-loc-btn:hover { border-color: var(--gold); color: var(--gold); }
.share-loc-btn.visible { display: flex; }

/* Map */
#route-map {
  width: 100%; height: 360px;
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 1.1rem; overflow: hidden; position: relative;
}
[data-theme="dark"] #route-map { filter: brightness(.82) saturate(.72); }
.leaflet-container { font-family: 'DM Sans', sans-serif !important; }

.map-wrap { position: relative; }
.map-locate-btn {
  position: absolute; bottom: 1.35rem; right: .75rem; z-index: 500;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--card-bg); border: 1px solid var(--border-hard);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; box-shadow: var(--shadow-sm);
  transition: all .2s; -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(8px);
}
.map-locate-btn:hover { border-color: var(--gold); }

/* Route info */
.route-info { display:flex; gap:1rem; flex-wrap:wrap; margin-bottom:.9rem; font-size:.85rem; color:var(--text2); align-items:center; }
.route-info span { display:flex; align-items:center; gap:.28rem; }

/* Price result */
.price-result { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius-lg); padding:1.6rem 1.75rem; backdrop-filter:blur(8px); transition:border-color .3s; }
.price-result.show { border-color:var(--gold); }
.price-placeholder { text-align:center; color:var(--text3); padding:.75rem 0; font-size:.87rem; }
.pr-row { display:flex; justify-content:space-between; align-items:flex-start; padding:.42rem 0; gap:1rem; }
.pr-row+.pr-row { border-top:1px solid var(--border); }
.pr-label { color:var(--text2); font-size:.85rem; line-height:1.4; }
.pr-value { font-weight:500; font-size:.9rem; text-align:right; line-height:1.4; }
.pr-total { font-size:1.6rem; font-family:'Cormorant Garamond',serif; color:var(--gold); }
.pr-range { font-size:.76rem; color:var(--text3); margin-top:.2rem; }
.pay-icons-row { display:flex; gap:.45rem; flex-wrap:wrap; margin-top:.4rem; }

/* ===================== CONTACT ===================== */
.contact-layout { max-width:var(--max-w); margin:0 auto; padding:3rem var(--px) 4.5rem; display:grid; grid-template-columns:5fr 7fr; gap:3.5rem; align-items:start; }
.contact-left,
.contact-right { width: 100%; }
.contact-left h2  { font-size: clamp(1.35rem, 3vw, 1.75rem); margin-bottom:.45rem; }
.contact-left > p { color:var(--text2); font-size:.9rem; line-height:1.72; margin-bottom:1.75rem; }
.contact-item     { display:flex; gap:.8rem; align-items:flex-start; margin-bottom:1.2rem; }
.ci-icon          { font-size:1.2rem; margin-top:.05rem; flex-shrink:0; }
.ci-body h4       { font-size:.7rem; letter-spacing:.11em; text-transform:uppercase; color:var(--text3); margin-bottom:.2rem; font-family:'DM Sans',sans-serif; font-weight:500; }
.ci-body p        { color:var(--text2); font-size:.87rem; line-height:1.55; }
.ci-body a        { color:var(--gold); text-decoration:none; }
.ci-body a:hover  { text-decoration:underline; }
.contact-right h2  { font-size: clamp(1.2rem, 2.5vw, 1.55rem); margin-bottom:.3rem; }
.contact-right > p { color:var(--text2); font-size:.88rem; margin-bottom:1.6rem; }
.contact-form { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius-lg); padding:2.25rem; backdrop-filter:blur(8px); }

/* ===================== FOOTER ===================== */
footer { background:var(--bg2); border-top:1px solid var(--border); padding:3.75rem var(--px) 1.6rem; }
.footer-inner { max-width:var(--max-w); margin:0 auto; display:grid; grid-template-columns:2fr 1fr 1fr; gap:2.75rem; padding-bottom:2.75rem; border-bottom:1px solid var(--border); align-items:start; }
.footer-brand p    { color:var(--text2); font-size:.86rem; line-height:1.72; margin-top:.9rem; max-width:290px; }
.footer-brand .co-name { font-size:.72rem; color:var(--text3); margin-top:.5rem; letter-spacing:.04em; }
.footer-col h4 { font-size:.69rem; letter-spacing:.13em; text-transform:uppercase; color:var(--text3); font-weight:500; margin-bottom:.9rem; font-family:'DM Sans',sans-serif; }
.footer-col a  { display:block; color:var(--text2); text-decoration:none; font-size:.86rem; margin-bottom:.45rem; transition:color .2s; }
.footer-col a:hover { color:var(--gold); }
.footer-pay { margin-top:.9rem; display:flex; flex-direction:column; gap:.38rem; align-items:flex-start; }
.footer-bottom { max-width:var(--max-w); margin:0 auto; padding-top:1.3rem; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:.65rem; }
.footer-bottom p { color:var(--text3); font-size:.77rem; }
.footer-gold { color:var(--gold); }
.footer-link { color:var(--gold); text-decoration:none; font-size:.77rem; }
.footer-link:hover { text-decoration:underline; }

/* ===================== COOKIE BANNER ===================== */
#cookie-banner {
  position: fixed; bottom: 1rem; left: 50%;
  transform: translateX(-50%) translateY(160%);
  z-index: 2000; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.1rem 1.6rem;
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  width: min(calc(100% - 2rem), 860px);
  transition: transform .5s cubic-bezier(.22,1,.36,1);
}
#cookie-banner.show { transform: translateX(-50%) translateY(0); }
#cookie-banner p    { flex:1; color:var(--text2); font-size:.83rem; line-height:1.6; min-width:150px; }
#cookie-banner p a  { color:var(--gold); text-decoration:none; }
.cookie-actions     { display:flex; gap:.6rem; flex-shrink:0; }

/* ===================== TARIFF POPUP ===================== */
#tariff-popup {
  position: fixed; inset: 0; z-index: 3000;
  background: var(--modal-bg); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
  opacity: 0; pointer-events: none; transition: opacity .28s;
}
#tariff-popup.show { opacity: 1; pointer-events: auto; }
.popup-card {
  position: relative; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem 1.85rem; max-width: 430px; width: 100%;
  backdrop-filter: blur(16px); text-align: center;
  transform: scale(.93) translateY(16px);
  transition: transform .32s cubic-bezier(.22,1,.36,1);
  max-height: calc(100vh - 2.5rem); overflow-y: auto;
}
#tariff-popup.show .popup-card { transform: scale(1) translateY(0); }
.popup-icon    { font-size: 2.2rem; margin-bottom: .8rem; }
.popup-card h2 { font-size: 1.75rem; margin-bottom: .28rem; }
.popup-badge { display: inline-block; font-size: .67rem; letter-spacing: .15em; text-transform: uppercase; padding: .2rem .8rem; border-radius: 999px; margin-bottom: .9rem; }
.popup-rows { margin: .85rem 0; }
.popup-row  { display: flex; justify-content: space-between; padding: .42rem 0; border-bottom: 1px solid var(--border); font-size: .86rem; }
.popup-row:last-child { border-bottom: none; }
.popup-note { color: var(--text2); font-size: .78rem; margin: .65rem 0 .9rem; line-height: 1.58; }
.popup-close { position: absolute; top: .8rem; right: .8rem; background: none; border: none; font-size: 1.15rem; color: var(--text3); cursor: pointer; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.popup-close:hover { background: var(--bg3); color: var(--text); }

/* Popup mini slider */
.popup-slider-wrap { margin: .75rem 0; }
.popup-km-label { font-size: .7rem; color: var(--text3); margin-bottom: .35rem; letter-spacing: .08em; text-transform: uppercase; }
.popup-km-price { font-family: 'Cormorant Garamond', serif; font-size: 1.55rem; color: var(--gold); margin-top: .3rem; font-weight: 300; }
.popup-km-slider { width: 100%; display: block; }
