/* ================================================================
   Rasafrost — Responsive Rules
   Breakpoints:
   - xs: < 400px (small mobile)
   - sm: 400px – 639px (medium/big mobile)
   - md: 640px – 899px (small tablet)
   - lg: 900px – 1199px (tablet / small laptop)
   - xl: 1200px – 1599px (laptop / desktop)
   - 2xl: 1600px – 2199px (large desktop)
   - 4k: 2200px+
   ================================================================ */

/* ---------- MOBILE NAV (below 1024px) ---------- */
@media (max-width: 1023px) {

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--color-line);
    border-radius: 10px;
    padding: 0 10px;
    margin-left: auto;
    order: 2;
  }
  .nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--color-ink);
    border-radius: 2px;
    transition: var(--transition);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .main-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: #FAF3E0;
    border-bottom: 1px solid #e8e0ce;
    padding: 16px 24px 24px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    box-shadow: var(--shadow-md);
  }
  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .main-nav a {
    padding: 14px 12px;
    font-size: 1rem;
    border-bottom: 1px solid var(--color-line);
  }
  .main-nav a:hover { background: var(--color-bg-soft); }
  .dropdown {
    position: static;
    box-shadow: none;
    padding: 0 0 0 16px;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
  }
  .dropdown a { border-bottom: none; font-size: 0.92rem; color: var(--color-muted); }
  
}

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
}

/* ---------- 4K / VERY LARGE ---------- */
@media (min-width: 2200px) {
  body { font-size: 18px; }
  .container { max-width: 1800px; padding: 0 60px; }
  h1 { font-size: 5.5rem; }
  h2 { font-size: 3.4rem; }
  .hero { min-height: 85vh; }
  .section { padding: 160px 0; }
  .footer-grid { gap: 64px; }
}

/* ---------- LARGE DESKTOP ---------- */
@media (min-width: 1600px) and (max-width: 2199px) {
  .container { max-width: 1440px; }
}

/* ---------- LAPTOP ---------- */
@media (max-width: 1279px) {
  .card-grid.four { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; row-gap: 40px; }
}

/* ---------- STANDARD LAPTOP (1280px to 1599px) ---------- */
@media (min-width: 1280px) and (max-width: 1599px) {
  .container {
    max-width: 1140px; /* Slightly narrower container for this range */
  }
  
  .logo img {
    height: 48px; /* Slightly smaller logo for this specific laptop size */
  }

  .logo-text {
    font-size: 1.35rem; /* Locked smaller size for this specific laptop size */
  }

  .main-nav a {
    padding: 10px 8px; /* Tightens nav links so they don't push the logo */
    font-size: 0.85rem; 
  }
}

/* ---------- TABLET LANDSCAPE / SMALL LAPTOP ---------- */
@media (max-width: 1023px) {
  .container { padding: 0 20px; }
  .hero { min-height: 80vh; }
  .intro-grid { grid-template-columns: 1fr; gap: 40px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split-media { order: -1; }
  .cta-inner { flex-direction: column; text-align: center; }
  .cta-inner .cta-actions { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- TABLET PORTRAIT ---------- */
@media (max-width: 767px) {
  .header-inner { height: 72px; }
  .logo img { height: 42px; } /* Slightly smaller on tablets/mobile */
  .logo-text { font-size: 1.3rem; }
  .main-nav { top: 72px; max-height: calc(100vh - 72px); }
  .hero { min-height: 78vh; }
  .hero-content { padding-top: 60px; padding-bottom: 60px; }
  .hero-actions .btn { width: 100%; }
  .hero-actions { width: 100%; }
  .process-strip { gap: 8px; padding: 20px 16px; }
  .strip-step { font-size: 0.8rem; }
  .strip-arrow { display: none; }
  .category-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; padding-bottom: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ---------- BIG MOBILE ---------- */
@media (max-width: 639px) {
  .container { padding: 0 16px; }
  .card-grid.four { grid-template-columns: 1fr; }
  .card { padding: 26px 20px; }
  .btn { padding: 13px 24px; font-size: 0.9rem; }
  .split-media { grid-template-columns: 1fr 1fr; gap: 12px; }
  .split-media img:first-child { margin-top: 0; }
}

/* ---------- MEDIUM MOBILE ---------- */
@media (max-width: 479px) {
  body { font-size: 15.5px; }
  .hero { min-height: 85vh; }
  .hero-content { padding-top: 40px; padding-bottom: 40px; }
  .section { padding: 56px 0; }
  .page-hero { padding: 70px 0 56px; }
  .hero-sub { font-size: 0.98rem; }
  .eyebrow { font-size: 0.72rem; letter-spacing: 0.12em; }
  .scroll-cue { display: none; }
}

/* ---------- SMALL MOBILE ---------- */
@media (max-width: 359px) {
  body { font-size: 15px; }
  .container { padding: 0 14px; }
  .logo img { height: 36px; }
  .logo-text { font-size: 1.1rem; }
  .header-inner { height: 64px; }
  .main-nav { top: 64px; max-height: calc(100vh - 64px); }
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.5rem; }
  .btn { padding: 12px 20px; font-size: 0.85rem; }
}

/* ---------- LANDSCAPE PHONES ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 100vh; }
  .hero-content { padding-top: 40px; padding-bottom: 40px; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-media video { display: none; }
  .hero-media img { display: block; }
}

/* ---------- TOUCH DEVICES: DISABLE HOVER HOVER-ONLY ---------- */
@media (hover: none) {
  .has-dropdown:hover .dropdown { opacity: 0; visibility: hidden; transform: translateY(8px); }
}