/* ============================================================
   responsive.css — Адаптивная вёрстка ДСК Магистраль
   Breakpoints: 1200 / 960 / 768 / 480
   ============================================================ */

/* ─────────── Утилиты ─────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
img {
  max-width: 100%;
  height: auto;
}

/* ─────────── ≤ 1200px ─────────── */
@media screen and (max-width: 1200px) {
  body {
    font-size: 15px;
  }
  #wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
  }

  /* Header */
  #header {
    height: auto;
    padding: 10px 0;
  }
  .header_logo {
    width: 140px;
  }
  .header_contacts {
    flex-wrap: wrap;
    gap: 6px;
  }
  .header_phone {
    font-size: 20px;
  }

  /* Main slider */
  #main_slider_contaner {
    height: 420px;
  }
  #main_header {
    font-size: 28px;
    padding: 0 16px;
  }

  /* Product groups */
  .product_group_list {
    grid-template-columns: repeat(2, 1fr);
  }
  .product_group_item {
    font-size: 14px;
  }

  /* Catalog grid */
  .catalog_list {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  /* Content column */
  .content {
    padding: 0 12px;
  }
  h1 {
    font-size: 26px;
  }

  /* About advantages */
  .advantages_list {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Services */
  .services_list {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Calculator */
  .calculator_wrap {
    max-width: 100%;
    padding: 24px 20px;
  }
  .calc_body {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer_cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  /* Contacts map */
  .contacts_map iframe {
    height: 320px;
  }
}

/* ─────────── ≤ 1180px ─────────── */
@media screen and (max-width: 1180px) {
  /* Navigation */
  #nav {
    display: none;
  }
  #burger_btn {
    display: flex;
  }
  #mobile_menu {
    display: block;
  }

  /* Header simplified */
  #header {
    position: relative;
  }
  .header_logo {
    width: 120px;
  }
  .header_info {
    display: none;
  }
  .header_phone_block {
    margin-left: auto;
  }

  /* Slider shorter */
  #main_slider_contaner {
    height: 340px;
  }
  .swiper-slide .slide_caption {
    font-size: 18px;
    padding: 12px 16px;
  }

  /* Product groups 2 cols */
  .product_group_list {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Catalog 2 cols */
  .catalog_list {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* About */
  .about_main {
    flex-direction: column;
    gap: 24px;
  }
  .about_photo {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
  }
  .advantages_list {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Services */
  .services_list {
    grid-template-columns: 1fr;
  }

  /* Contacts */
  .contacts_list {
    flex-direction: column;
  }
  .contacts_map {
    margin-top: 20px;
  }

  /* Footer */
  .footer_cols {
    grid-template-columns: 1fr 1fr;
  }
  .footer_logo {
    display: none;
  }

  /* Product card */
  .product {
    flex-direction: column;
  }
  .product .thumb {
    width: 100%;
    height: 220px;
    margin-bottom: 16px;
  }

  /* Feedback */
  .feedback_list {
    grid-template-columns: 1fr;
  }

  /* Blog */
  .blog_list {
    gap: 16px;
  }
}

/* ─────────── ≤ 768px ─────────── */
@media screen and (max-width: 768px) {
  /* Typography */
  h1 {
    font-size: 22px;
  }
  h2 {
    font-size: 19px;
  }

  /* Breadcrumbs */
  .navstr {
    font-size: 12px;
    flex-wrap: wrap;
    gap: 2px;
  }

  /* Main slider */
  #main_slider_contaner {
    height: 260px;
  }
  #main_header {
    font-size: 20px;
    padding: 0 12px;
  }
  .sly_item_text {
    font-size: 13px;
  }

  /* Product groups: single column */
  .product_group_list {
    grid-template-columns: 1fr;
  }
  .catalog_list {
    grid-template-columns: 1fr;
  }

  /* Calculator */
  .calc_row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .calc_label {
    min-width: auto;
  }
  .calc_input,
  .calc_select {
    width: 100%;
  }
  .calc_fields {
    grid-template-columns: 1fr;
  }
  .calc_result_grid {
    grid-template-columns: 1fr;
  }
  .calc_submit {
    width: 100%;
  }

  /* Sections padding */
  section,
  .section {
    padding: 32px 0;
  }
  .content {
    padding: 0 8px;
  }

  /* Forms */
  form .input_wrap {
    width: 100%;
  }
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  textarea {
    width: 100%;
  }

  /* Footer */
  .footer_cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer_bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  /* About advantages: 1 col */
  .advantages_list {
    grid-template-columns: 1fr;
  }

  /* Staff / Cards */
  .staff_list {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Video fill */
  video {
    width: 100%;
  }

  /* Index stats */
  .main_stats {
    flex-direction: column;
    gap: 16px;
    align-items: center;
  }
  .main_stat {
    text-align: center;
  }

  /* Scroll to top */
  #scroll_top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  /* Portfolio */
  .portfolio_coming {
    padding: 40px 12px;
  }
}

/* ─────────── ≤ 480px ─────────── */
@media screen and (max-width: 480px) {
  body {
    font-size: 14px;
  }

  /* Header */
  #header {
    padding: 8px 12px;
  }
  .header_logo {
    width: 100px;
  }
  .header_phone {
    font-size: 17px;
  }
  .header_btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* Slider */
  #main_slider_contaner {
    height: 200px;
  }
  .swiper-slide img {
    object-fit: cover;
  }

  /* Headings */
  h1 {
    font-size: 19px;
  }
  h2 {
    font-size: 17px;
  }

  /* Buttons */
  .button,
  a.button {
    padding: 10px 18px;
    font-size: 14px;
    width: 100%;
    text-align: center;
  }

  /* Nav items full width */
  #mobile_menu a {
    padding: 14px 16px;
    font-size: 15px;
  }

  /* Product price */
  .price {
    font-size: 20px;
  }

  /* Table overflow */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Staff list */
  .staff_list {
    grid-template-columns: 1fr;
  }

  /* Feedback card */
  .feedback_card {
    padding: 16px;
  }
  .feedback_card .fio {
    font-size: 14px;
  }

  /* Calculator */
  .calc_subtitle {
    font-size: 13px;
  }
  .calculator_section {
    padding: 24px 0;
  }
  .calc_type_grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────── Mobile navigation ─────────── */
