/* ============================================================
   Smart Space Constructions - responsive.css
   ============================================================ */

/* ── Large Desktops (1400px+) ───────────────────────────────── */
@media (min-width: 1400px) {
  .container { max-width: 1280px; }
}

/* ── Desktop (1200px – 1399px) ──────────────────────────────── */
@media (max-width: 1199px) {
  .hero-section { min-height: 80vh; }
  .hero-form-card { padding: 28px 24px; }
}

/* ── Tablet Landscape (992px – 1199px) ──────────────────────── */
@media (max-width: 991px) {
  .section-gap { padding: 60px 0; }
  .section-gap-sm { padding: 40px 0; }

  .navbar-ss .navbar-collapse {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 16px;
    margin-top: 12px;
  }
  .navbar-ss .nav-link { padding: 10px 14px !important; }
  .navbar-cta {
    display: inline-block;
    margin-top: 8px;
    width: 100%;
    text-align: center;
  }
  .navbar-ss .dropdown-menu {
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--orange);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--orange-light);
    margin-top: 4px;
    margin-left: 8px;
  }
  .navbar-ss .dropdown-item {
    color: var(--navy);
    background: transparent;
  }
  .navbar-ss .dropdown-item:hover,
  .navbar-ss .dropdown-item:focus {
    background: rgba(246,137,32,.15);
    color: var(--orange);
  }
  .navbar-ss .dropdown-item.active,
  .navbar-ss .dropdown-item:active {
    background: var(--orange);
    color: var(--white) !important;
  }
  .navbar-ss .dropdown-item.active i,
  .navbar-ss .dropdown-item:active i {
    color: var(--white) !important;
  }

  .hero-section {
    min-height: auto;
    padding: 64px 0 48px;
  }
  .hero-section .hero-stats { gap: 20px; }
  .hero-form-card { margin-top: 40px; }

  .stat-divider { display: none; }

  /* Process snake → vertical on tablet/mobile */
  .ssic-process {
    flex-direction: column;
    gap: 0;
    padding-left: 0;
  }
  .ssic-process::before { display: none; }
  .sp-step {
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
    position: relative;
  }
  .sp-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 26px;
    top: 54px;
    bottom: -28px;
    width: 3px;
    background: linear-gradient(to bottom, var(--orange), rgba(246,137,32,.12));
    border-radius: 2px;
    z-index: 0;
  }
  .sp-dot { order: 0; flex-shrink: 0; z-index: 1; }
  .sp-label-area {
    min-height: auto !important;
    text-align: left;
    padding: 6px 0 0 !important;
    justify-content: flex-start !important;
    order: 1;
    flex: 1;
  }
  .sp-spacer { display: none !important; }

  .inline-form-wrap { padding: 36px 28px; }

  .pricing-card.featured { transform: translateY(0); margin-top: 18px; }
  .pricing-card:hover { transform: translateY(-4px); }

  .project-gallery-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 10px;
    gap: 12px;
  }
  .pg-tile { grid-column: span 3; grid-row: span 20; }
  .pg-tile--landscape { grid-column: span 6; grid-row: span 22; }
  .pg-tile--portrait { grid-column: span 3; grid-row: span 28; }
  .pg-tile--square { grid-column: span 3; grid-row: span 20; }
  .pg-tile--feature-wide { grid-column: span 6; grid-row: span 24; }
  .pg-tile--feature-panorama { grid-column: span 6; grid-row: span 24; }
  .pg-tile--feature-tall { grid-column: span 3; grid-row: span 28; }
}

/* ── Tablet Portrait (768px – 991px) ────────────────────────── */
@media (max-width: 767px) {
  .section-gap { padding: 50px 0; }

  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.5rem; }

  .hero-section { padding: 50px 0 40px; }
  .hero-stats { gap: 16px; }
  .hero-stat .stat-number { font-size: 1.4rem; }

  .stats-section .row > div:not(:last-child) {
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .inline-form-wrap { padding: 28px 20px; }

  .cta-banner { padding: 48px 0; }

  .thank-you-card { padding: 40px 28px; }

  .testimonial-card { padding: 24px 20px; }

  .footer-ss { padding: 32px 0 0; }
  .footer-ss .row { --bs-gutter-y: 0; }
  .footer-ss .footer-brand img { height: 52px; margin-bottom: 10px; }
  .footer-ss .footer-desc { max-width: 100%; margin-bottom: 12px; font-size: .82rem; }
  .footer-ss h6 { margin-top: 18px; margin-bottom: 8px; font-size: .78rem; }
  .footer-ss .footer-links li { margin-bottom: 5px; }
  .footer-ss .footer-links a { font-size: .8rem; }
  .footer-contact-item { margin-bottom: 8px; }
  .footer-contact-item .contact-icon { width: 26px; height: 26px; font-size: .72rem; }
  .footer-contact-item .contact-text { font-size: .78rem; }
  .footer-social { margin-top: 12px; gap: 8px; }
  .footer-bottom { margin-top: 24px; padding: 12px 0; }

  .trust-bar .row > div:not(:last-child) {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .page-hero { padding: 56px 0 40px; }

  .project-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 9px;
    gap: 10px;
  }
  .pg-tile { grid-column: span 1 !important; grid-row: span 20 !important; }
  .pg-tile--portrait { grid-row: span 26 !important; }
  .pg-tile--feature-panorama { grid-column: span 2 !important; grid-row: span 22 !important; }
  .pg-tile--feature-tall { grid-row: span 24 !important; }
  .pg-modal-nav {
    width: 38px;
    height: 38px;
    font-size: .85rem;
  }
}

