/* =========================================================
   BURGER BUTTON
   ========================================================= */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
  background: none;
  border: none;
  flex-shrink: 0;
}

.burger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #202020;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   MOBILE MENU OVERLAY
   ========================================================= */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  animation: fadeIn 0.25s ease;
}

.mobile-menu__panel {
  position: relative;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 1;
  animation: slideIn 0.25s ease;
}

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.mobile-menu__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #202020;
  background: none;
  border: none;
  padding: 0;
}

.mobile-menu__close svg { display: block; }

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  padding-top: 56px;
  border-bottom: 1px solid #e0e0e0;
}

.mobile-menu__nav a {
  display: flex;
  align-items: center;
  padding: 15px 24px;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #202020;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s, color 0.2s;
  text-decoration: none;
}

.mobile-menu__nav a:last-child { border-bottom: none; }

.mobile-menu__nav a:hover {
  background-color: #fb8004;
  color: #fff;
}

.mobile-menu__phones {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
}

.mobile-menu__phones a {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #3b4e61;
  text-decoration: none;
}

.mobile-menu__phones a:hover { color: #fb8004; }

/* =========================================================
   TABLET LANDSCAPE — ≤1024px
   ========================================================= */
@media (max-width: 1024px) {
  .header__preheader-address { width: 55%; }
  .header__preheader-address-social { width: 40%; }

  .header__navbar-search form { min-width: 220px; }
  .header__navbar-tel-wrapper a { font-size: 15px; }

  .catalog__row--1 .catalog__card:nth-child(1) { flex: 0 0 55%; }
  .catalog__row--2 .catalog__card:nth-child(1) { flex: 0 0 45%; }

  .services__grid { grid-template-columns: repeat(2, 1fr); }

  .cp-sidebar { flex: 0 0 240px; min-width: 240px; }

  .footer__grid { gap: 20px; }
}

/* =========================================================
   TABLET PORTRAIT — ≤768px
   ========================================================= */
@media (max-width: 768px) {

  /* --- HEADER --- */
  .header__preheader { display: none; }
  .burger { display: flex; }
  .header__menu { display: none; }

  .header__navbar { padding: 12px 0; }
  .header__navbar-content { flex-wrap: wrap; gap: 12px; }
  .header__navbar-brand h3 { font-size: 22px; }
  .header__navbar-brand p { font-size: 12px; }

  .header__navbar-search { order: 3; width: 100%; }
  .header__navbar-search form { min-width: unset; width: 100%; }

  .header__navbar-tel { order: 2; gap: 12px; }
  .header__navbar-tel-wrapper { display: none; }

  .header__menu ul {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 4px;
    padding-bottom: 4px;
  }
  .header__menu ul li { white-space: nowrap; }
  .header__menu ul li img { display: none; }

  /* --- HERO --- */
  .hero { min-height: 340px; padding-bottom: 44px; }
  .hero__content { padding: 40px 0 28px; }
  .hero__text h2 { font-size: 32px; }
  .hero__text .main__btn { padding: 12px 28px; }
  .hero__dot { width: 11px; height: 11px; }

  /* --- CATALOG --- */
  .catalog__row { flex-direction: column; }
  .catalog__row--1 .catalog__card:nth-child(1),
  .catalog__row--1 .catalog__card:nth-child(2),
  .catalog__row--2 .catalog__card:nth-child(1),
  .catalog__row--2 .catalog__card:nth-child(2) { flex: 1 1 100%; }
  .catalog__card-img { height: 220px; }
  .catalog__title { font-size: 26px; }

  /* --- SERVICES --- */
  .services__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .services__title { font-size: 26px; }

  /* --- INFO --- */
  .info__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .info__title { font-size: 26px; }

  /* --- REVIEWS (главная) --- */
  .reviews__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .reviews__title { font-size: 26px; }

  /* --- ABOUT --- */
  .about__inner { flex-direction: column; }
  .about__img { flex: none; width: 100%; min-height: 260px; }
  .about__content { padding: 32px 28px; }
  .about__title { font-size: 24px; }

  /* --- FOOTER --- */
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__title { font-size: 22px; }

  /* --- SIDEBAR PAGES (catalog, reviews, product, articles) --- */
  .cp-layout,
  .rp-layout { flex-direction: column; }

  .cp-sidebar,
  .rp-sidebar { flex: none; width: 100%; min-width: unset; }

  .cp-title,
  .rp-title { font-size: 28px; }

  /* --- TABLE --- */
  .cp-table__col--unit { width: 64px; }
  .cp-table__col--price { width: 120px; }
  .cp-table__img { width: 64px; height: 52px; }

  /* --- FORM --- */
  .cp-form__row { grid-template-columns: 1fr; }

  /* --- RECOMMENDED --- */
  .cp-recommended__grid { grid-template-columns: repeat(2, 1fr); }

  /* --- PRODUCT HERO --- */
  .pp-hero { flex-direction: column; }
  .pp-hero__img { flex: none; width: 100%; min-height: 240px; }
  .pp-hero__btn { padding: 14px 32px; }

  /* --- ARTICLE HERO --- */
  .ap-hero { flex-direction: column; }
  .ap-hero__img { flex: none; width: 100%; min-height: 240px; }

  /* --- ARTICLE POKRYTIYA / PLOSHCHADKI --- */
  .ap-full-img { height: 260px; }
  .ap-types-box { grid-template-columns: 1fr; }
  .ap-types-box__col { border-right: none; border-bottom: 1px solid #e0e0e0; }
  .ap-types-box__col:last-child { border-bottom: none; }
  .ap-gallery { grid-template-columns: repeat(2, 1fr); }
  .ap-calc-banner { flex-direction: column; }
  .ap-calc-banner__img { flex: none; width: 100%; min-height: 220px; }
  .ap-calc-banner__info { padding: 24px 28px; }

  /* --- REVIEWS PAGE --- */
  .rp-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .rp-card__img { height: 220px; }

  /* --- CALCULATOR --- */
  .kp-calc__options { flex-wrap: wrap; gap: 16px; }
  .kp-calc__result { flex-wrap: wrap; gap: 12px; }
}

/* =========================================================
   MOBILE — ≤480px
   ========================================================= */
@media (max-width: 480px) {

  /* --- HEADER --- */
  .header__navbar-brand h3 { font-size: 18px; }
  .header__navbar-tel { display: none; }

  /* --- HERO --- */
  .hero { min-height: 280px; }
  .hero__text h2 { font-size: 24px; margin-bottom: 24px; }
  .hero__text .main__btn { padding: 12px 24px; font-size: 14px; }
  .hero__dots { gap: 7px; bottom: 14px; }
  .hero__dot { width: 10px; height: 10px; }

  /* --- CATALOG --- */
  .catalog__card-img { height: 180px; }
  .catalog__title,
  .services__title,
  .info__title,
  .reviews__title { font-size: 22px; }

  /* --- SERVICES / INFO --- */
  .services__grid,
  .info__grid { grid-template-columns: 1fr; }
  .services__card-img,
  .info__card-img { height: 200px; }

  /* --- REVIEWS (главная) --- */
  .reviews__grid { grid-template-columns: 1fr; }
  .reviews__card-doc { min-height: 240px; }

  /* --- ABOUT --- */
  .about__img { min-height: 200px; }
  .about__content { padding: 24px 20px; }
  .about__title { font-size: 20px; }
  .about p { font-size: 14px; }

  /* --- FOOTER --- */
  .footer__grid { grid-template-columns: 1fr; }
  .footer__title { font-size: 20px; }
  .footer__phones a { font-size: 14px; }

  /* --- SIDEBAR --- */
  .cp-sidebar__item,
  .rp-sidebar__item { padding: 14px 16px; font-size: 14px; }

  .cp-title,
  .rp-title { font-size: 22px; }

  .cp-breadcrumb a,
  .cp-breadcrumb span,
  .rp-breadcrumb a,
  .rp-breadcrumb span { font-size: 12px; }

  /* --- TABLE --- */
  .cp-table__head { padding: 10px 12px; }
  .cp-table__row { padding: 10px 12px; }
  .cp-table__col--name { gap: 10px; font-size: 13px; }
  .cp-table__col--unit { width: 48px; font-size: 13px; }
  .cp-table__col--price { width: 100px; }
  .cp-table__price-val { font-size: 13px; }
  .cp-table__img { width: 56px; height: 46px; }

  /* --- FORM --- */
  .cp-form-block { padding: 20px 16px; }
  .cp-form-block__title { font-size: 20px; }
  .cp-form__submit { padding: 14px 28px; font-size: 14px; }
  .cp-form__footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cp-form__policy { font-size: 12px; }

  /* --- RECOMMENDED --- */
  .cp-recommended__grid { grid-template-columns: 1fr; }
  .cp-recommended__title { font-size: 20px; }

  /* --- PRODUCT HERO --- */
  .pp-hero__info { padding: 24px 20px; gap: 14px; }
  .pp-hero__price { font-size: 17px; }
  .pp-section-title { font-size: 20px; }

  /* --- ARTICLE HERO --- */
  .ap-hero__info { padding: 24px 20px; }

  /* --- ARTICLE POKRYTIYA --- */
  .ap-full-img { height: 200px; }
  .ap-gallery { grid-template-columns: 1fr; }
  .ap-gallery__img { height: 200px; }
  .ap-section__title { font-size: 22px; }
  .ap-section__title { font-size: 20px; }

  /* --- REVIEWS PAGE --- */
  .rp-grid { grid-template-columns: 1fr; }
  .rp-card__img { height: 200px; }
  .rp-more__link { font-size: 14px; padding: 14px; }

  /* --- CALCULATOR --- */
  .kp-field-img { height: 180px; }
  .kp-calc { padding: 20px 16px; }
  .kp-calc__title { font-size: 16px; }
  .kp-calc__label { flex-direction: column; align-items: flex-start; gap: 6px; }
  .kp-calc__markers { width: 100%; }
  .kp-calc__price { font-size: 18px; }
  .kp-calc__btn { padding: 12px 32px; font-size: 14px; }
  .kp-calc__options { flex-direction: column; gap: 12px; }
}
