/**
 * DA Renovation - Complete Mobile Responsive Stylesheet
 * Handcrafted for Architecture, Interior & Landscape Design Studio
 * Breakpoints:
 *   - Desktop & Large Displays: min-width: 993px
 *   - Tablets & Landscape Mobile: max-width: 992px
 *   - Mobile Devices: max-width: 768px
 *   - Small Phones (iPhone SE, Galaxy): max-width: 480px
 */

/* ==========================================================================
   1. GLOBAL MOBILE SAFETY & ANTI-OVERFLOW
   ========================================================================== */
html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   2. DESKTOP SCREENS (min-width: 993px)
   ========================================================================== */
@media (min-width: 993px) {
  .hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    align-items: center;
  }

  .about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
  }

  .consult-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: flex-start;
  }

  .desktop-only {
    display: inline-flex !important;
  }

  .mobile-menu-toggle {
    display: none !important;
  }
}

/* ==========================================================================
   3. TABLETS & LANDSCAPE MOBILE (max-width: 992px)
   ========================================================================== */
@media (max-width: 992px) {
  .desktop-nav {
    display: none !important;
  }

  .mobile-menu-toggle {
    display: inline-flex !important;
  }

  .desktop-only {
    display: none !important;
  }

  .hero-grid,
  .about-grid,
  .consult-grid {
    display: flex;
    flex-direction: column;
    gap: 36px;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 28px;
  }

  .stat-item:nth-child(2) {
    border-right: none;
  }

  .stat-item:nth-child(3) {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
  }

  .process-step-card {
    grid-template-columns: 60px 1fr 160px;
    gap: 18px;
    padding: 20px;
  }
}

/* ==========================================================================
   4. MOBILE DEVICES (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --container-padding: 16px;
  }

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

  /* Topbar Mobile: Single Clean Horizontal Row */
  .site-topbar {
    padding: 7px 0;
  }

  .topbar-container {
    width: 100%;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  .topbar-left,
  .topbar-right {
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }

  .topbar-phone {
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }

  .topbar-wa {
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }

  /* Grid Reductions */
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  /* Service Shortcuts: Elegant 2x2 grid on mobile */
  .service-shortcuts-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .service-shortcut-card {
    padding: 14px 10px !important;
  }

  .service-shortcut-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.15rem !important;
    margin-bottom: 8px !important;
  }

  .service-shortcut-card h4 {
    font-size: 0.85rem !important;
  }

  /* Hero Section */
  .hero-section {
    padding: 2.2rem 0 3rem;
  }

  .hero-visual-duo {
    flex-direction: column-reverse;
    align-items: center;
    gap: 16px;
    width: 100%;
  }

  .hero-founder-card,
  .hero-villa-card {
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 !important;
  }

  .hero-villa-card img {
    height: 260px !important;
  }

  .hero-founder-img img {
    height: 220px !important;
  }

  .hero-image-wrapper img {
    height: 280px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 12px 20px;
  }

  /* Typography Scaling */
  h1 {
    font-size: clamp(2rem, 7vw, 2.6rem) !important;
    line-height: 1.18 !important;
  }

  h2 {
    font-size: clamp(1.75rem, 5.5vw, 2.2rem) !important;
    line-height: 1.25 !important;
  }

  p {
    font-size: 0.95rem;
  }

  /* Section Spacing */
  .py-20 {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }

  .py-16 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  .py-12 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* Form Elements: Minimum 16px to prevent iOS Safari auto-zoom */
  input,
  select,
  textarea {
    font-size: 16px !important;
    padding: 12px 14px !important;
    width: 100%;
  }

  .btn {
    padding: 12px 22px;
    font-size: 0.85rem;
  }

  /* Stat Counter Bar */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 24px;
    column-gap: 16px;
  }

  .stat-number {
    font-size: 2.2rem;
  }

  /* Process Steps Card */
  .process-step-card {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    padding: 20px 16px !important;
    text-align: center;
  }

  .process-step-card > div:last-child {
    width: 100% !important;
    height: 180px !important;
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .process-step-card > div:last-child img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* CTA Banner */
  .cta-banner {
    padding: 2.5rem 1.5rem;
  }

  /* Floating Buttons */
  .whatsapp-floating {
    bottom: 16px;
    left: 16px;
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }

  .scroll-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }

  /* Universal Footer Bottom */
  .site-footer {
    padding-top: 3.5rem !important;
  }

  .site-footer .container.py-16 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
  }
}

/* ==========================================================================
   5. SMALL PHONES (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
  /* Top Announcement Bar */
  .site-topbar {
    font-size: 0.75rem;
    padding: 6px 0;
  }

  .site-topbar a {
    font-size: 0.75rem;
  }

  .site-header nav {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  .site-header img {
    height: 42px !important;
    max-width: 170px !important;
  }

  /* Stat Grid Single Column */
  .stat-grid {
    grid-template-columns: repeat(1, 1fr);
    row-gap: 16px;
  }

  .stat-item {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 16px;
  }

  .stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  /* Filter Navigation Pills */
  .filter-nav {
    gap: 6px;
    margin-bottom: 1.8rem;
  }

  .filter-btn {
    padding: 7px 14px;
    font-size: 0.75rem;
  }

  .cta-banner {
    padding: 2rem 1.25rem !important;
    border-radius: var(--radius-lg);
  }

  .cta-banner h2 {
    font-size: 1.65rem !important;
  }
}

/* ==========================================================================
   6. MOBILE NAVIGATION DRAWER & OVERLAY
   ========================================================================== */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 35, 33, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 360px;
  height: 100%;
  background: #FFFFFF;
  z-index: 1060;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.active {
  transform: translateX(0);
}

.mobile-drawer-close {
  align-self: flex-end;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--color-charcoal);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.mobile-drawer .nav-link {
  font-size: 1.15rem;
  font-weight: 600;
  padding: 10px 0;
  display: block;
  border-bottom: 1px solid var(--color-border);
}

/* Responsive Dual WhatsApp & Topbar Polish */
@media (max-width: 640px) {
  .topbar-container {
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    row-gap: 4px !important;
  }
  .topbar-left, .topbar-right {
    gap: 6px !important;
  }
  .topbar-phone, .topbar-wa {
    font-size: 0.74rem !important;
  }
  .wa-popup-menu {
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    bottom: 84px !important;
  }
}
@media (max-width: 400px) {
  .topbar-phone, .topbar-wa {
    font-size: 0.68rem !important;
  }
}

/* Mobile Floating WhatsApp & Scroll-to-Top Non-Overlapping Polish */
@media (max-width: 640px) {
  .whatsapp-floating {
    bottom: 16px !important;
    left: 14px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 1.35rem !important;
    z-index: 999 !important;
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.45) !important;
  }
  .scroll-to-top {
    bottom: 16px !important;
    right: 14px !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 0.95rem !important;
  }
  .wa-popup-menu {
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
    bottom: 74px !important;
    border-radius: 16px !important;
  }
}
