/* =========================================================
   PLANSHET VA MOBIL (≤1023px)
   Planshet maketi 768px (1rem = 10px), mobil maketi 390px (1rem ≈ 10px).
   Desktop'dagi absolyut joylashuv bu yerda oddiy oqimga (flex/grid) almashadi.
   ========================================================= */
@media (max-width: 1023px) {
  html { font-size: calc(100vw / 76.8); scroll-padding-top: 9rem; }

  /* ---------- Header ---------- */
  .nav { left: 2.4rem; right: 2.4rem; top: 2rem; width: auto; height: 6.4rem; border-radius: 1.4rem; }
  .nav[data-theme]:not([data-theme="hero"]) { top: 1.2rem; }
  .logo { left: 1.9rem; top: 1.4rem; }
  .nav__btn { left: auto; right: 7.2rem; top: 1rem; height: 4.2rem; padding: 0 1.8rem; font-size: 1.5rem; }
  .nav__burger { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .5rem;
    position: absolute; right: 1rem; top: .9rem; width: 4.4rem; height: 4.4rem; border-radius: 1rem; cursor: pointer; }
  .nav__burger span { width: 2.2rem; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s, opacity .3s; }
  .nav.is-open .nav__burger span:nth-child(1) { transform: translateY(.7rem) rotate(45deg); }
  .nav.is-open .nav__burger span:nth-child(2) { opacity: 0; }
  .nav.is-open .nav__burger span:nth-child(3) { transform: translateY(-.7rem) rotate(-45deg); }
  .nav.is-open[data-theme] { color: #fff; background: rgba(56, 29, 7, .94); border-color: rgba(244, 177, 109, .25); }

  .nav__menu { left: -1px; right: -1px; top: calc(100% + .8rem); transform: translateY(-1rem); flex-direction: column; gap: 0;
    padding: .8rem 1.6rem 1.6rem; border-radius: 1.4rem; background: rgba(56, 29, 7, .96); color: #fff;
    box-shadow: 0 2rem 4rem rgba(0, 0, 0, .25); font-size: 1.8rem; line-height: 2.2rem;
    opacity: 0; visibility: hidden; transition: opacity .3s, transform .3s, visibility .3s; }
  .nav.is-open .nav__menu { opacity: 1; visibility: visible; transform: none; }
  .nav__menu li:not(.nav__cta) a { display: block; padding: 1.5rem .4rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .nav__menu a::after { display: none; }
  .nav[data-theme] .nav__menu a:hover { color: var(--accent); }

  /* ---------- Hero ---------- */
  .hero { height: 100vh; height: 100svh; min-height: 60rem; max-height: 104rem; }
  .hero__bg { width: 100%; height: 100%; object-position: 50% 50%; }
  .hero__shade { height: 65%; }
  /* Tor ekranda sarlavha och rangli to'shak ustiga tushadi — o'qilishi uchun yengil qorong'ilik */
  .hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to bottom, rgba(20, 10, 2, .45) 0%, rgba(20, 10, 2, .18) 50%, rgba(20, 10, 2, .35) 100%); }
  .hero__title, .hero__btn { z-index: 1; }
  .hero__title { left: 50%; top: 30%; width: 62rem; transform: translateX(-50%); }
  .hero__btn { top: auto; bottom: 9%; }

  /* ---------- Biz haqimizda ---------- */
  .about, .production { height: auto; padding: 9rem 4rem; }
  .heading, .production .heading { margin-left: 0; height: auto; letter-spacing: -.08rem; }
  .heading__label { font-size: 1.8rem; }
  .heading h2 { font-size: 3.6rem; }

  .stats { margin: 4.8rem 0 0; height: auto; }
  .stats > .stat { flex: 1; width: auto; padding: 2rem .8rem; }
  .stat b { font-size: 4rem; line-height: 5.2rem; }
  .stat span { font-size: 1.5rem; line-height: 2rem; }

  .about__photo { margin: 4.8rem 0 0; width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: 2.4rem; }
  .about__photo img { left: 0; top: 0; width: 100%; height: 100%; }

  .about__list { margin: 4.8rem 0 0; width: auto; height: auto; font-size: 1.7rem; line-height: 2.6rem; }
  .about__list li { padding-left: 2.4rem; }
  .about__list li + li { margin-top: 1.6rem; }
  .about__list li::before { left: .6rem; top: 1.1rem; }

  .values { margin: 5.6rem 0 0; width: auto; height: auto; padding-top: 4rem;
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 6rem; }
  .values::before { left: 50%; top: 4rem; height: calc(100% - 4rem); }
  .values__col, .values__col:first-child, .values__col:last-child { position: static; width: auto; font-size: 1.7rem; line-height: 2.6rem; }
  .values p { margin-top: 1.6rem; }

  .about__slogan { margin: 6.4rem 0 0; width: auto; transform: none; white-space: normal; font-size: 3rem; line-height: 1.3; }

  /* ---------- Ishlab chiqarish ---------- */
  .production .step { margin: 2.4rem 0 0; width: auto; height: auto; gap: 3.2rem; border-radius: 3rem;
    font-size: 1.7rem; line-height: 2.6rem; }
  .production .step:nth-child(2) { margin-top: 4.8rem; }
  .production .step p { flex: 1; width: auto; margin: 0; }
  .step--dark { padding: 2.4rem 2.4rem 2.4rem 4rem; }
  .step--light { padding: 2.4rem 4rem 2.4rem 2.4rem; }
  .step__img { width: 30rem; height: auto; aspect-ratio: 516 / 232; border-radius: 2rem; }

  /* ---------- Katalog ---------- */
  .catalog { height: auto; padding: 9rem 4rem 0; }
  .catalog__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; }
  .catalog__head h2 { margin: 0; height: auto; font-size: 3.4rem; line-height: 1.2; letter-spacing: -.08rem; }
  .chip { position: static; flex: none; }
  .catalog__grid { margin-top: 4rem; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 4rem 2.4rem; }
  .card__img { height: auto; aspect-ratio: 1; border-radius: 2rem; }
  .card__info { margin-top: 1.6rem; gap: 1.2rem; }
  .card__name { font-size: 2rem; line-height: 2.4rem; }
  .card__price { margin-top: .4rem; font-size: 2rem; line-height: 2.8rem; }
  .card__price s { margin-right: 1.2rem; }
  .card__price s::after { top: 1.3rem; }
  .card__cart { width: 4.4rem; height: 4.4rem; }
  .card__cart img { width: 2.2rem; height: 2.2rem; }

  /* ---------- Kontakt ---------- */
  .contact { padding: 9rem 4rem 8rem; }
  .contact__card { width: auto; height: auto; padding: 4rem; border-radius: 3rem;
    display: grid; grid-template-columns: 1fr 1.3fr; column-gap: 4rem; align-content: start; }
  .contact__card > * { grid-column: 1; }
  .contact__title, .contact__item, .field, .form__btn, .form__status { position: static; }
  .contact__title { white-space: normal; font-size: 2.6rem; line-height: 1.3; }
  .contact__item { height: auto; margin-top: 2rem; white-space: normal; font-size: 1.5rem; line-height: 2rem; }
  .contact__title + .contact__item { margin-top: 3.2rem; }
  .contact__item img { flex: none; }
  .contact__item--3 span { width: auto; text-align: left; }

  .contact__card > .form { grid-column: 2; grid-row: 1 / span 4; display: grid; grid-template-columns: 1fr 1fr; gap: 2.4rem 2rem; align-content: start; }
  .field { width: auto; height: auto; }
  .field input { height: 3.6rem; }
  .field--phone, .field--question, .form__btn, .form__status { grid-column: 1 / -1; }
  .form__btn { justify-self: end; width: 20rem; height: 5.2rem; margin-top: .8rem; font-size: 1.8rem; }
  .form__status:empty { display: none; }

  /* ---------- Footer ---------- */
  .footer { height: auto; padding: 5.6rem 4rem 3.2rem; display: grid; grid-template-columns: 1fr auto; align-items: start;
    grid-template-areas: "text label" "text phone" "social copy"; }
  .footer__text, .footer__label, .footer__phone, .footer__copy, .footer__social a { position: static; }
  .footer__text { grid-area: text; white-space: normal; font-size: 2.6rem; line-height: 1.3; }
  .footer__label { grid-area: label; }
  .footer__phone { grid-area: phone; font-size: 4rem; line-height: 1.2; }
  .footer__social { grid-area: social; display: flex; align-items: center; gap: 1.2rem; margin-top: 4.8rem; }
  .footer__copy { grid-area: copy; align-self: end; }

  /* ---------- Model sahifasi ---------- */
  .pd { height: auto; padding: 3.2rem 4rem 6rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center;
    grid-template-areas: "back back back" "photo photo photo" "info info info" "specs specs specs"
                         "line line line" "price note btn"; }
  .pd__back { grid-area: back; justify-self: start; display: inline-flex; align-items: center; margin-bottom: 2.4rem;
    font-size: 1.6rem; color: var(--brown); }
  .pd__back:hover { color: #9a5a1c; }
  .pd__photo, .pd__info, .pd__specs, .pd__price, .pd__note, .pd__btn { position: relative; left: auto; top: auto; }
  .pd__photo { grid-area: photo; width: 100%; height: auto; aspect-ratio: 818 / 461; border-radius: 2.4rem; }
  .pd__photo img { position: absolute; }
  .pd__info { grid-area: info; width: auto; margin-top: 3.6rem; }
  .pd__label { font-size: 2.4rem; line-height: 1.2; }
  .pd__name { font-size: 4rem; line-height: 1.2; white-space: normal; }
  .pd__desc { margin-top: 1.6rem; font-size: 1.7rem; line-height: 2.5rem; }

  .pd__specs { grid-area: specs; margin-top: 4.8rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3.2rem;
    font-size: 1.6rem; line-height: 2.4rem; }
  .pd__specs::before, .pd__specs::after { display: none; }
  .pd__col, .pd__col:nth-child(n) { position: static; width: auto; }
  .pd__group { padding-left: 2.8rem; }
  .pd__group + .pd__group { margin-top: 3.2rem; }
  .pd__group h3::before { left: -2.8rem; width: 2rem; height: 2rem; top: .2rem; }
  .pd__group p { margin-top: .8rem; }

  .pd::after { grid-area: line; position: static; width: auto; margin: 4.8rem 0 3.2rem; }
  .pd__price { grid-area: price; width: 15rem; height: 6.4rem; font-size: 3rem; }
  .pd__note { grid-area: note; width: auto; padding: 0 2.4rem; font-size: 1.6rem; line-height: 2.2rem; letter-spacing: 0; }
  .pd__btn { grid-area: btn; width: 22rem; height: 6.4rem; font-size: 2rem; }
}