#burger_btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 1001;
}
#burger_btn span {
  display: block;
  width: 26px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition:
    transform 0.25s,
    opacity 0.25s;
}
#burger_btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#burger_btn.open span:nth-child(2) {
  opacity: 0;
}
#burger_btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

#mobile_menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at top right,
      rgba(232, 121, 42, 0.18),
      transparent 26%
    ),
    linear-gradient(180deg, rgba(17, 22, 29, 0.98), rgba(10, 13, 17, 0.98));
  z-index: 1000;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0;
  padding: 88px 16px 32px;
  overflow-y: auto;
}

/* ─────────── ≤ 960px ─────────── */
@media screen and (max-width: 960px) {
  /* Slider shorter */
  #main_slider_contaner {
    height: 340px;
  }
  .swiper-slide .slide_caption {
    font-size: 18px;
    padding: 12px 16px;
  }
}
#mobile_menu.open {
  display: flex;
}
.mobile_menu_top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 18px;
}
.mobile_menu_phone {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
.mobile_menu_phone span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.mobile_menu_phone strong {
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.mobile_menu_cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  background: #e8792a;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  border: 0 !important;
}
#mobile_menu a {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  padding: 16px 18px;
  letter-spacing: 0.01em;
  text-transform: none;
  transition:
    color 0.2s,
    background 0.2s;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}
#mobile_menu a:first-of-type {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
#mobile_menu a:hover,
#mobile_menu a:active {
  color: #e8792a;
  background: rgba(255, 255, 255, 0.04);
}

/* Close button for mobile menu */
#mobile_menu_close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  z-index: 1002;
}