/* ── Mobile Large (576px – 767px) ───────────────────────────── */
@media (max-width: 575px) {
  .section-gap { padding: 40px 0; }

  /* Keep container padding >= Bootstrap gutter half (12px) to prevent row overflow */
  .container { padding-left: 12px; padding-right: 12px; }

  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.35rem; }

  .btn-primary-ss, .btn-outline-ss, .btn-white-ss {
    padding: 12px 20px;
    font-size: .875rem;
    white-space: normal;
    text-align: center;
  }
  .btn-lg { padding: 14px 24px; font-size: .95rem; }

  /* Stack hero + page-hero CTA buttons vertically */
  .hero-section .d-flex.gap-3,
  .page-hero .d-flex.gap-3 {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-section .d-flex.gap-3 .btn-primary-ss,
  .hero-section .d-flex.gap-3 .btn-outline-ss,
  .hero-section .d-flex.gap-3 .btn-white-ss,
  .page-hero .d-flex.gap-3 .btn-primary-ss,
  .page-hero .d-flex.gap-3 .btn-outline-ss,
  .page-hero .d-flex.gap-3 .btn-white-ss {
    width: 100%;
    justify-content: center;
  }

  .hero-section { padding: 40px 0 32px; }
  .hero-section .hero-badge { font-size: .7rem; }
  .hero-stats { justify-content: center; gap: 12px; }
  .hero-stat .stat-number { font-size: 1.2rem; }
  .hero-form-card { padding: 24px 18px; }

  .navbar-ss .navbar-brand img { height: 48px; }

  .pain-card { padding: 20px 18px; }

  .service-card-body { padding: 24px 18px 18px; }

  .pricing-card { padding: 24px 20px; }

  .testimonial-card { padding: 20px 16px; }

  .contact-info-card { padding: 24px 20px; }

  .thank-you-card { padding: 32px 20px; }

  .wa-float { width: 44px; height: 44px; font-size: 1.2rem; bottom: 72px; right: 16px; }
  .scroll-top-btn { right: 16px; bottom: 24px; width: 38px; height: 38px; }

  /* Footer: compact layout on small phones */
  .footer-ss { padding: 24px 0 0; }
  .footer-ss .row { --bs-gutter-y: 0; --bs-gutter-x: 1rem; }
  .footer-ss .footer-brand img { height: 44px; margin-bottom: 8px; }
  .footer-ss .footer-desc { font-size: .78rem; margin-bottom: 10px; }
  .footer-ss h6 { margin-top: 14px; margin-bottom: 6px; font-size: .75rem; letter-spacing: .06em; }
  .footer-ss .footer-links li { margin-bottom: 4px; }
  .footer-ss .footer-links a { font-size: .78rem; padding: 0; }
  /* Services + Quick Links: 2 columns side by side */
  .footer-ss .col-lg.col-md-6.col-sm-6 {
    flex: 0 0 auto;
    width: 50%;
  }
  .footer-contact-item { margin-bottom: 6px; gap: 7px; }
  .footer-contact-item .contact-icon { width: 24px; height: 24px; font-size: .68rem; }
  .footer-contact-item .contact-text { font-size: .75rem; line-height: 1.4; }
  .footer-social { margin-top: 10px; gap: 7px; }
  .social-link { width: 30px; height: 30px; font-size: .78rem; }
  .footer-bottom { margin-top: 20px; padding: 12px 0; }
  .footer-bottom p { font-size: .72rem; }

  .inline-form-wrap { padding: 24px 16px; }
  .inline-form-wrap .form-title { font-size: 1.25rem; }

  .breadcrumb-ss { flex-wrap: wrap; }

  .stats-section { padding: 40px 0; }
  .stat-item .stat-number { font-size: 2.2rem; }

  .swiper-button-next, .swiper-button-prev { display: none !important; }
  .testimonials-swiper-wrap { padding: 0; }

  .feature-card { padding: 22px 18px; }

  .hero-form-card .form-title { font-size: 1.05rem; }

  /* Prevent any card/section overflow */
  .hero-form-card,
  .pain-card,
  .service-card,
  .feature-card,
  .pricing-card,
  .testimonial-card,
  .inline-form-wrap {
    max-width: 100%;
    overflow: hidden;
  }
}

