/* ==========================================================================
   ASL STIRKA — Layout: container, sections, header, navigation, footer,
   mobile tab bar
   ========================================================================== */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Sections ---------- */
.section { position: relative; padding-block: var(--section-y); }
/* Bir xil fondagi ketma-ket bo'limlar: chegarada bo'shliq ikki baravar bo'lmasin —
   kontentlar orasida doim aynan bitta --section-y qoladi */
.section--flow + .section--flow { padding-top: 0; }

.section--dark {
  background: var(--c-navy-900);
  color: #fff;
  isolation: isolate;
}

/* Gilam popugi (logotipdagi "tishlar") — qorong'i bo'limlarning yuqori/pastki cheti */
.section--dark::before,
.section--dark::after,
.marquee::before,
.marquee::after,
.footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: var(--fringe-h);
  background: linear-gradient(90deg, var(--c-navy-900) 0 50%, transparent 50% 100%) 0 0 / var(--fringe-size) 100% repeat-x;
  pointer-events: none;
}
.section--dark::before,
.marquee::before,
.footer::before { top: calc(var(--fringe-h) * -1 + 1px); }
.section--dark::after,
.marquee::after { bottom: calc(var(--fringe-h) * -1 + 1px); }

.section-head { margin-bottom: clamp(32px, 4vw, 56px); }

.section-head--split {
  display: grid;
  gap: 16px;
  align-items: end;
}
.section-head__aside { display: grid; gap: 20px; justify-items: start; }

@media (min-width: 900px) {
  .section-head--split { grid-template-columns: 1fr minmax(280px, 420px); gap: 48px; }
}

.section-title {
  font-size: var(--fs-h2);
  margin-top: 14px;
  max-width: 18ch;
}

.section-lead {
  font-size: var(--fs-md);
  color: var(--c-muted);
  line-height: 1.5;
  max-width: 44ch;
}
.section--dark .section-lead { color: rgba(255, 255, 255, .7); }

.section-cta { display: flex; justify-content: center; margin-top: clamp(32px, 4vw, 56px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-green-700);
}
.eyebrow svg { width: 10px; height: 10px; color: var(--c-green-500); flex: none; }
.eyebrow .eyebrow__icon { width: 20px; height: 20px; color: var(--c-green-600); }
.eyebrow--light,
.section--dark .eyebrow { color: var(--c-green-400); }

@media (max-width: 767px) {
  .section-head { margin-bottom: 20px; }
  .section-head--split { gap: 8px; }
  .section-head__aside .carousel-nav { display: none; }
  .section-title { margin-top: 8px; }
  .section-lead { font-size: var(--fs-sm); }
  .section-cta { margin-top: 24px; }
  .section-cta .btn { width: 100%; }
  .eyebrow { gap: 8px; font-size: 11px; letter-spacing: .12em; }
  .eyebrow .eyebrow__icon { width: 18px; height: 18px; }
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
}
/* Fon pseudo-elementda: backdrop-filter headerning o'zida bo'lsa, ichidagi
   position:fixed menyu headerga "qamalib" qoladi. */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(246, 248, 243, .82);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.header.is-scrolled::before,
.header.is-menu-open::before {
  background: rgba(255, 255, 255, .94);
  border-color: var(--c-line);
  box-shadow: 0 6px 24px -14px rgba(0, 21, 40, .25);
}

.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header__contact {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header__phone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
}
.header__phone-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--c-navy-900);
  color: var(--c-green-400);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.header__phone-icon svg { width: 18px; height: 18px; }
.header__phone-text { display: none; }
.header__phone-text strong { display: block; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.header__phone-text small { display: block; font-size: 12px; color: var(--c-muted); }

.header .header__cta { display: none; }

@media (hover: hover) {
  .header__phone:hover .header__phone-icon { transform: rotate(-12deg) scale(1.05); background: var(--c-navy-700); }
}
@media (min-width: 640px) {
  .header .header__cta { display: inline-flex; }
}
@media (min-width: 768px) {
  .header__phone-text { display: block; }
}
@media (max-width: 767px) {
  .header__inner { gap: 10px; }
  .header__contact { gap: 8px; }
  .header__phone-icon { width: 38px; height: 38px; }
  .header__phone-icon svg { width: 17px; height: 17px; }
  .header__phone:active .header__phone-icon { transform: scale(.92); }
}

/* ---------- Navigation ----------
   Telefon: tab bar ustida suzuvchi panel · Planshet: to'liq ekran panel · Desktop: qatorda */
.nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: -1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  background: var(--c-surface);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.nav__list { display: grid; }
.nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 1.25rem;
  font-weight: 600;
  border-bottom: 1px solid var(--c-line);
}
.nav__link::after {
  content: "";
  width: 8px; height: 8px;
  background: var(--c-green-500);
  transform: rotate(45deg) scale(0);
  transition: transform var(--dur) var(--ease);
}
.nav__link.is-active::after { transform: rotate(45deg) scale(1); }

