/* ============================================================
   Pro ASIC Miner Repair LLC — responsive.css
   ============================================================ */

/* ============================================================
   18. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-bg); }
::-webkit-scrollbar-thumb { background: var(--gray-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-4); }


/* ============================================================
   19. FOCUS VISIBLE
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 3px;
}


/* ============================================================
   31. MOBILE BOTTOM PADDING (account for sticky CTA bar)
   ============================================================ */
@media (max-width: 768px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}


/* ============================================================
   49. ROUND 4 — INDUSTRIAL UI SYSTEM UPGRADE
   ============================================================ */

/* 2. Typography tightening */
h1 { letter-spacing: -0.03em; }
h2 { letter-spacing: -0.025em; }
h3 { letter-spacing: -0.015em; }
.section-eyebrow { letter-spacing: 0.15em; font-size: 0.7rem; text-transform: uppercase; }

/* 3. Button upgrades */
.btn { border-radius: var(--radius-md); letter-spacing: 0.01em; }
.btn-primary { box-shadow: 0 2px 0 rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.12); }
.btn-primary:hover { box-shadow: var(--glow-blue), 0 2px 0 rgba(0,0,0,0.25); }
.nav-cta-btn { box-shadow: 0 0 14px rgba(33,150,243,0.22); }
.nav-cta-btn:hover { box-shadow: 0 0 22px rgba(33,150,243,0.45); }

/* 4. Trust bar status strip */
.trust-bar {
  border-top: 1px solid rgba(33,150,243,0.12);
  border-bottom: 1px solid rgba(33,150,243,0.12);
}
.trust-item { border-right: 1px solid rgba(255,255,255,0.08); }
.trust-item:last-child { border-right: none; }

