/* ==========================================================================
   RESPONSIVE SYSTEM
   Comprehensive responsive overrides for all breakpoints.
   ========================================================================== */

/* --------------------------------------------------------------------------
   MOBILE SMALL (320px - 359px)
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 359px) {
  .hero-title {
    font-size: clamp(32px, 10vw, 48px) !important;
  }

  .section-title {
    font-size: 28px !important;
  }

  .btn-primary, .btn-primary-outline {
    padding: 10px 16px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
  }

  .hero-btn-wraper {
    flex-direction: column;
    gap: 10px;
  }

  .hero-btn-wraper .btn-primary-outline {
    margin-right: 0;
  }

  .cs-meta {
    grid-template-columns: 1fr;
  }

  .cs-goals {
    grid-template-columns: 1fr;
  }

  .cs-hero__title {
    font-size: 32px !important;
    letter-spacing: -1px;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* --------------------------------------------------------------------------
   MOBILE STANDARD (360px - 413px)
   -------------------------------------------------------------------------- */
@media only screen and (min-width: 360px) and (max-width: 413px) {
  .hero-title {
    font-size: clamp(36px, 10vw, 52px) !important;
  }

  .section-title {
    font-size: 30px !important;
  }

  .cs-hero__title {
    font-size: 36px !important;
  }
}

/* --------------------------------------------------------------------------
   MOBILE LARGE (414px - 575px)
   -------------------------------------------------------------------------- */
@media only screen and (min-width: 414px) and (max-width: 575px) {
  .hero-title {
    font-size: clamp(40px, 10vw, 56px) !important;
  }

  .section-title {
    font-size: 32px !important;
  }

  .cs-hero__title {
    font-size: 40px !important;
  }
}

