/* ============================================================
   ScandISpa — Responsive
   992 · 768 · 580 · 390
   ============================================================ */

/* ━━━ TABLET LANDSCAPE  ≤ 992px ━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 992px) {

  .container { padding: 0 1.75rem; }
  .section   { padding: 5rem 0; }

  .nav { padding: 1rem 1.75rem; }
  .nav.scrolled { padding: 0.75rem 1.75rem; }
  .nav-links { gap: 1.4rem; }
  .nav-links a { font-size: 0.76rem; }
  .nav-cta { padding: 0.58rem 1.3rem; font-size: 0.76rem; }

  /* Burger → × */
  .nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  .mobile-nav-overlay { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  .mobile-nav a { padding: 1.1rem 0; font-size: 1rem; text-align:center;}
  .mobile-nav .btn { margin-top: 1.25rem; justify-content: center; }
  .mobile-nav::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--gold), #69bfd3);
  }
    .mobile-nav-close {
      position: absolute;
      top: 1.1rem; right: 1.25rem;
      width: 40px; height: 40px;
      display: flex; align-items: center; justify-content: center;
      border: 1.5px solid var(--border-strong);
      border-radius: 50%;
      background: var(--cream);
      cursor: pointer;
      color: var(--text);
      transition: all 0.2s;
    }
    .mobile-nav-close:hover {
      background: var(--gold-pale);
      border-color: var(--gold);
      color: var(--gold);
    }
  /* Hero — single column */
  .hero {
    grid-template-columns: 1fr;
    padding: 8rem 1.75rem 4rem;
    text-align: center;
    gap: 2.5rem;
    min-height: auto;
  }
  .hero-desc     { margin-left: auto; margin-right: auto; }
  .hero-actions  { justify-content: center; }
  .hero-badges   { justify-content: center; }
  .hero-image-wrap { max-width: 600px; margin: 0 auto; }

  /* Stats overlay — 4 cols inline */
  .hero-image-overlay {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 0.9rem 1rem;
  }
  .hero-stat { border-right: 1px solid var(--border); padding: 0 0.75rem; }
  .hero-stat:last-child { border-right: none; }

  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

  .cfg-layout { grid-template-columns: 1fr; gap: 2rem; }
  .cfg-preview { position: static; }
  .cfg-model-cards { grid-template-columns: repeat(3, 1fr); }

  .contact-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .region-grid    { grid-template-columns: 1fr; gap: 2.5rem; }
  .product-detail-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .featured-header { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .page-header { padding: 7rem 0 3.5rem; }
}


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

  h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
  h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }

  .container { padding: 0 1.25rem; }
  .section   { padding: 4rem 0; }

  .nav { padding: 0.85rem 1.25rem; }
  .nav.scrolled { padding: 0.65rem 1.25rem; }
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .nav-logo img { height: 42px; }

  .hero { padding: 6rem 1.25rem 3rem; gap: 2rem; }
  .hero-title  { margin-bottom: 1rem; }
  .hero-desc   { font-size: 0.93rem; margin-bottom: 1.5rem; }
  .hero-actions { flex-direction: column; align-items: center; gap: 0.65rem; }
  .hero-actions .btn { width: 100%; max-width: 340px; justify-content: center; }
  .hero-badges { gap: 0.75rem; }
  .hero-image-wrap { max-width: 100%; }

  /* Stats — 2×2 grid pinned bottom of image */
  .hero-image-overlay {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 0;
    bottom: 0; left: 0; right: 0;
    border-radius: 0 0 24px 24px;
    backdrop-filter: blur(12px);
  }
  .hero-stat {
    padding: 0.75rem 0.5rem;
    border-right: 1px solid var(--border);
    border-top: 1px solid var(--border);
  }
  .hero-stat:nth-child(2n) { border-right: none; }
  .hero-stat-num { font-size: 1.4rem; }
  .hero-stat-lbl { font-size: 0.62rem; }

  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .products-grid { grid-template-columns: 1fr; gap: 1.25rem; }

  .cfg-model-cards { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
  .cfg-preview { padding: 1.5rem; }
  .cfg-specs { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }

  .region-stats { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .region-stat-num { font-size: 2rem; }

  .footer { padding: 3rem 0 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 2rem; }
  .footer-desc { max-width: 100%; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 0.75rem; }
  .footer-bottom > div { gap: 0.75rem; }

  .filter-bar { gap: 0.5rem; margin-bottom: 1.75rem; }
  .filter-btn { padding: 0.45rem 1rem; font-size: 0.76rem; }

  .page-header { padding: 6rem 0 2.75rem; }
  .page-header p { font-size: 0.9rem; }

  .cta-section { padding: 3.5rem 1.25rem; }
  .cta-section h2 { font-size: clamp(1.5rem, 5.5vw, 2rem); }

  .card { padding: 1.5rem; }
  .messages-bar { top: 62px; }
  .mobile-nav { width: 74%; max-width: 280px; }
}


/* ━━━ PHONE  ≤ 580px ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 580px) {

  .container { padding: 0 1rem; }
  .section   { padding: 3.5rem 0; }

  /* Hero — flex column, image full bleed at bottom */
  .hero {
    display: flex;
    flex-direction: column;
    padding: 5.5rem 1rem 0;
    gap: 0;
    text-align: center;
  }

  .hero-content { padding-bottom: 1.75rem; }

  .hero-title { margin-bottom: 0.875rem; }
  .hero-desc  { font-size: 0.9rem; margin-bottom: 1.5rem; color: var(--text-muted); }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
  }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .hero-badges {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.875rem;
    margin-bottom: 0;
  }
  .hero-badge { font-size: 0.72rem; }
  .hero-badge-icon { width: 26px; height: 26px; border-radius: 6px; }
  .hero-badge-icon svg { width: 13px; height: 13px; }

  /* Image — flush to screen edges */
  .hero-visual {
    margin: 1.5rem -1rem 0;
    width: calc(100% + 2rem);
  }
  .hero-image-wrap {
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
  }
  .hero-image-wrap img { aspect-ratio: 16/10; width: 100%; }

  /* Stats — strip below image, NOT absolute */
  .hero-image-overlay {
    position: relative;
    bottom: auto; left: auto; right: auto;
    border-radius: 0;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 0;
    background: var(--white);
    border: none;
    border-top: 1px solid var(--border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .hero-stat {
    padding: 0.8rem 0.25rem;
    border-right: 1px solid var(--border);
    border-top: none;
  }
  .hero-stat:last-child { border-right: none; }
  .hero-stat-num { font-size: 1.25rem; color: var(--teal); }
  .hero-stat-lbl { font-size: 0.6rem; }

  /* Services — horizontal card layout */
  .services-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .service-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1.25rem;
        text-align: left;
    }
  .service-icon { flex-shrink: 0; margin: 0; width: 44px; height: 44px; border-radius: 12px; }
  .service-card h3 { font-size: 0.95rem; margin-bottom: 0.2rem; }
  .service-card p  { font-size: 0.8rem; }

  /* Products */
  .products-grid { grid-template-columns: 1fr; gap: 1rem; }
  .product-card-body { padding: 1.25rem; }
  .product-card-name { font-size: 1.2rem; }
  .product-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .product-card-actions .btn { justify-content: center; }

  /* Filter — horizontal scroll */
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
    margin-bottom: 1.5rem;
    mask-image: linear-gradient(to right, transparent, black 5%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 90%, transparent);
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn { white-space: nowrap; flex-shrink: 0; }

  /* Configurator */
  .cfg-model-cards { grid-template-columns: 1fr; gap: 0.5rem; }
  .cfg-model-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    text-align: left;
  }
  .cfg-model-card-name  { font-size: 0.92rem; }
  .cfg-model-card-price { margin-top: 0; }
  .cfg-swatch { width: 36px; height: 36px; }
  .cfg-price-value { font-size: 1.75rem; }
  .cfg-specs { grid-template-columns: 1fr 1fr; gap: 0.5rem; }

  .card { border-radius: 16px; padding: 1.25rem; }

  .region-stats { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .region-stat  { padding: 1rem; }
  .region-stat-num { font-size: 1.75rem; }

  .footer { padding: 2.5rem 0 1.25rem; }
  .page-header { padding: 5.5rem 0 2.25rem; }

  .cta-section { padding: 3rem 1rem; }
  .cta-section > .container > div {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .cta-section .btn { justify-content: center; }

  .btn-lg { padding: 0.9rem 1.75rem; font-size: 0.9rem; }
}


/* ━━━ SMALL PHONE  ≤ 390px  (iPhone 12 Pro / SE) ━━━━━━━━━ */
@media (max-width: 390px) {

  html { font-size: 15px; }
  .container { padding: 0 0.875rem; }

  .nav { padding: 0.75rem 0.875rem; }
  .nav-logo img { height: 36px; }

  .hero { padding-top: 5rem; }
  .hero-visual {
    margin-left: -0.875rem;
    margin-right: -0.875rem;
    width: calc(100% + 1.75rem);
  }

  .hero-stat     { padding: 0.65rem 0.1rem; }
  .hero-stat-num { font-size: 1.1rem; }
  .hero-stat-lbl { font-size: 0.58rem; }

  .hero-badges { gap: 0.4rem 0.75rem; }
  .hero-badge  { font-size: 0.68rem; }

  .btn    { padding: 0.72rem 1.4rem; font-size: 0.82rem; }
  .btn-sm { padding: 0.52rem 1rem;   font-size: 0.76rem; }
  .btn-lg { padding: 0.85rem 1.5rem; font-size: 0.86rem; }

  .product-card-body  { padding: 1rem; }
  .product-card-name  { font-size: 1.1rem; }
  .product-card-price { font-size: 1.2rem; }

  .service-card { padding: 1rem; gap: 0.75rem; }
  .service-icon { width: 40px; height: 40px; }
  .service-card h3 { font-size: 0.9rem; }

  .cfg-specs { grid-template-columns: 1fr; }
  .cfg-price-value { font-size: 1.5rem; }

  .region-stats    { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .region-stat-num { font-size: 1.5rem; }

  .card { padding: 1rem; border-radius: 14px; }
  .section { padding: 3rem 0; }
  .page-header { padding: 5rem 0 2rem; }
  .footer-logo img { width: 110px !important; }
  .filter-btn { padding: 0.4rem 0.85rem; font-size: 0.72rem; }
}


/* ━━━ TOUCH — убираем залипающие hover ━━━━━━━━━━━━━━━━━━━ */
@media (hover: none) and (pointer: coarse) {
  .product-card:hover,
  .service-card:hover,
  .cfg-model-card:hover,
  .btn-gold:hover,
  .btn-teal:hover { transform: none !important; box-shadow: revert; }

  .filter-btn  { min-height: 44px; display: inline-flex; align-items: center; }
  .nav-burger  { padding: 8px; min-width: 40px; min-height: 40px; }
  .cfg-swatch  { min-width: 44px; min-height: 44px; }
  .cfg-toggle  { min-height: 52px; }
  .product-card-actions .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
}


/* ━━━ PRINT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media print {
  .nav, .mobile-nav, .mobile-nav-overlay, .cta-section { display: none !important; }
  .hero { min-height: auto; padding: 2rem 0; }
  body  { background: white; }
}