/* ── Mobile Small (< 400px) ─────────────────────────────────── */
@media (max-width: 399px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  .hero-stats { gap: 8px; }
  .hero-stat { flex: 1 1 40%; }
  .section-label { font-size: .7rem; }
  .pricing-name { font-size: 1.1rem; }
  .pricing-price { font-size: 1.6rem; }

  /* Tighten container for very small screens */
  .container { padding-left: 10px; padding-right: 10px; }

  /* Stack CTA buttons on very small screens */
  .cta-banner .d-flex.gap-3,
  .section-gap .d-flex.gap-3 {
    flex-direction: column;
    align-items: stretch;
  }
  .cta-banner .d-flex.gap-3 .btn-primary-ss,
  .cta-banner .d-flex.gap-3 .btn-white-ss {
    width: 100%;
    justify-content: center;
  }

  /* Ultra-mobile footer optimizations */
  .footer-ss { padding: 28px 0 0; }
  .footer-ss h6 { margin-top: 16px; margin-bottom: 8px; font-size: .8rem; }
  .footer-ss .footer-links a { font-size: .8rem; padding: 1px 0; }
  .footer-contact-item { margin-bottom: 6px; gap: 6px; }
  .footer-contact-item .contact-icon { width: 24px; height: 24px; font-size: .65rem; }
  .footer-contact-item .contact-text { font-size: .75rem; line-height: 1.3; }
  .footer-social { margin-top: 12px; gap: 6px; }
  .social-link { width: 30px; height: 30px; font-size: .75rem; }
  .footer-bottom { margin-top: 24px; padding: 12px 0; }
  .footer-bottom p { font-size: .75rem; }
}

/* ── Section Sketch Backgrounds - Responsive ────────────────── */

/* Tablets (≤ 991px): scale down large illustration backgrounds */
@media (max-width: 991px) {
  .bg-light-alt {
    background-size: 100% 100%, 140% auto;
    background-position: center, bottom center;
  }
  #services,
  #our-process {
    background-size: 100% 100%, auto 50%;
  }
  .stats-section {
    background-size: 100% 100%, 160% auto;
  }
  .cta-banner {
    background-size: 100% 100%, 160% auto, cover;
  }
}

/* Mobile (≤ 767px): hide complex illustrations, keep simple tiles */
@media (max-width: 767px) {
  .bg-light-alt,
  #services,
  #our-process {
    background-image: none;
  }
  .stats-section {
    background-size: 100% 100%, 250% auto;
    background-position: center, bottom center;
  }
  .cta-banner {
    background-size: 100% 100%, 250% auto, cover;
    background-position: center, bottom center, center;
  }
}

/* Small mobile (≤ 575px): also hide tile patterns for performance */
@media (max-width: 575px) {
  .hero-section,
  .page-hero,
  .pain-section,
  .faq-section {
    background-image: none;
  }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .navbar-ss, .wa-float, .scroll-top-btn, .hero-form-card { display: none !important; }
  body { font-size: 12pt; }
  h1, h2, h3 { color: #000 !important; }
}

/* ── Vertical Timeline ──────────────────────────────────────── */
/* Force cards visible on all mobile/tablet — JS reveal is unreliable on iOS Safari */
@media (max-width: 991px) {
  .tl-card {
    opacity: 1 !important;
    transform: translateX(0) !important;
    transition: border-color .35s, box-shadow .35s !important;
  }
  .tl-item { /* treat every item as already visible */
    /* year + dot colour handled by JS, but cards no longer hidden */
  }
}

@media (max-width: 600px) {
  #vtl-year-nav { display: none !important; }
  .vtl-section .tl-track { padding-left: 36px; }
  .vtl-section .tl-rail  { left: 9px; }
  .tl-item {
    grid-template-columns: 18px 1fr;
    column-gap: 12px;
  }
  .tl-year { display: none; }
  .tl-dot  { grid-column: 1; grid-row: 1; }
  .tl-card { grid-column: 2; grid-row: 1; }
}

/* ── Horizontal Timeline ────────────────────────────────────── */
@media (max-width: 720px) {
  .htl-section { --card-w: calc(100vw - 48px); --card-h: auto; }
  .htl-strip::before,
  .htl-strip::after { flex: 0 0 24px; }
  .htl-card { flex-direction: column; height: auto; }
  .htl-card__left {
    width: 100%; flex-direction: row;
    align-items: center; gap: 16px; padding: 20px 24px;
  }
  .htl-card__ghost { font-size: 4rem; top: -8px; left: 0; }
  .htl-card__icon  { margin-bottom: 0; flex-shrink: 0; }
  .htl-card__year  { font-size: 1.5rem; }
  .htl-card__right { padding: 24px 22px 20px; }
  .htl-arrow--prev { left: 4px; }
  .htl-arrow--next { right: 4px; }
  .htl-arrow { width: 40px; height: 40px; font-size: .8rem; }
}
@media (max-width: 480px) {
  .htl-rail-dot__year { font-size: .68rem; }
}
