/* Final responsive layer. Loaded after page-specific inline styles. */
html { overflow-x: clip; }
body { min-width: 320px; }
img, video, iframe { max-width: 100%; }

.hero__title,
.product-detail__name,
.section-title,
.page-title { max-width: 100%; overflow-wrap: anywhere; }

/* The full phone number is already visible in the top bar. Keep the second
   header action compact until there is genuinely enough horizontal room. */
@media (max-width: 2199px) and (min-width: 1181px) {
  .header-phone span { display: none !important; }
  .header-phone { width: 38px !important; min-width: 38px !important; padding: 8px !important; }
  .nav__link { padding-left: 8px !important; padding-right: 8px !important; }
}

@media (min-width: 2200px) {
  #main-nav { margin-right: 20px !important; }
}

@media (min-width: 1600px) {
  .container,
  .topbar .container,
  #header .container,
  footer .container {
    width: 100% !important;
    max-width: min(1760px, calc(100vw - 96px)) !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  #featured-products.products-grid,
  #sale-products.products-grid,
  .products-grid,
  .osp-products-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  .catalog-page-wrap,
  .osp-layout { grid-template-columns: 280px minmax(0, 1fr) !important; gap: 24px !important; }
  .product-detail { grid-template-columns: minmax(440px, 560px) minmax(0, 1fr) !important; gap: 28px !important; }
  .hero-inner { grid-template-columns: minmax(0, 760px) minmax(360px, 1fr) !important; gap: 48px !important; }
  .hero-content { max-width: 760px !important; }
  .hero__sub { max-width: 680px !important; }
}

@media (max-width: 620px) {
  .hero-overlay-content,
  .hero-overlay-content .container,
  .hero-inner,
  .hero-content,
  .hero-stats,
  .hero__actions {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .hero-overlay-content .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .hero-content { padding: 16px !important; }
  .hero__title { width: 100%; font-size: 2rem !important; line-height: 1.08; }
  .hero__sub { width: 100%; overflow-wrap: anywhere; }
  .hero__actions { display: grid !important; grid-template-columns: 1fr !important; }
  .hero__actions .btn { width: 100% !important; min-height: 44px; justify-content: center; }
  .hero-stats {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }
  .hero-stat { width: auto !important; min-width: 0 !important; padding: 9px 4px !important; }
  .hero-stat__label { font-size: .58rem !important; overflow-wrap: anywhere; }
  .section-head { align-items: flex-start; gap: 10px; }
  .section-head > a { flex: 0 0 auto; }
  .product-detail__gallery,
  .product-detail__info,
  .catalog-main { min-width: 0; }
  .product-detail__img-wrap { min-height: 260px; }
  .table-wrap,
  .b2b-table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; }
}

@media (max-width: 380px) {
  #header .container { padding-left: 10px !important; padding-right: 10px !important; }
  .logo__img { max-width: 116px !important; height: 38px !important; }
  .header-right { gap: 4px !important; }
  .header-phone,
  .btn-b2b-header,
  .btn-wa-header,
  #menu-toggle {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 7px !important;
  }
  .hero__title { font-size: 1.78rem !important; }
  .hero-content { padding: 16px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .animate-fade,
  .animate-up,
  .animate-left,
  .animate-right,
  .animate-scale { opacity: 1 !important; transform: none !important; }
}