/* ---------- MOBIL (≤767px) ---------- */
@media (max-width: 767px) {
  html { font-size: min(calc(100vw / 39), 12px); scroll-padding-top: 8rem; }

  .nav { left: 1.6rem; right: 1.6rem; top: 1.6rem; height: 6rem; }
  .nav[data-theme]:not([data-theme="hero"]) { top: 1rem; }
  .logo { left: 1.5rem; top: 1.2rem; }
  .nav__btn { display: none; }
  .nav__burger { right: .7rem; top: .7rem; }
  .nav__cta { display: block; padding-top: 1.6rem; }
  .nav__cta .btn { width: 100%; height: 4.8rem; font: 400 1.6rem/1 var(--f-neue); }

  .hero { min-height: 56rem; }
  .hero__title { top: 29%; width: 35rem; }
  .hero__btn { bottom: 8%; width: 16rem; height: 4.6rem; font-size: 2rem; }

  .about, .production { padding: 6.4rem 2rem; }
  .heading__label { font-size: 1.6rem; }
  .heading h2 { font-size: 2.8rem; }

  .stats { display: grid; grid-template-columns: 1fr 1fr; margin-top: 3.2rem; }
  .stats > .stat { padding: 2rem .8rem; border-right: 1px solid rgba(255, 234, 216, .5); }
  .stats > .stat:nth-child(even) { border-right: 0; }
  .stats > .stat:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 234, 216, .5); }
  .stat b { font-size: 3.4rem; line-height: 4.4rem; }
  .stat span { font-size: 1.4rem; }

  .about__photo { margin-top: 3.2rem; aspect-ratio: 4 / 3; border-radius: 2rem; }
  .about__list { margin-top: 3.2rem; font-size: 1.6rem; line-height: 2.4rem; }
  .about__list li { padding-left: 2rem; }
  .about__list li::before { left: .4rem; top: 1rem; }

  .values { margin-top: 4rem; padding-top: 3.2rem; grid-template-columns: 1fr; }
  .values::before { display: none; }
  .values__col, .values__col:first-child, .values__col:last-child { font-size: 1.6rem; line-height: 2.4rem; }
  .values__col + .values__col { margin-top: 3.2rem; padding-top: 3.2rem; border-top: 1px solid rgba(244, 177, 109, .35); }
  .values p { margin-top: 1.2rem; }
  .about__slogan { margin-top: 4.8rem; font-size: 2.4rem; }

  .production .step { flex-direction: column; align-items: stretch; gap: 2rem; padding: 1.2rem 1.2rem 2.8rem;
    border-radius: 2.4rem; font-size: 1.6rem; line-height: 2.4rem; }
  .production .step:nth-child(2) { margin-top: 3.2rem; }
  .production .step--dark { flex-direction: column-reverse; }
  .production .step p { padding: 0 1.2rem; }
  .step__img { width: 100%; border-radius: 1.6rem; }

  .catalog { padding: 6.4rem 2rem 0; }
  .catalog__head { flex-direction: column; align-items: flex-start; gap: 1.6rem; }
  .catalog__head h2 { font-size: 2.6rem; line-height: 1.25; }
  .chip { height: 3.4rem; font-size: 1.3rem; }
  .catalog__grid { margin-top: 3.2rem; gap: 3.2rem 1.2rem; }
  .card__img { border-radius: 1.6rem; }
  .card__info { margin-top: 1.2rem; gap: .6rem; }
  .card__name { font-size: 1.35rem; line-height: 1.7rem; white-space: normal; letter-spacing: -.02rem; }
  .card__price { margin-top: .4rem; font-size: 1.5rem; line-height: 2.2rem; }
  .card__price s { margin-right: .6rem; }
  .card__price s::after { top: 1rem; height: .15rem; }
  .card__cart { width: 3.6rem; height: 3.6rem; border-radius: .8rem; }
  .card__cart img { width: 1.8rem; height: 1.8rem; }

  .contact { padding: 6.4rem 2rem; }
  .contact__card { display: flex; flex-direction: column; padding: 2.8rem 2rem; border-radius: 2.4rem; }
  .contact__title { font-size: 2.2rem; }
  .contact__item { font-size: 1.5rem; }
  .contact__card > .form { margin-top: 3.2rem; gap: 2.4rem 1.6rem; }
  .form__btn { justify-self: stretch; width: 100%; height: 5rem; }

  .footer { padding: 4.8rem 2rem 2.8rem; grid-template-areas: "text text" "label label" "phone phone" "social copy"; }
  .footer__text { font-size: 2.1rem; }
  .footer__label { margin-top: 3.2rem; text-align: left; }
  .footer__phone { text-align: left; font-size: 3.6rem; }
  .footer__social { margin-top: 3.2rem; }
  .footer__copy { font-size: 1.3rem; }

  .pd { padding: 2.4rem 2rem 4.8rem; grid-template-columns: auto 1fr;
    grid-template-areas: "back back" "photo photo" "info info" "specs specs" "line line" "price note" "btn btn"; }
  .pd__back { margin-bottom: 1.6rem; font-size: 1.5rem; }
  .pd__photo { border-radius: 2rem; }
  .pd__info { margin-top: 2.8rem; }
  .pd__label { font-size: 2rem; }
  .pd__name { font-size: 3.2rem; }
  .pd__desc { font-size: 1.6rem; line-height: 2.4rem; }
  .pd__specs { margin-top: 3.6rem; grid-template-columns: 1fr 1fr; gap: 2.8rem 1.6rem; font-size: 1.5rem; line-height: 2.2rem; }
  .pd__col { display: contents; }
  .pd__group + .pd__group { margin-top: 0; }
  .pd__group { padding-left: 2.6rem; }
  .pd__group h3::before { left: -2.6rem; width: 1.8rem; height: 1.8rem; }
  .pd::after { margin: 3.6rem 0 2.4rem; }
  .pd__price { width: 12rem; height: 5.6rem; font-size: 2.6rem; }
  .pd__note { padding: 0 0 0 1.6rem; font-size: 1.4rem; line-height: 2rem; }
  .pd__btn { width: 100%; height: 5.6rem; margin-top: 2rem; font-size: 1.9rem; }
}

/* ---------- Buyurtma modali — mobil ---------- */
@media (max-width: 767px) {
  .modal__box { padding: 4rem 2rem 2.4rem; border-radius: 2.4rem; }
  .modal__close { right: 1.4rem; top: 1.4rem; }
  .modal__title { font-size: 2.6rem; }
  .modal__field { margin-top: 2.4rem; }
  .modal__btn { margin-top: 2.8rem; }
  .modal__text { font-size: 2.1rem; }
}
