/* ==========================================
   Turn Ready Property Services
   responsive.css - Comprehensive Mobile & Tablet Breakpoints
   Visual Source of Truth for Homepage & Subpages
   ========================================== */

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

/* ==========================================
   1. TABLET / MID-WIDTH (max-width: 900px)
   ========================================== */
@media (max-width: 900px) {

  /* Section Padding */
  .section,
  section {
    padding: 60px 0;
  }

  .standard-layout,
  .estimate-layout,
  .footer-layout {
    padding: 60px 0;
  }

  /* Grid Layouts at Tablet */
  .service-grid,
  .service-grid-layout,
  #services .service-grid,
  #why-us .service-grid,
  #promotions .service-grid,
  #reviews .service-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .section-heading-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .standard-layout,
  .about-layout,
  .faq-layout,
  .estimate-layout,
  .service-content-grid {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
  }

  .service-sidebar {
    position: static;
    width: 100%;
  }
}

/* ==========================================
   2. MOBILE STRUCTURAL & NAVIGATION (max-width: 768px)
   ========================================== */
@media (max-width: 768px) {

  /* Global Container Safety */
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* Announcement Bar */
  .announcement {
    font-size: 10px;
    padding: 8px 12px;
    line-height: 1.4;
    word-break: break-word;
  }

  /* Header & Navigation */
  .navbar .container {
    height: 70px;
    padding-left: 16px;
    padding-right: 16px;
    position: relative;
  }

  .logo > img,
  .header-logo-img {
    height: 44px !important;
    max-height: 44px !important;
    width: auto !important;
  }

  /* Show Hamburger Toggle Button */
  .nav-toggle,
  .menu-button {
    display: flex !important;
  }

  /* Convert Nav Links to Mobile Dropdown Menu */
  .nav,
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 20px 24px;
    gap: 6px;
    border-bottom: 3px solid var(--green);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
  }

  .nav.open,
  .nav-links.open {
    display: flex !important;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--charcoal);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: var(--slate-bg);
    color: var(--navy);
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links a.nav-call {
    background: var(--navy);
    color: #ffffff !important;
    justify-content: center;
    margin-top: 8px;
    min-height: 46px;
  }

  /* Hero Section Stacking (Homepage) */
  .hero {
    min-height: auto;
    padding: 32px 0;
  }

  .hero .hero-grid,
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
  }

  .hero-content {
    order: 1;
    text-align: left;
  }

  .hero h1 {
    font-size: clamp(30px, 7.5vw, 44px);
    line-height: 1.12;
    margin-bottom: 14px;
  }

  .hero-content p,
  .hero-text {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
  }

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

  .hero-buttons .btn,
  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .hero-image {
    order: 2;
    width: 100%;
    min-height: 220px;
    max-height: 360px;
    height: auto;
    aspect-ratio: 16 / 10;
  }

  /* Service & Location Subpage Header Banner */
  .service-header-banner {
    padding: 32px 0 !important;
    text-align: left;
    width: 100% !important;
    box-sizing: border-box;
  }

  .service-header-banner h1 {
    font-size: clamp(26px, 7vw, 36px) !important;
    line-height: 1.2 !important;
    margin-bottom: 12px !important;
  }

  .service-header-banner p {
    font-size: 15px !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
  }

  .service-header-actions {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .service-header-actions .btn {
    width: 100% !important;
    min-height: 48px;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }

  /* Subpage Content + Sidebar Layout Stacking */
  .service-content-section {
    padding: 36px 0 !important;
    width: 100% !important;
  }

  .service-content-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    width: 100% !important;
  }

  .service-main-content {
    width: 100% !important;
    min-width: 0 !important;
  }

  .service-main-content img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: var(--radius);
  }

  .service-sidebar {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    margin-top: 16px !important;
  }

  .sidebar-card {
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Service CTA Block (Bottom of Subpages) */
  .service-cta-block {
    padding: 32px 20px !important;
    margin-top: 36px !important;
    text-align: center;
    width: 100% !important;
    box-sizing: border-box;
  }

  .service-cta-block h2 {
    font-size: clamp(22px, 6vw, 30px) !important;
    margin-bottom: 12px !important;
  }

  .service-cta-block p {
    font-size: 15px !important;
    margin-bottom: 20px !important;
  }

  .service-cta-block .btn {
    width: 100% !important;
    min-height: 48px;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Trust Row */
  .trust-row,
  .trust-row-layout {
    grid-template-columns: 1fr;
    padding: 16px 20px;
    min-height: auto;
  }

  .trust-row span {
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 0;
  }

  .trust-row span:last-child {
    border-bottom: 0;
  }

  /* Service Regions Grid */
  #areas .container > div[style*="grid"],
  .service-regions-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Footer Layout */
  footer {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 44px 20px;
  }

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

  footer > p,
  footer > small {
    text-align: left;
  }
}

/* ==========================================
   3. MOBILE SINGLE-COLUMN GRIDS (max-width: 600px)
   ========================================== */
@media (max-width: 600px) {

  /* Force 1 Column on All Key Cards & Sections */
  .service-grid,
  .service-grid-layout,
  #services .service-grid,
  #why-us .service-grid,
  #promotions .service-grid,
  #reviews .service-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .service-card {
    width: 100%;
    padding: 24px 20px;
    box-sizing: border-box;
  }

  /* Subpage Checklist Grid */
  .checklist-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .checklist-item {
    padding: 14px 16px;
    font-size: 14px;
    box-sizing: border-box;
  }

  /* Estimator & Step Form 1 Column */
  #estimate-form .container,
  .estimate-layout,
  .step-form {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 16px !important;
    box-sizing: border-box;
  }

  .step-grid,
  .addon-grid,
  .contact-fields,
  form {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .step-grid .wide-field,
  .step-grid label,
  .contact-fields label,
  .addon-grid label {
    grid-column: 1 / -1 !important;
    width: 100%;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    box-sizing: border-box;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
  }

  .marketing-optin {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    grid-column: 1 / -1 !important;
    padding: 12px 14px !important;
    box-sizing: border-box !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    background: #ffffff !important;
    cursor: pointer;
    margin: 0 !important;
  }

  .marketing-optin input,
  .marketing-optin input[type="checkbox"] {
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    flex: 0 0 18px !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 3px !important;
    accent-color: var(--navy);
    box-sizing: border-box !important;
    cursor: pointer;
  }

  .marketing-optin span {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    color: var(--charcoal) !important;
    font-weight: 600 !important;
  }

  .marketing-optin small {
    display: block !important;
    margin-top: 2px !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    color: var(--slate-body) !important;
    line-height: 1.4 !important;
  }

  .step-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .step-actions .button,
  .calculate-button,
  .contact-fields button {
    width: 100% !important;
    min-height: 48px;
    justify-content: center;
  }

  .form-step > legend {
    font-size: 22px;
  }

  .addons {
    padding: 16px;
  }

  .estimate-result {
    padding: 20px 16px;
  }

  .estimate-result strong {
    font-size: clamp(32px, 8vw, 44px);
  }
}

/* ==========================================
   4. SMALL PHONE REFINEMENTS (max-width: 480px)
   ========================================== */
@media (max-width: 480px) {
  .announcement {
    font-size: 9.5px;
    padding: 6px 10px;
  }

  .site-header {
    padding: 0;
  }

  .hero h1 {
    font-size: clamp(26px, 8vw, 36px);
  }

  .section-heading h2,
  #services h2,
  #why-us h2,
  #reviews h2,
  #faq h2,
  #estimate h2 {
    font-size: clamp(24px, 7vw, 34px);
  }

  .service-card h3 {
    font-size: 19px;
  }
}
