/* Iron Shore Roofing - Mobile-only visual pass (v6)
   Scoped entirely to max-width: 767px. Desktop styles are untouched.
   v6: removed rounded/gradient "bubbly" styling to match the site's
   existing flat, sharp-cornered desktop look. Fixed 3 grids that don't
   naturally collapse on mobile (products-grid, process-grid, and the
   unclassed "What Makes Us Different" image+content grid, tagged via JS
   as .ish-why-grid). Redesigned the process steps as a vertical stepper. */

#ish-mobile-cta-bar { display: none; }

@media (max-width: 767px) {

  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

  /* Horizontal-scroll bug: a second .hero-form-card (the "Get a Free
     Estimate" CTA section further down the page, not the hero) rendered at
     its 420px desktop width with no responsive constraint, pushing the page
     630px wide on a 390px screen. Constrain it, plus a safety-net clip on
     the root so no future stray element can force a horizontal scrollbar. */
  html, body { overflow-x: hidden; max-width: 100vw; }

  .hero-form-card {
    width: 100% !important;
    max-width: 420px;
    box-sizing: border-box;
  }

  /* ================= Tap targets & form usability ================= */
  a, button, .btn, .btn-primary, .btn-secondary, .btn-outline, input[type="submit"] {
    min-height: 44px;
  }

  input, select, textarea {
    font-size: 16px !important;
    min-height: 48px;
  }

  textarea { min-height: 96px; }

  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  /* ================= Top info strip: condense ================= */
  .topbar {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    font-size: 11px !important;
  }

  /* Topbar redesign: showing only the phone number left it looking like a
     bare, unbalanced strip. Bring back one more piece of desktop's trust
     info (licensed & insured) so the bar reads as intentional, condensed to
     fit two items side by side instead of just the phone floating alone. */
  .topbar .container { display: flex !important; }
  .topbar-items { display: flex !important; gap: 0; }
  .topbar-items > .topbar-item { display: none; }
  .topbar-items > .topbar-item:nth-of-type(3) {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    font-size: 11px;
  }
  .topbar-inner { min-height: 0; }
  .topbar-phone {
    font-size: 12px !important;
    line-height: 1.2 !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
  }

  /* Header logo: back on the left (centering it made the header worse --
     reverting to the standard logo-left, actions-right mobile pattern). */
  .main-nav .container {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .main-nav .nav-logo {
    display: flex;
    align-items: center;
  }
  .main-nav .nav-logo img {
    height: 44px !important;
    width: auto !important;
    max-width: none !important;
  }
  .main-nav .nav-links { display: none !important; }
  .main-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* Nav "Free Estimate" pill: previously inherited the site-wide mobile
     button padding (13px top/bottom sized for full-width form CTAs), which
     made it huge and wrapped "Free" and "Estimate" onto two lines. Compact,
     single-line pill sized for its actual context next to a logo + hamburger. */
  .main-nav .btn-sm {
    padding: 7px 12px !important;
    font-size: 11px !important;
    min-height: 32px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
  }

  /* ================= Sticky header: shadow once scrolled ================= */
  .main-nav {
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
    transition: padding 0.2s ease, box-shadow 0.2s ease;
  }

  body.ish-scrolled .main-nav {
    background-color: rgba(7,9,15,0.97) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.45);
  }

  /* ================= Buttons: sizing only, no radius/gradient ================= */
  .btn, .btn-primary, .btn-secondary, .btn-outline {
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .btn-primary:active, .btn-outline:active {
    opacity: 0.85;
  }

  /* ================= Hero ================= */
  .hero { position: relative; overflow: hidden; }

  .hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7,9,15,0.55) 0%, rgba(7,9,15,0.85) 70%, rgba(7,9,15,1) 100%);
    pointer-events: none;
  }

  .hero-inner { padding-top: clamp(20px, 5vw, 32px); padding-bottom: clamp(20px, 5vw, 32px); }

  .hero-content h1, section:first-of-type h1 {
    font-size: clamp(30px, 8.5vw, 42px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.01em;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
  }

  .hero-subtitle {
    font-size: 15.5px;
    line-height: 1.5;
  }

  .hero-badges {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .hero-form-card {
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.12) !important;
  }

  .hero-form-title { font-size: 19px; }

  /* ================= Section rhythm ================= */
  .section-padding {
    padding-top: clamp(36px, 9vw, 56px) !important;
    padding-bottom: clamp(36px, 9vw, 56px) !important;
  }

  .section-label {
    display: inline-block;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--color-primary, #1a5fd4);
    letter-spacing: 0.08em;
  }

  .section-title {
    font-size: clamp(24px, 7vw, 32px) !important;
    line-height: 1.15 !important;
  }

  .section-subtitle { font-size: 15px; line-height: 1.55; }

  /* ================= Cards: flat, bordered, no radius ================= */
  .service-card, .why-card, .product-card, .review-card {
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
  }

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

  .service-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary, #1a5fd4);
  }

  .card, [class*="card"] { padding: 16px !important; }

  /* ================= Stats bar ================= */
  .stat-value {
    font-size: clamp(24px, 7vw, 30px) !important;
  }

  .stat-label { font-size: 12px; letter-spacing: 0.03em; }

  /* ================= Grids: single column, comfortable gap ================= */
  .grid, [class*="grid-cols-2"], [class*="grid-cols-3"], [class*="grid-cols-4"],
  .products-grid, .process-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  form .form-row, form [class*="grid-cols-2"] { grid-template-columns: 1fr !important; }
  form label { font-size: 14px; }

  /* ================= "What Makes Us Different": image + content stack =================
     .ish-why-grid / .ish-why-imgcol / .ish-why-contentcol are tagged by mobile-cta.js
     since this section's wrapper divs ship with no class names to target. */
  .ish-why-grid {
    display: block !important;
  }

  .ish-why-imgcol {
    width: 100% !important;
    margin-bottom: 22px;
  }

  .ish-why-imgcol img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
  }

  .ish-why-contentcol { width: 100% !important; }

  /*                   "Serving All of Long Island": same classless        
     image+content grid disease as "What Makes Us Different" -- tagged via
     JS as .ish-areas-grid / .ish-areas-textcol / .ish-areas-imgcol. The
     town pill list (.area-towns) is already a flex-wrap row and just needed
     its parent column freed up to full width. */
  .ish-areas-grid { display: block !important; }
  .ish-areas-textcol { width: 100% !important; }
  .ish-areas-imgcol {
    width: 100% !important;
    margin-top: 22px;
  }
  .ish-areas-imgcol img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
  }
  .area-towns {
    margin-top: 14px;
  }
  .area-towns > * {
    font-size: 13px;
  }

  /*                   Bottom "Get a Free Roof Estimate Today" CTA: same     
     classless two-column grid (text + .hero-form-card) not collapsing on
     mobile, so the quote form was squeezed into a ~140px sliver with
     clipped fields. Tagged via JS as .ish-finalcta-grid /
     .ish-finalcta-textcol / .ish-finalcta-formcol. */
  .ish-finalcta-grid { display: block !important; }
  .ish-finalcta-textcol { width: 100% !important; }
  .ish-finalcta-formcol {
    width: 100% !important;
    margin-top: 28px;
  }

  /* The plain-text phone link next to "Request an Estimate" had no
     white-space control, so on narrow screens it wrapped mid-number --
     "(516)" on one line, "363-3622" on the next. Keep it intact. */
  .ish-finalcta-textcol a[href^="tel:"] {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
  }

  /* Prevent the stat numbers from jittering in width as they count up. */
  .stat-value { font-variant-numeric: tabular-nums; }

  .why-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .why-card:last-child { border-bottom: none; }

  .why-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary, #1a5fd4);
  }

  .why-icon svg { width: 18px; height: 18px; }

  /* ================= Process steps: vertical stepper ================= */
  .process-grid {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid rgba(26,95,212,0.35);
  }

  .process-step {
    position: relative;
    padding: 0 0 28px 0;
  }

  .process-step:last-child { padding-bottom: 0; }

  .process-number {
    position: absolute;
    left: -29px;
    top: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary, #1a5fd4);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
  }

  .process-step h3 {
    font-size: 16px;
    margin-bottom: 4px;
  }

  .process-step p {
    font-size: 14px;
    line-height: 1.5;
  }

  /* ================= Images ================= */
  .hero-bg img, .service-card-image, .nav-logo img, .mobile-menu-header img {
    display: block;
  }

  /* ================= Mobile nav menu ================= */
  .mobile-nav-links { padding-top: 8px; padding-bottom: 8px; }

  .mobile-nav-link {
    min-height: 48px;
    display: flex;
    align-items: center;
    font-size: 17px;
  }

  /* ================= Scroll-reveal micro-animation ================= */
  .ish-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .ish-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* ================= Sticky bottom CTA bar ================= */
  #ish-mobile-cta-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
    padding-bottom: env(safe-area-inset-bottom);
  }

  #ish-mobile-cta-bar a {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 58px;
    font-family: var(--font-heading, "Oswald", sans-serif);
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-decoration: none;
    border: none;
  }

  #ish-mobile-cta-bar .ish-cta-call {
    background: #12203f;
    color: #fff;
  }

  #ish-mobile-cta-bar .ish-cta-quote {
    background: var(--color-primary, #1a5fd4);
    color: #fff;
  }

  #ish-mobile-cta-bar svg { width: 18px; height: 18px; flex-shrink: 0; }
}