/* 7. Services glow on hover */
.services { background: #f2f4f8; }
.svc-card { border-top: 2px solid var(--gray-3); transition: transform var(--transition), box-shadow var(--transition), border-top-color var(--transition); }
.svc-card:hover {
  border-top-color: var(--blue-bright);
  box-shadow: 0 0 0 1px rgba(33,150,243,0.12), 0 8px 28px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.svc-card--featured { border-top-color: var(--blue) !important; }
.svc-card--featured:hover { box-shadow: 0 0 0 1px rgba(33,150,243,0.25), var(--glow-blue); }

/* 8. Fleet cards — command panel left accent */
.fleet-support {
  background: var(--gray-bg);
  border-top: 1px solid var(--gray-3);
  border-bottom: 1px solid var(--gray-3);
}
.fleet-card {
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition: transform var(--transition), box-shadow var(--transition), border-left-color var(--transition);
}
.fleet-card:hover {
  border-left-color: var(--blue-bright);
  box-shadow: -3px 0 0 var(--blue-bright), 0 6px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.fleet-tag { font-family: 'Courier New', monospace; font-size: 0.68rem; letter-spacing: 0.04em; }

/* 9. Dark section grid texture */
.asic-failures,
.case-reports,
.before-after,
.capabilities,
.estimator {
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 52px 52px;
}

/* 10. Failure cards glow */
.failure-card { transition: box-shadow var(--transition), border-color var(--transition); }
.failure-card:hover {
  box-shadow: var(--glow-blue);
  border-color: rgba(33,150,243,0.4);
}
.failure-label { font-family: 'Courier New', monospace; }

/* 11. Case reports terminal feel */
.case-reports { border-top: 1px solid rgba(33,150,243,0.12); }
.cr-card { background: rgba(255,255,255,0.035); transition: background var(--transition), box-shadow var(--transition), border-left-color var(--transition); }
.cr-card:hover {
  background: rgba(255,255,255,0.06);
  border-left-color: #64b5f6;
  box-shadow: -3px 0 0 #64b5f6, var(--glow-blue);
}
.cr-dt { font-family: 'Courier New', monospace; }
.cr-id { letter-spacing: 0.1em; }

/* 12. Before/After HUD numbers */
.ba-val { font-family: 'Courier New', monospace; letter-spacing: -0.02em; }
.ba-card { transition: box-shadow var(--transition); }
.ba-card:hover { box-shadow: var(--glow-blue); }

/* 13. Industrial CTA banner glow */
.cta-banner-industrial {
  border-top-color: rgba(33,150,243,0.4) !important;
  border-bottom-color: rgba(33,150,243,0.2) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

/* 14. Problem guide industrial list */
.pg-list {
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.pg-tag { border-radius: 2px; }
.pg-entry:hover .pg-title { color: var(--blue); }


/* 16. Workflow stepper glowing nodes */
.wfs-dot {
  box-shadow: 0 0 0 3px rgba(21,101,192,0.2), 0 0 18px rgba(33,150,243,0.4);
  background: linear-gradient(145deg, #1976d2, var(--blue));
}

/* 18. Emergency dispatch pulsing dot */
.ed-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ed-eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  min-width: 6px;
  background: #ef4444;
  border-radius: 50%;
  animation: ed-ping 2s ease-in-out infinite;
}
@keyframes ed-ping {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* 19. Contact form dark inputs */
#contact .form-field input,
#contact .form-field select,
#contact .form-field textarea {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.13);
  color: rgba(255,255,255,0.9);
  border-radius: var(--radius-sm);
}
#contact .form-field input::placeholder,
#contact .form-field textarea::placeholder { color: rgba(255,255,255,0.28); }
#contact .form-field input:focus,
#contact .form-field select:focus,
#contact .form-field textarea:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(33,150,243,0.15);
  background: rgba(255,255,255,0.09);
  outline: none;
}
#contact .form-field label { font-size: 0.78rem; letter-spacing: 0.02em; }
#contact select option { background: var(--navy); color: var(--white); }

/* 20. Footer deeper navy */
#site-footer { background: #060e1a; border-top: 1px solid rgba(33,150,243,0.1); }

/* 22. FAQ subtle terminal feel */
.faq-q { letter-spacing: -0.01em; font-size: 0.95rem; }

/* 23. Industrial scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #0a1628; }
::-webkit-scrollbar-thumb { background: rgba(33,150,243,0.35); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: rgba(33,150,243,0.6); }
* { scrollbar-width: thin; scrollbar-color: rgba(33,150,243,0.35) #0a1628; }

/* ============================================================
   50. ROUND 5 — CONVERSION UX UPGRADE
   ============================================================ */


/* Contact section heading conversion emphasis */
#contact .section-header { padding-bottom: 0.5rem; }
#contact h2 { font-size: clamp(1.55rem, 3.5vw, 2.15rem); }

/* Emergency note — red accent for conversion */
.emergency-note {
  border-left: 3px solid #dc2626;
  background: rgba(220,38,38,0.07);
}
.en-label {
  color: #ef4444;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

/* Fleet note — blue accent */
.contact-fleet-note {
  border-left: 3px solid var(--blue);
  background: rgba(21,101,192,0.06);
}

/* Form submit button — full conversion emphasis */
#form-submit {
  background: linear-gradient(135deg, #1565c0, #1976d2);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(21,101,192,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: box-shadow var(--transition), transform var(--transition), background var(--transition);
}
#form-submit:hover {
  background: linear-gradient(135deg, #1976d2, #1e88e5);
  box-shadow: 0 6px 24px rgba(21,101,192,0.5), var(--glow-blue);
  transform: translateY(-1px);
}

/* Popup — conversion emphasis */
.popup-tag {
  background: rgba(220,38,38,0.12);
  color: #f87171;
  border: 1px solid rgba(220,38,38,0.2);
  font-weight: 700;
  letter-spacing: 0.06em;
}
#popup-cta1 {
  background: linear-gradient(135deg, #1565c0, #1976d2);
  box-shadow: 0 3px 12px rgba(21,101,192,0.35);
}
#popup-cta1:hover {
  box-shadow: 0 4px 18px rgba(21,101,192,0.5);
  transform: translateY(-1px);
}

/* FAB dispatch button — urgency red dot indicator */
.fab--schedule { position: relative; }
.fab--schedule::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid var(--blue);
  animation: fab-ping 2.5s ease-in-out infinite;
}
@keyframes fab-ping {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Mobile: larger hero CTAs */
@media (max-width: 640px) {
  .hero-ctas .btn { width: 100%; text-align: center; justify-content: center; }
  .hero-ctas { gap: 0.75rem; }
}

/* CTA bar — stronger emphasis text */
.cta-bar-inner strong { color: #fbbf24; }
.cta-bar-inner .btn { font-weight: 700; }

/* CTA bar — visual separation from adjacent dark sections */
.cta-bar {
  background: linear-gradient(90deg, rgba(13,45,78,0.97), rgba(9,34,62,0.99)) !important;
  border-top: 1px solid rgba(33,150,243,0.28) !important;
  border-bottom: 1px solid rgba(33,150,243,0.22) !important;
}
.cta-bar p { color: rgba(255,255,255,0.88); }


/* ============================================================
   53. MOBILE FOOTER — COMPACT 2-COLUMN LAYOUT
   ============================================================ */
@media (max-width: 640px) {
  .footer-inner {
    padding-top: 1.75rem !important;
    padding-bottom: 1.75rem !important;
    gap: 1.5rem !important;
  }

  /* Override footer.css ≤480px flex-direction:column */
  .footer-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem 2rem !important;
  }

  /* Legal column spans both grid columns */
  .fn-col:last-child {
    grid-column: 1 / -1;
  }

  /* Legal links in a compact horizontal row */
  .fn-col:last-child ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.3rem 1.1rem !important;
  }

  /* Smaller social buttons on mobile */
  .fsoc-link {
    font-size: 0.65rem;
    padding: 0.18rem 0.48rem;
    gap: 0.28rem;
  }

  .footer-social {
    gap: 0.28rem;
    margin-top: 0.8rem;
  }
}


/* ============================================================
   MOBILE CTA BAR — FINAL OVERRIDE (must stay last)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    /* Compact bar: 52px keeps a comfortable ≥44px tap target while being
       noticeably thinner than the previous 64px. */
    --mobile-cta-height: 52px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    /* Set live by the visualViewport fallback in main.js. Default 0 so the
       bar behaves normally before JS runs and on non-iOS browsers. */
    --ios-viewport-bottom-offset: 0px;
  }

  html,
  body {
    overflow-x: hidden;
  }

  /* Reserve the bar height + safe area + a small gap ONLY on pages that
     actually render the CTA bar — otherwise confirmation pages without the
     bar would show a phantom blank/dark strip at the bottom. */
  body:has(.mobile-cta-bar) {
    padding-bottom: calc(var(--mobile-cta-height) + 0.9rem + constant(safe-area-inset-bottom)) !important; /* iOS 11.0–11.2 */
    padding-bottom: calc(var(--mobile-cta-height) + 0.9rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-cta-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    /* Pin to the VISIBLE viewport bottom. On iOS Safari this offset tracks
       the dynamic toolbar (set by main.js); 0 everywhere else. */
    bottom: var(--ios-viewport-bottom-offset, 0px) !important;
    z-index: 9000 !important;

    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;

    min-height: calc(var(--mobile-cta-height) + constant(safe-area-inset-bottom)) !important; /* iOS 11.0–11.2 */
    min-height: calc(var(--mobile-cta-height) + env(safe-area-inset-bottom, 0px)) !important;
    /* No padding on the bar itself — each button's own colored background
       fills the safe-area zone so no mismatched strip shows below them. */
    padding-bottom: 0 !important;

    background: #0b1f3a !important;
    border-top: 1px solid rgba(255,255,255,0.14) !important;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.28) !important;

    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .mobile-cta-bar .mcta-btn {
    /* Button height includes the safe-area inset so each button's own
       background extends to the very bottom edge of the screen. */
    min-height: calc(var(--mobile-cta-height) + constant(safe-area-inset-bottom)) !important; /* iOS 11.0–11.2 */
    min-height: calc(var(--mobile-cta-height) + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.3rem !important;
    padding: 0.4rem 0.4rem !important;
    /* Extra bottom padding lifts the icon/label above the home indicator. */
    padding-bottom: calc(0.4rem + constant(safe-area-inset-bottom)) !important; /* iOS 11.0–11.2 */
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px)) !important;

    font-size: 0.76rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    white-space: nowrap !important;
  }

  /* Slightly shrink the emoji icon so the row reads as a thin, tidy bar. */
  .mobile-cta-bar .mcta-btn > span[aria-hidden="true"] {
    font-size: 0.95em !important;
    line-height: 1 !important;
  }

  .mobile-cta-bar .mcta-whatsapp {
    background: #22c55e !important;
  }

  .mobile-cta-bar .mcta-request {
    background: #1565c0 !important;
  }

  .mobile-cta-bar .mcta-bookcall,
  .mobile-cta-bar .mcta-email,
  .mobile-cta-bar .mcta-text {
    background: #0b1f3a !important;
    border-left: 1px solid rgba(255,255,255,0.12) !important;
  }

  body.popup-open .mobile-cta-bar {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .mobile-cta-bar {
    display: none !important;
  }
}


/* ============================================================
   ENTERPRISE PRICING — MOBILE 2-COLUMN LISTS (must stay last)
   ============================================================ */
@media (max-width: 768px) {
  .price-card--enterprise .pce-factors,
  .price-card--enterprise .pce-services {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.35rem 0.65rem !important;
    align-items: start !important;
  }

  .price-card--enterprise .pce-factors li,
  .price-card--enterprise .pce-services li {
    font-size: 0.7rem !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    white-space: normal !important;
  }

  .price-card--enterprise .pce-pricing,
  .price-card--enterprise .pce-right {
    overflow: visible !important;
  }
}


/* ============================================================
   SECONDARY PAGE MOBILE IMPROVEMENTS
   Applies globally to all secondary/service-area pages.
   Must come after enterprise pricing override.
   ============================================================ */

/* Better section rhythm on small screens */
@media (max-width: 768px) {

  /* Service-area sections: more breathing room */
  .sa-section { padding: 2.25rem 0; }
  .sa-section h2 { font-size: clamp(1.2rem, 5vw, 1.5rem); }
  .sa-section-sub { font-size: 0.88rem; line-height: 1.75; margin-bottom: 1.25rem; }

  /* Breadcrumb: better wrapping on narrow screens */
  .sa-breadcrumb { overflow-x: visible; }
  .sa-bc-list {
    flex-wrap: wrap;
    white-space: normal;
    overflow-x: visible;
    gap: 0.25rem;
    font-size: 0.74rem;
  }

  /* Service area pricing card: better tap targets */
  .sa-pricing-box {
    border-radius: 8px;
    padding: 1.25rem;
  }

  /* FAQ accordion: larger tap targets, better spacing */
  .sa-faq-q {
    padding: 0.95rem 1rem;
    font-size: 0.86rem;
    min-height: 50px;
    line-height: 1.45;
  }
  .sa-faq-a {
    padding: 0.75rem 1rem 1rem;
    font-size: 0.83rem;
    line-height: 1.72;
  }
  .sa-faq-icon { font-size: 1rem; }

  /* Service overview cards: tighter on small screens */
  .sa-ov-card { padding: 0.85rem; }

  /* Nearby cities: better wrap */
  .sa-nearby-grid { gap: 0.4rem; }
  .sa-nearby-link { font-size: 0.79rem; padding: 0.32rem 0.7rem; }

  /* Coverage chips: touch-friendly */
  .about-state-chip { min-height: 34px; }
}

/* ============================================================
   TABLET VIEWPORT — 769px to 1024px
   Surface Pro 9 (912px), iPad landscape, mid-size tablets.
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Pull floating buttons slightly in and scale down to
     reduce right-edge overlap risk on medium-width viewports */
  .floating-btns {
    right: 1rem;
    bottom: 5rem;
    transform: scale(0.9);
    transform-origin: right bottom;
  }
}


/* Extra-narrow screens: 360–430px */
@media (max-width: 430px) {

  .sa-section { padding: 1.75rem 0; }

  /* Pricing box: full column, no flex side-by-side */
  .sa-pricing-box {
    flex-direction: column;
    gap: 1rem;
    padding: 1.1rem;
  }
  .sa-pricing-actions {
    width: 100%;
    flex-direction: column !important;
    gap: 0.55rem;
  }
  .sa-pricing-actions .btn {
    width: 100% !important;
    min-height: 48px;
    font-size: 0.88rem;
  }

  /* Service overview grid: keep 2-col but tighter */
  .sa-ov-grid { gap: 0.55rem; }
  .sa-ov-card-body { font-size: 0.72rem; }

  /* About page sections */
  .about-section { padding: 2rem 0; }
  .about-cta-banner { padding: 2.25rem 0 4rem; }
}


/* ============================================================
   UTILITY: PC / Mobile CTA visibility split
   ============================================================ */
.desktop-only {
  display: inline-flex;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

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


/* ============================================================
   MOBILE BACK-TO-TOP
   JS moves #scroll-top-btn to <body> on mobile so it is not
   hidden by .floating-btns { display: none !important }.
   These rules give it an independent fixed position above the
   mobile CTA bar.
   ============================================================ */
@media (max-width: 768px) {
  #scroll-top-btn {
    position: fixed;
    right: 0.85rem;
    /* Sit ~12px above the (now more compact) CTA bar, and track the same
       iOS visual-viewport offset so it never detaches from the bar. */
    bottom: calc(var(--mobile-cta-height) + 12px + env(safe-area-inset-bottom, 0px) + var(--ios-viewport-bottom-offset, 0px));
    width: 42px;
    height: 42px;
    z-index: 8990;
    transform: translateY(8px);
  }

  #scroll-top-btn.visible {
    transform: translateY(0);
  }

  #scroll-top-btn .fab-tooltip {
    display: none;
  }

  body.popup-open #scroll-top-btn {
    display: none !important;
  }
}
