/* Responsive — mobile < 768px, tablet 768–1024px, desktop > 1024px */

html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
svg {
  max-width: 100%;
}

/* ========== HEADER + BURGER ========== */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #C9A84C;
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.burger-btn.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger-btn.is-open span:nth-child(2) {
  opacity: 0;
}

.burger-btn.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(5, 5, 5, 0.97);
  backdrop-filter: blur(12px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.mobile-menu.is-open {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
}

.mobile-menu nav a {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.05em;
}

.mobile-menu nav a:hover,
.mobile-menu nav a.active {
  color: #C9A84C;
}

.mobile-menu__cta {
  margin-top: 40px;
  width: 100%;
  max-width: 280px;
}

.mobile-menu__cta .btn-gold {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
}

.mobile-menu__categories {
  width: 100%;
  max-width: 320px;
  margin: 8px 0 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(201, 168, 76, 0.2);
}

.mobile-menu__categories-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c9a84c;
  text-align: left;
}

.mobile-menu__categories-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 42vh;
  overflow-y: auto;
}

.mobile-menu__cat-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #ccc;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.mobile-menu__cat-link:hover {
  background: rgba(201, 168, 76, 0.1);
  color: #c9a84c;
}

.mobile-menu__close-hint {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #888;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Categories slider hint + dots */
.categories-scroll-wrap.has-scroll-hint,
.catalog-cats-scroll-wrap.has-scroll-hint {
  position: relative;
  overflow: hidden;
}

/* Пилюли категорий — отдельная вёрстка */
.cat-tabs-wrap.has-scroll-hint {
  position: relative;
  overflow: hidden;
}

.cat-tabs-wrap .cat-tabs-row {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.cat-tabs-wrap.can-scroll .cat-tabs-row::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(270deg, #0a0a0a 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.cat-tabs-wrap.can-scroll .cat-tabs-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  background: linear-gradient(90deg, #0a0a0a 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.cat-tabs-wrap.can-scroll.is-scrolled .cat-tabs-row::before {
  opacity: 1;
}

.categories-scroll-wrap.has-scroll-hint::before,
.catalog-cats-scroll-wrap.has-scroll-hint::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 52px;
  width: 28px;
  background: linear-gradient(90deg, #0a0a0a 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.categories-scroll-wrap.has-scroll-hint::after,
.catalog-cats-scroll-wrap.has-scroll-hint::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 52px;
  width: 36px;
  background: linear-gradient(270deg, #0a0a0a 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.categories-scroll-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 12px;
  color: #777;
  margin: 10px 16px 0;
  letter-spacing: 0.03em;
}

.categories-scroll-hint__arrow {
  color: #C9A84C;
  font-weight: 700;
  animation: scrollHintPulse 1.5s ease-in-out infinite;
}

@keyframes scrollHintPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.categories-scroll-dots {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 8px 16px 4px;
  padding: 0;
}

.categories-scroll-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.categories-scroll-dot.is-active {
  background: #C9A84C;
  transform: scale(1.25);
}

/* Filters — desktop */
.filters-mobile-bar {
  display: none;
}

.filters-mobile-toggle {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
}

/* ========== TABLET ========== */
@media (max-width: 1024px) and (min-width: 768px) {
  section {
    padding: 48px 32px !important;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .page-catalog .catalog-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ========== MOBILE < 768px ========== */
@media (max-width: 767px) {
  section,
  .categories-wrap,
  .why-wrap section,
  .form-wrap section,
  .catalog-page,
  .catalog-products-wrap,
  .page-hero-inner,
  .cat-tabs-wrap,
  .catalog-breadcrumb-wrap {
    padding: 20px 16px !important;
  }

  .catalog-nav-section {
    padding: 12px 0 4px !important;
    overflow: hidden;
  }

  .section-title {
    font-size: 1.8rem !important;
  }

  .categories-header {
    padding: 0 16px 24px !important;
  }

  /* Header — logo + burger only */
  header {
    padding: 0 16px !important;
    height: 60px !important;
    min-height: 60px;
  }

  header nav:not(.mobile-menu nav) {
    display: none !important;
  }

  .header-phone {
    display: none !important;
  }

  .header-right .btn-gold,
  .header-right .btn-gold-header {
    display: none !important;
  }

  .header-right {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    margin-left: auto;
  }

  .burger-btn {
    display: flex !important;
  }

  .logo-text strong {
    font-size: 11px !important;
  }

  .logo-text span {
    display: none;
  }

  .logo-mark {
    width: 34px !important;
    height: 34px !important;
  }

  /* Hero */
  .hero {
    overflow-x: hidden;
  }

  .hero-gradient {
    background: linear-gradient(
      180deg,
      rgba(5, 8, 20, 0.9) 0%,
      rgba(5, 8, 20, 0.75) 50%,
      rgba(5, 8, 20, 0.92) 100%
    ) !important;
  }

  .hero-content {
    padding: 76px 16px 40px !important;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .hero-badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 100%;
    padding: 8px 14px !important;
    font-size: 10px !important;
    letter-spacing: 0.5px !important;
  }

  .hero-title {
    font-size: 2rem !important;
    max-width: 100% !important;
    width: 100%;
    text-align: center;
    line-height: 1.2 !important;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .hero-title__word {
    white-space: normal !important;
    display: inline;
  }

  .hero-title__char {
    display: inline !important;
  }

  .hero-sub {
    font-size: 15px !important;
    max-width: 100%;
    text-align: center;
  }

  .hero-buttons {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 36px !important;
    padding: 0 !important;
  }

  .hero-buttons .btn-gold,
  .hero-buttons .btn-outline {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    height: auto !important;
    padding: 14px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    line-height: 1.25 !important;
    border-radius: 12px !important;
  }

  .hero-buttons .btn-gold {
    background: var(--gold-gradient) !important;
    background-image: var(--gold-gradient) !important;
    color: #1a1200 !important;
    -webkit-text-fill-color: #1a1200 !important;
    border: 1px solid rgba(212, 160, 23, 0.45) !important;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3) !important;
    font-weight: 700 !important;
  }

  .hero-buttons .btn-outline {
    background: transparent !important;
    background-image: none !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border: 1px solid rgba(201, 168, 76, 0.45) !important;
    font-weight: 600 !important;
  }

  .hero-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 12px !important;
    width: 100%;
    max-width: 100%;
    align-items: stretch !important;
  }

  .hero-stat {
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 64px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    text-align: left;
    min-width: 0;
  }

  .hero-stat-icon {
    width: 32px !important;
    height: 32px !important;
  }

  .hero-stat-text strong {
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  .hero-stat-text span {
    font-size: 10px !important;
    line-height: 1.25 !important;
  }

  /* Categories slider — main + catalog (horizontal scroll) */
  .categories-wrap {
    padding: 20px 0 !important;
    overflow: hidden;
  }

  .categories-scroll-wrap .scroll-arrow,
  .catalog-cats-scroll-wrap .scroll-arrow {
    display: none !important;
  }

  .categories-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 12px !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 16px 8px !important;
    width: 100%;
    max-width: 100%;
  }

  .categories-scroll::-webkit-scrollbar {
    display: none;
  }

  .categories-scroll-hint {
    display: flex;
  }

  .cat-card {
    width: 72vw !important;
    max-width: 280px !important;
    min-width: 240px !important;
    flex: 0 0 auto !important;
    scroll-snap-align: start;
  }

  /* Пилюли категорий — свайп, без стрелок */
  .cat-tabs-wrap {
    display: block !important;
    padding: 0 0 6px !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .cat-tabs-wrap .cat-scroll {
    display: none !important;
  }

  .cat-tabs-wrap .cat-tabs-row {
    padding: 0 16px;
  }

  .cat-tabs-wrap .cat-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 8px !important;
    padding: 6px 4px 8px !important;
    margin: 0 !important;
    width: 100%;
    scrollbar-width: none;
  }

  .cat-tabs-wrap .cat-tabs::-webkit-scrollbar {
    display: none;
  }

  .cat-tabs-wrap .cat-tab {
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .cat-tabs-wrap .categories-scroll-hint {
    display: flex;
    justify-content: center;
    margin: 4px 16px 0 !important;
    padding: 0;
    font-size: 12px;
    color: #666;
    letter-spacing: 0.08em;
  }

  .cat-tabs-wrap .categories-scroll-hint__arrow {
    display: none;
  }

  .cat-tabs-wrap .categories-scroll-dots {
    display: none !important;
  }

  /* Product cards — главная и др. (каталог — catalog-mobile.css) */
  body:not(.page-catalog) .products-grid,
  .similar-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  body:not(.page-catalog) .products-grid .product-card,
  .similar-grid .product-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0;
  }

  body:not(.page-catalog) .product-img,
  .similar-grid .product-img {
    width: 100% !important;
    height: 180px !important;
    min-height: 180px !important;
    max-height: 180px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden;
  }

  body:not(.page-catalog) .product-img img,
  .similar-grid .product-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 8px;
  }

  body:not(.page-catalog) .product-body,
  .similar-grid .product-body {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 12px !important;
  }

  body:not(.page-catalog) .products-grid.list-view {
    grid-template-columns: 1fr !important;
  }

  body:not(.page-catalog) .products-grid.list-view .product-card {
    display: grid !important;
    grid-template-columns: 120px 1fr !important;
    height: auto !important;
  }

  body:not(.page-catalog) .products-grid.list-view .product-img {
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
  }

  .why-grid {
    grid-template-columns: 1fr !important;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }

  /* Form */
  .form-inner {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .lead-form input,
  .lead-form textarea,
  .lead-form .btn-gold,
  .modal-form input,
  .modal-form textarea,
  .modal-form .modal-submit {
    width: 100% !important;
    min-height: 48px;
  }

  /* Catalog layout */
  .catalog-layout {
    display: block !important;
    grid-template-columns: none !important;
    padding: 0 16px 20px !important;
    gap: 0;
  }

  .catalog-layout main {
    width: 100%;
  }

  .catalog-page {
    padding-top: 20px !important;
  }

  /* Фильтры на мобильных отключены */
  .filters-mobile-bar,
  .filters-mobile-toggle,
  .filters-drawer-backdrop,
  .filters-drawer-panel,
  .catalog-layout .sidebar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .filters-drawer-backdrop.is-visible {
    display: block;
  }

  .filters-drawer-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #222;
  }

  .filters-drawer-handle {
    width: 40px;
    height: 4px;
    background: #444;
    border-radius: 2px;
  }

  .filters-drawer-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #888;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }

  .filters-drawer-close:hover {
    color: #C9A84C;
  }

  .filters-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .filters-drawer-footer {
    flex-shrink: 0;
    padding: 12px 16px 20px;
    background: #111111;
    border-top: 1px solid #222;
  }

  .filters-drawer-footer .btn-apply {
    width: 100%;
    min-height: 48px;
    margin-top: 0 !important;
    background: linear-gradient(135deg, #8B6914 0%, #D4A017 25%, #F5C842 50%, #D4A017 75%, #8B6914 100%) !important;
    color: #1a1200 !important;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
  }

  .filters-drawer-footer .btn-reset {
    width: 100%;
    margin-top: 8px;
  }

  .page-catalog .products-header {
    display: none !important;
  }

  #site-footer-root,
  .footer-cta-bar,
  .site-footer {
    position: relative;
    z-index: 1;
  }

  body.filters-drawer-open #site-footer-root {
    pointer-events: none;
  }

  /* Product page */
  .product-main {
    grid-template-columns: 1fr !important;
    padding: 20px 16px !important;
  }

  .main-img {
    width: 100% !important;
    min-height: 260px;
  }

  .key-specs {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .product-actions {
    flex-direction: column !important;
  }

  .product-actions .btn-order-main,
  .product-actions .btn-whatsapp,
  .product-actions .btn-call {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  /* About */
  .section-legacy,
  .section-timeline,
  .section-stats,
  .section-philosophy {
    padding: 20px 16px !important;
  }

  .legacy-grid {
    grid-template-columns: 1fr !important;
  }

  .timeline::before {
    left: 16px !important;
  }

  .timeline-item,
  .timeline-item.left,
  .timeline-item.right {
    width: calc(100% - 36px) !important;
    margin-left: 36px !important;
    margin-right: 0 !important;
    text-align: left !important;
    padding: 16px 16px 16px 24px !important;
  }

  .timeline-item.left .timeline-dot,
  .timeline-item.right .timeline-dot {
    left: -27px !important;
    right: auto !important;
  }

  .values-grid {
    grid-template-columns: 1fr !important;
  }

  .about-hero__title-line {
    letter-spacing: 0.12em !important;
    text-indent: 0.12em !important;
    font-size: clamp(26px, 6.5vw, 40px) !important;
  }

  /* Touch targets */
  .btn-gold,
  .btn-outline,
  .btn-cart,
  .btn-order,
  .btn-order-main,
  .cat-tab,
  .view-btn {
    min-height: 44px;
  }
}

@media (max-width: 399px) {
  .cat-card {
    flex: 0 0 calc(85vw - 16px) !important;
    width: calc(85vw - 16px) !important;
    min-width: calc(85vw - 16px) !important;
  }
}

/* Desktop: каталог без боковых фильтров */
@media (min-width: 768px) {
  .page-catalog .catalog-layout .sidebar {
    display: none !important;
  }

  .page-catalog .catalog-layout {
    grid-template-columns: 1fr !important;
  }

  .filters-drawer-panel {
    position: sticky !important;
    top: 90px;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    overflow: visible !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: block !important;
  }

  .filters-drawer-top,
  .filters-drawer-body,
  .filters-drawer-footer {
    display: contents;
  }

  .filters-drawer-close {
    display: none;
  }

  .filters-drawer-handle {
    display: none;
  }

  .sidebar .filter-block {
    margin-bottom: 16px;
  }

  .sidebar .btn-apply,
  .sidebar .btn-reset {
    width: 100%;
  }
}
