/* ===================================
   Responsive Design
   Mobile-first approach
   =================================== */

/* -------------------------------------------------------------------------
   1. Global Variables & Typography Adjustments
   ------------------------------------------------------------------------- */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
  :root {
    --font-size-h1: 3.5rem;
  }

  .hero-title {
    font-size: 4rem;
  }

  .section-lg {
    padding: var(--spacing-xxl) 0;
  }
}

/* Laptop / Small Desktop (1025px - 1199px) */
@media (max-width: 1199px) {
  :root {
    --font-size-h1: 3rem;
    --font-size-h2: 2.25rem;
  }

  .container {
    padding: 0 var(--spacing-md);
  }
}

/* Tablet landscape and small desktop (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {

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

/* Desktop Header Styles (min-width: 769px) */
@media (min-width: 769px) {
  .navbar-toggle {
    display: none;
  }

  .navbar-nav {
    position: static;
    width: auto;
    height: auto;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    overflow: visible;
    display: block;
    /* Or flex */
  }

  .nav-links-group {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: center;
  }

  .navbar-nav a {
    width: auto;
    padding: 0;
    border-bottom: none;
  }

  .navbar-brand {
    display: block;
  }

  .navbar-brand img {
    height: 70px;
    /* Larger logo on desktop */
    display: block;
  }

  .navbar-brand-mini {
    display: none !important;
  }
}

/* Tablet Landscape (769px - 1024px) */
@media (max-width: 1024px) {
  :root {
    --font-size-h1: 2.5rem;
    --font-size-h2: 2rem;
    --spacing-xl: 3rem;
  }

  /* Grid Adjustments */
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  /* Exclusive Page - Packages Grid on Tablet */
  .grid-3 .card[style*="transform: scale(1.05)"] {
    transform: scale(1) !important;
    /* Reset scale to avoid overlap */
    margin-top: 0;
  }
}

/* Tablet Portrait & Mobile (max-width: 768px) */
@media (max-width: 768px) {
  :root {
    --font-size-h1: 2rem;
    --font-size-h2: 1.75rem;
    --font-size-h3: 1.35rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 3rem;
  }

  /* -------------------------------------------------------------------------
     2. Layout & Grid System
     ------------------------------------------------------------------------- */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
    gap: var(--spacing-lg);
  }

  .container,
  .container-wide {
    padding: 0 var(--spacing-md);
  }

  .section {
    padding: var(--spacing-lg) 0;
  }

  .section-lg {
    padding: var(--spacing-xl) 0;
  }

  /* -------------------------------------------------------------------------
     3. Header & Navigation
     ------------------------------------------------------------------------- */
  .top-bar-content {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  .top-bar-left,
  .top-bar-right {
    justify-content: center;
    width: 100%;
  }

  .top-bar-right {
    display: none;
    /* Hide social icons on mobile to save space if needed, or keep */
  }

  /* Navigation Mobile */
  .navbar {
    padding: 1rem 0;
  }

  .navbar-toggle {
    display: block;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    color: var(--color-text-gray);
    font-size: 1.5rem;
    cursor: pointer;
    order: 1;
  }

  /* Hide large logo on mobile */
  .navbar-brand {
    display: none !important;
  }

  /* Show mini logo on mobile */
  .navbar-brand-mini {
    display: block !important;
    order: 2;
    margin-left: auto;
    margin-right: auto;
  }

  .navbar-brand-mini img {
    height: 40px !important;
  }

  .navbar-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    padding: 4rem var(--spacing-md);
    box-shadow: var(--shadow-lg);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }

  .navbar-nav.active {
    left: 0;
  }

  .nav-links-group {
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .navbar-nav a {
    display: block;
    width: 100%;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-light-gray);
    color: var(--color-text-dark);
    font-size: 1.1rem;
    text-decoration: none;
  }

  /* -------------------------------------------------------------------------
     4. Components
     ------------------------------------------------------------------------- */
  .btn {
    width: 100%;
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  /* -------------------------------------------------------------------------
     5. Page Specific Overrides
     ------------------------------------------------------------------------- */

  /* --- Mortgage Page --- */
  .mortgage-main-image,
  .mortgage-interior-image {
    border-radius: 15px;
    margin-bottom: 1.5rem;
  }

  #fcg-img {
    display: none;
    /* Hide floating elements on mobile */
  }

  .mortgage-caption-box {
    margin-top: 0;
    margin-bottom: 1.5rem;
  }

  /* --- Exclusive Page --- */
  /* Reset the "Premium" card scaling on mobile */
  .card[style*="transform: scale(1.05)"] {
    transform: scale(1) !important;
    border-width: 2px !important;
    margin: 1rem 0;
  }

  /* Ensure service lists look good */
  ul[style*="list-style: none"] li {
    font-size: 1rem;
  }

  /* --- Evaluation Page (Page 51) --- */
  /* The grid-2 collapse handles the layout, but let's ensure the QR container is centered */
  .page-id-51 .grid-2>div:last-child {
    order: -1;
    /* Show QR code first on mobile? Or keep as is. Let's keep as is. */
  }

  /* -------------------------------------------------------------------------
     6. Footer
     ------------------------------------------------------------------------- */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  footer .grid-2 {
    gap: 2rem !important;
  }

  footer iframe {
    height: 250px;
    /* Smaller map on mobile */
  }

  footer form {
    padding: 1.5rem !important;
  }

  /* Stack Name and Phone inputs on mobile */
  footer form>div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  footer input,
  footer textarea {
    width: 100% !important;
    box-sizing: border-box;
    /* Ensure padding doesn't overflow width */
  }
}

/* Mobile Small (max-width: 480px) */
@media (max-width: 480px) {
  :root {
    --font-size-h1: 1.75rem;
    --font-size-h2: 1.5rem;
    --spacing-md: 1rem;
  }

  .hero-title {
    font-size: 2rem !important;
  }

  .hero {
    min-height: 300px;
  }

  /* Adjust price badges */
  .price-badge-amount {
    font-size: 2.5rem !important;
  }
}

/* Print Styles */
@media print {

  .navbar,
  .footer,
  .btn,
  .navbar-toggle {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}