.nav__mobile-extra { display: grid; gap: 8px; margin-top: auto; }
.nav__phone { font-size: 1.375rem; font-weight: 600; }
.nav__hours { color: var(--c-muted); margin-bottom: 12px; }

@media (hover: hover) {
  .nav__link:hover::after { transform: rotate(45deg) scale(1); }
}

@media (max-width: 767px) {
  .nav {
    inset: auto 10px calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)) 10px;
    z-index: 1;
    max-height: calc(100dvh - var(--header-h) - var(--tabbar-h) - 44px - env(safe-area-inset-bottom));
    gap: 0;
    padding: 6px 6px 14px;
    border-radius: 26px;
    box-shadow: 0 0 0 100vmax rgba(0, 12, 23, .42), var(--shadow-lg);
    transform: translateY(18px) scale(.96);
    transform-origin: 50% 100%;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out), visibility 0s linear var(--dur);
  }
  .nav__link {
    margin-inline: 12px;
    padding: 13px 0;
    font-size: var(--fs-base);
  }
  .nav__list li:last-child .nav__link { border-bottom: 0; }
  .nav__link::after { width: 7px; height: 7px; }
  .nav__mobile-extra {
    gap: 2px;
    margin: 6px 0 0;
    padding: 14px 12px 0;
    border-top: 1px solid var(--c-line);
  }
  .nav__phone { font-size: 1.125rem; }
  .nav__hours { margin-bottom: 10px; font-size: var(--fs-sm); }
}

@media (min-width: 1200px) {
  .nav {
    position: static;
    z-index: auto;
    flex-direction: row;
    padding: 0;
    margin-left: 12px;
    background: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .nav__list { display: flex; gap: 4px; }
  .nav__link {
    position: relative;
    padding: 8px 10px;
    font-size: var(--fs-sm);
    font-weight: 500;
    border: 0;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    color: var(--c-slate-600);
    transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  }
  .nav__link::after {
    position: absolute;
    left: 50%; bottom: -2px;
    width: 6px; height: 6px;
    margin-left: -3px;
  }
  .nav__link:hover { color: var(--c-navy-900); background: rgba(0, 21, 40, .04); }
  .nav__link.is-active { color: var(--c-navy-900); }
  .nav__mobile-extra { display: none; }
  .burger { display: none !important; }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .header__phone-text small { display: none; }
  .header .header__cta { display: none; }
}

/* ---------- Burger (planshet) ---------- */
.burger {
  display: inline-grid;
  place-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--c-surface);
  box-shadow: inset 0 0 0 1px var(--c-line);
}
.burger span {
  display: block;
  width: 20px; height: 2px;
  border-radius: 2px;
  background: var(--c-navy-900);
  transition: transform var(--dur) var(--ease), opacity var(--dur-fast) var(--ease);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 767px) {
  .burger { display: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  position: relative;
  margin-top: var(--fringe-h);
  padding: var(--section-y) 0 calc(24px + env(safe-area-inset-bottom));
  background: var(--c-navy-900);
  color: rgba(255, 255, 255, .78);
}

.footer__top {
  display: grid;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--c-line-dark);
}
@media (min-width: 768px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .footer__top { grid-template-columns: 1.3fr 1fr 1fr; gap: 64px; }
}

.footer__slogan {
  margin: 24px 0 12px;
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}
.footer__slogan img { display: inline-block; width: 30px; height: 30px; margin-left: 6px; vertical-align: -6px; }
.footer__about { max-width: 42ch; }

.footer__heading {
  margin-bottom: 18px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-green-400);
}