/* --------------------------------------------------------------------------
   MOBILE ALL (< 768px) — Global mobile fixes
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 767px) {
  /* Prevent horizontal overflow */
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Safe area insets for notched phones */
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Typography scaling */
  body {
    font-size: 1rem;
  }

  h1 { font-size: clamp(28px, 7vw, 42px); }
  h2 { font-size: clamp(24px, 5.5vw, 36px); }
  h3 { font-size: clamp(20px, 4.5vw, 28px); }
  h4 { font-size: clamp(18px, 4vw, 24px); }

  /* Section spacing */
  .pt-140 {
    padding-top: 100px;
  }

  .pb-120 {
    padding-bottom: 60px;
  }

  .pb-90 {
    padding-bottom: 48px;
  }

  .py-120 {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .py-72 {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  /* Header mobile */
  .header {
    padding: 0 !important;
  }

  .header-inner {
    padding: 0 12px !important;
  }

  .header-border-bottom {
    padding: 12px 0;
  }

  .header-hide-mobile {
    display: none !important;
  }

  /* Offcanvas mobile sizing */
  .offcanvas {
    width: 100% !important;
    min-height: auto;
  }

  /* Hero mobile */
  .hero-content-wrapper {
    text-align: left;
  }

  .hello-iam {
    font-size: 18px !important;
    gap: 8px;
  }

  .text-counter {
    font-size: 32px !important;
  }

  .text-worldwide {
    font-size: 14px !important;
  }

  .mx-8 {
    margin-left: 16px;
    margin-right: 16px;
  }

  .social-links ul {
    gap: 8px;
  }

  /* Contact spin badge */
  .contact-spin {
    display: none !important;
  }

  /* Footer mobile */
  .footer {
    padding-top: 48px;
    padding-bottom: 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .service-contact-card-footer {
    padding: 16px;
  }

  .copyright {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  /* Touch targets minimum 48px */
  button, a, input[type="submit"], .btn-primary, .btn-primary-outline {
    min-height: 44px;
  }

  /* Image handling */
  img {
    height: auto;
    max-width: 100%;
  }

  /* Cards single column */
  .blog-grid {
    grid-template-columns: 1fr !important;
  }

  /* Project cards */
  .project-card, .portfolio-item {
    margin-bottom: 20px;
  }

  /* Strock text */
  .strock-text {
    font-size: 2rem;
    line-height: 1.2;
  }

  /* Tab buttons */
  .tab-btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Featured properties */
  .featured-properties {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  /* Banner contents */
  .banner-contents {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Fix #about_me_tab horizontal overflow on mobile */
  #about_me_tab .d-inline-flex.gap-10 {
    gap: 12px;
    flex-direction: column;
    align-items: flex-start;
  }
  #about_me_tab .w-110px {
    width: auto;
    min-width: unset;
  }
  #about_me_tab .text-2xl {
    font-size: 16px;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Reduce hamburger button padding on mobile */
  #offcanvas-toggle {
    padding: 12px 20px;
  }

  /* Experience badge: relative on mobile to avoid overlap */
  .years-of-experience {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 16px auto 0;
  }
}

/* --------------------------------------------------------------------------
   TABLET HEADER FIX (768px - 991px)
   Hide desktop nav links on tablet to prevent overcrowded header
   -------------------------------------------------------------------------- */
@media only screen and (min-width: 768px) and (max-width: 991px) {
  .header-hide-mobile {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   TABLET (768px - 1023px)
   -------------------------------------------------------------------------- */
@media only screen and (min-width: 768px) and (max-width: 1023px) {
  .container {
    max-width: 720px;
  }

  .section-title {
    font-size: 42px;
  }

  .hero-title {
    font-size: 56px !important;
  }

  .py-120 {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Case study adjustments */
  .cs-hero {
    padding: 100px 24px 60px;
  }

  .cs-hero__title {
    font-size: 48px !important;
  }

  .cs-meta {
    grid-template-columns: repeat(3, 1fr);
  }

  .cs-personas {
    grid-template-columns: 1fr;
  }

  .cs-before-after__pair {
    grid-template-columns: 1fr 1fr;
  }
}

/* --------------------------------------------------------------------------
   TABLET LANDSCAPE / SMALL DESKTOP (1024px - 1279px)
   -------------------------------------------------------------------------- */
@media only screen and (min-width: 1024px) and (max-width: 1279px) {
  .container {
    max-width: 960px;
  }

  .section-title {
    font-size: 48px;
  }

  .cs-layout {
    grid-template-columns: 180px 1fr;
    gap: 32px;
  }
}

/* --------------------------------------------------------------------------
   DESKTOP (1280px - 1439px)
   -------------------------------------------------------------------------- */
@media only screen and (min-width: 1280px) and (max-width: 1439px) {
  .container {
    max-width: 1200px;
  }

  .cs-layout {
    grid-template-columns: 200px 1fr;
    gap: 40px;
    max-width: 1200px;
  }
}

/* --------------------------------------------------------------------------
   DESKTOP LARGE (1440px - 1919px)
   -------------------------------------------------------------------------- */
@media only screen and (min-width: 1440px) and (max-width: 1919px) {
  .container {
    max-width: 1320px;
  }

  .cs-layout {
    max-width: 1280px;
  }
}

/* --------------------------------------------------------------------------
   DESKTOP XL (1920px+)
   -------------------------------------------------------------------------- */
@media only screen and (min-width: 1920px) {
  .container {
    max-width: 1440px;
  }

  .cs-layout {
    max-width: 1400px;
    gap: 64px;
  }

  .cs-hero__title {
    font-size: 80px !important;
  }
}

/* --------------------------------------------------------------------------
   PRINT
   -------------------------------------------------------------------------- */
@media print {
  .header, .footer, .offcanvas, .cs-nav, .theme-toggle,
  .contact-spin, #scrollUp, .whatsapp-btn {
    display: none !important;
  }

  .cs-section {
    padding: 24px 0;
    break-inside: avoid;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
}

/* --------------------------------------------------------------------------
   PREFERS REDUCED MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .cs-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
