/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SAISHA INTERIORS — RESPONSIVE SYSTEM
   Breakpoints: 1024px · 768px · 480px
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── TABLET (≤ 1024px) ── */
@media (max-width: 1024px) {
  .metrics        { grid-template-columns: repeat(2, 1fr); }
  .services-grid  { grid-template-columns: repeat(2, 1fr); }
  .team-grid      { grid-template-columns: repeat(2, 1fr); }
  footer          { grid-template-columns: 1fr 1fr; }

  /* Portfolio: collapse to 6-col base */
  .portfolio-grid { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 240px; }
  .portfolio-item:nth-child(1)  { grid-column: span 4; grid-row: span 2; }
  .portfolio-item:nth-child(2)  { grid-column: span 2; }
  .portfolio-item:nth-child(3)  { grid-column: span 2; }
  .portfolio-item:nth-child(4)  { grid-column: span 3; }
  .portfolio-item:nth-child(5)  { grid-column: span 3; }
  .portfolio-item:nth-child(6)  { grid-column: span 6; }
  .portfolio-item:nth-child(7)  { grid-column: span 3; }
  .portfolio-item:nth-child(8)  { grid-column: span 3; grid-row: span 1; }
  .portfolio-item:nth-child(9)  { grid-column: span 3; }
  .portfolio-item:nth-child(10) { grid-column: span 3; }
  .portfolio-item:nth-child(11) { grid-column: span 3; }
  .portfolio-item:nth-child(12) { grid-column: span 2; }
  .portfolio-item:nth-child(13) { grid-column: span 2; }
  .portfolio-item:nth-child(14) { grid-column: span 2; }
}

/* ── MOBILE (≤ 768px) ── */
@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger            { display: flex; }

  .about         { grid-template-columns: 1fr; }
  .founder       { grid-template-columns: 1fr; }
  .founder-spotlight { grid-template-columns: 1fr; gap: 40px; padding: 60px 24px; }
  .contact       { grid-template-columns: 1fr; }
  .before-after  { grid-template-columns: 1fr; }
  .packages-grid { grid-template-columns: 1fr; }
  footer         { grid-template-columns: 1fr; }

  /* ── ABOUT LOGO MOBILE FIX ── */
  .about-visual {
    aspect-ratio: 1 / 1;
    overflow: visible;   /* let the glow rings breathe outside the frame */
    margin: 0 auto 32px;
    max-width: 320px;    /* Don't let it become too huge on wide mobile screens */
    width: 80%;          /* Balanced width */
  }
  .about-visual-inner {
    overflow: visible;   /* don't clip the rotating ring pseudo-elements */
    border-radius: 50%;  /* round container matches the ring aesthetics */
    padding: 24px;
    box-shadow: 0 20px 50px rgba(184, 151, 42, 0.1);
  }
  /* Scale the rings up to fill the square container */
  .about-visual-inner::before {
    width: 95%;
    height: 95%;
  }
  .about-visual-inner::after {
    width: 80%;
    height: 80%;
  }
  /* Logo slightly larger to fill the square */
  .about-logo-img {
    width: 82%;
    filter: drop-shadow(0 8px 15px rgba(212,164,55,0.4));
  }
  /* Ensure corner brackets don't show on mobile (they clip awkwardly) */
  .about-visual::before,
  .about-visual::after {
    display: none;
  }
  /* Year badge — smaller & repositioned for square mobile layout */
  .about-year-badge {
    bottom: -10px;
    right: 50%;
    transform: translateX(50%); /* Center the badge under the logo */
    padding: 8px 16px;
    background: #000;
    min-width: 100px;
  }
  .about-year-badge .num   { font-size: 1.6rem; }
  .about-year-badge .label { font-size: 0.4rem; letter-spacing: 0.2em; }

  /* ── FOUNDER PORTRAIT MOBILE FIX ── */
  .founder-portrait {
    aspect-ratio: auto;
    max-width: 440px;
    margin: 0 auto;
    border-radius: 4px;
  }
  .founder-img {
    height: auto;
    object-fit: contain;
  }

  /* Portfolio overlays: always visible on mobile (no hover) */
  .portfolio-overlay {
    opacity: 1;
    background: linear-gradient(180deg, transparent 20%, rgba(0,0,0,0.80) 100%);
  }

  .portfolio-grid { grid-template-columns: 1fr; grid-auto-rows: 260px; }
  .portfolio-item:nth-child(n) { grid-column: span 1; grid-row: span 1; }

  .team-grid     { grid-template-columns: repeat(2, 1fr); }
  .form-grid     { grid-template-columns: 1fr; }
  .calc-row      { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }

  /* Floating buttons — icon-only on mobile so they never cover form submit */
  .floating-btns {
    bottom: 20px;
    right: 16px;
    gap: 10px;
  }
  .float-btn {
    padding: 13px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    justify-content: center;
  }
  .float-btn span { display: none; }

  /* ── BEFORE/AFTER MOBILE ── */
  .ba-visual { aspect-ratio: 1/1; }
  .ba-handle-circle { width: 40px; height: 40px; }
  .ba-arrows { font-size: 0.8rem; letter-spacing: 1px; }
  .ba-label { padding: 4px 8px; font-size: 0.45rem; bottom: 12px; }
  .ba-label-before { left: 12px; }
  .ba-label-after { right: 12px; }
}

/* ── SMALL MOBILE (≤ 480px) ── */
@media (max-width: 480px) {
  .metrics   { grid-template-columns: 1fr 1fr; }
  .team-grid { grid-template-columns: 1fr 1fr; }
}

/* ── TOUCH DEVICE — BUTTON FIX ── */
@media (hover: none) and (pointer: coarse) {
  /* Ensure no residual GSAP transforms on buttons */
  .btn-primary,
  .btn-ghost {
    transform: none !important;
    -webkit-transform: none !important;
  }

  /* Minimum 48px touch target height */
  .btn-primary,
  .btn-ghost {
    min-height: 48px;
    padding: 14px 32px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(212,164,55,0.15);
  }

  /* Hero actions stack vertically on mobile for easier tapping */
  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 0 24px;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    width: 100%;
    justify-content: center;
    max-width: 320px;
  }

  /* Floating buttons — ensure tap area */
  .float-btn {
    min-width: 48px;
    min-height: 48px;
  }

  /* Nav CTA */
  .nav-cta {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