.footer__links { display: grid; gap: 10px; }
.footer__links button {
  text-align: left;
  color: rgba(255, 255, 255, .78);
  transition: color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.footer__contacts { display: grid; gap: 14px; }
.footer__contacts li { display: flex; align-items: center; gap: 12px; }
.footer__contacts svg { width: 18px; height: 18px; flex: none; color: var(--c-green-400); }
.footer__contacts a { color: #fff; font-weight: 600; }

.footer__actions { display: grid; gap: 10px; margin-top: 28px; max-width: 320px; }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 24px;
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, .55);
}
.footer__dev { color: rgba(255, 255, 255, .55); transition: color var(--dur-fast) var(--ease); }
.footer__dev strong { color: var(--c-green-400); font-weight: 600; }
.footer__up { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .78); }
.footer__up svg { width: 16px; height: 16px; transform: rotate(-90deg); }

@media (hover: hover) {
  .footer__links button:hover { color: #fff; transform: translateX(4px); }
  .footer__contacts a:hover { color: var(--c-green-300); }
  .footer__dev:hover { color: #fff; }
  .footer__up:hover { color: #fff; }
}

/* Telefon: iOS "inset grouped" ro'yxatlar */
@media (max-width: 767px) {
  .footer { padding-bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
  .footer__top { gap: 30px; padding-bottom: 28px; }
  .footer__slogan { margin: 18px 0 8px; font-size: 1.125rem; }
  .footer__about { font-size: var(--fs-sm); }
  .footer__heading { margin-bottom: 10px; padding-left: 4px; }
  .footer__links,
  .footer__contacts {
    gap: 0;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
    overflow: hidden;
  }
  .footer__links li + li,
  .footer__contacts li + li { background: linear-gradient(var(--c-line-dark), var(--c-line-dark)) 16px 0 / calc(100% - 16px) 1px no-repeat; }
  .footer__links button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    font-size: var(--fs-sm);
  }
  .footer__links button::after {
    content: "";
    flex: none;
    width: 7px; height: 7px;
    border: solid rgba(255, 255, 255, .4);
    border-width: 2px 2px 0 0;
    transform: rotate(45deg);
  }
  .footer__links button:active { background: rgba(255, 255, 255, .06); }
  .footer__contacts li { min-height: 48px; padding: 12px 16px; font-size: var(--fs-sm); }
  .footer__actions { max-width: none; margin-top: 16px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 20px; font-size: var(--fs-xs); }
}

/* ==========================================================================
   Mobile tab bar (faqat telefon)
   ========================================================================== */
.tabbar { display: none; }

@media (max-width: 767px) {
  .tabbar {
    position: fixed;
    left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: var(--z-bar);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: var(--tabbar-h);
    padding: 0 4px 7px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .8);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 14px 34px -14px rgba(0, 21, 40, .4), 0 0 0 1px rgba(0, 21, 40, .06), inset 0 1px 0 rgba(255, 255, 255, .8);
    transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease);
  }
  .is-typing .tabbar {
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
  }

  .tabbar__item {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-width: 0;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--c-slate-500);
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease);
  }
  .tabbar__item > svg {
    width: 48px; height: 30px;
    padding: 4px 13px;
    border-radius: 15px;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
  }
  .tabbar__item.is-active,
  .tabbar__item[aria-expanded="true"] { color: var(--c-navy-900); }
  .tabbar__item.is-active > svg,
  .tabbar__item[aria-expanded="true"] > svg { background: rgba(118, 184, 42, .18); color: var(--c-green-700); }
  .tabbar__item:active > svg { transform: scale(.88); }

  .tabbar__item--cta { color: var(--c-green-700); }
  .tabbar__fab {
    display: grid;
    place-items: center;
    width: 52px; height: 52px;
    margin-top: -24px;
    border-radius: 50%;
    background: var(--c-green-500);
    color: #fff;
    box-shadow: 0 10px 20px -8px rgba(63, 111, 16, .9), 0 0 0 4px rgba(255, 255, 255, .92);
    transition: transform var(--dur-fast) var(--ease);
  }
  .tabbar__fab svg { width: 24px; height: 24px; }
  .tabbar__item--cta:active .tabbar__fab { transform: scale(.9); }
}
