/* Shared final overrides. Keep after the page's existing styles. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* clip does not create the extra scroll container that breaks sticky headers. */
body { min-width: 0; overflow-x: clip; }
.wrap, .nav, main, section, article, .contact, .contact-box, .estimate-panel,
.hero-grid > *, .two-col > *, .cards > *, .related > *, .form > * { min-width: 0; }
h1, h2, h3, p, .btn, .contact-link, .service-link, .related a {
  overflow-wrap: break-word;
}
.btn, .service-link, .related a { max-width: 100%; white-space: normal; }
.nav .brand { min-width: 0; flex-shrink: 1; }
.brand-logo { max-width: 100%; }
/* The same two fixed controls stay at the upper right on every page. */
body { padding-bottom: 0; }
.floating-actions {
  position: fixed; inset: auto;
  top: calc(88px + env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: auto; left: auto; z-index: 25;
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 8px; width: min(238px, calc(100vw - 32px));
  margin: 0; padding: 0; background: none; border: 0;
}
.floating-actions a {
  display: flex; min-width: 0; max-width: 100%; min-height: 50px;
  line-height: 1.3; padding: 11px 16px; overflow-wrap: break-word;
  transition: filter .18s ease;
}
.floating-actions a:hover { transform: none; }
.floating-phone { font-size: 14px; }
.floating-estimate { font-size: 14px; }
.mobile-action-bar { display: none; }
@media (max-width: 700px) {
  .floating-actions {
    top: calc(76px + env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    width: min(180px, calc(100vw - 20px)); gap: 6px;
  }
  .floating-actions a { min-height: 44px; padding: 9px 12px; }
  .floating-phone, .floating-estimate { font-size: 12px; }
}
.contact { gap: 28px; }
.contact-box h2 { font-size: clamp(26px, 3vw, 38px); overflow-wrap: normal; word-break: normal; }
.contact-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-link {
  min-width: 0; max-width: 100%; min-height: 56px; padding: 12px;
  border-radius: 16px; line-height: 1.35; font-size: 16px;
  text-align: center; overflow-wrap: anywhere;
}
.contact-detail { min-width: 0; padding: 14px; gap: 10px; }
.contact-detail > div { min-width: 0; }
.contact-detail a { overflow-wrap: anywhere; }
.form label { min-width: 0; }
.selected-files li { overflow-wrap: anywhere; }
.form input, .form select, .form textarea {
  min-width: 0; max-width: 100%; font-size: 16px; line-height: 1.4;
}
.form input[type="file"] { padding: 10px; }
.form input[type="file"]::file-selector-button {
  max-width: 100%; padding: 8px 10px; white-space: normal; font: inherit;
}
.form button { max-width: 100%; white-space: normal; }
@media (max-width: 1280px) {
  .contact { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1120px) {
  .navlinks { display: none; }
  .navlinks.open { display: flex; }
  .mobile-service-dropdown { display: block; }
  .nav > .btn { display: none; }
}
@media (max-width: 1024px) {
  .hero-grid, .two-col { grid-template-columns: minmax(0, 1fr); }
  .service-hero h1 { font-size: clamp(30px, 6vw, 54px); }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 28px); }
  .nav { gap: 12px; min-height: 64px; }
  .brand-logo { width: clamp(140px, 48vw, 220px); height: auto; max-height: 60px; }
  .hero { min-height: auto; background-size: cover; background-position: center; }
  .hero-content { width: 100%; padding: 46px 0; }
  .hero:before { background: linear-gradient(90deg,rgba(20,10,6,.88),rgba(20,10,6,.70)); }
  .hero h1 { font-size: clamp(30px, 8.6vw, 44px); line-height: 1.12; }
  .hero p { font-size: 17px; }
  .section { padding: 44px 0; }
  .contact { padding: 14px; gap: 20px; border-radius: 20px; }
  .contact-box { padding: 20px; }
  .estimate-panel { padding: 4px; }
  .estimate-panel h2 { font-size: clamp(27px, 7vw, 36px); }
  .form, .services, .cards, .related, .steps { grid-template-columns: minmax(0, 1fr); }
  .form button { width: 100%; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; }
  .service-link { width: auto; }
  .work-head .btn { flex: initial; }
  .foot { flex-wrap: wrap; }
  .mobile-service-dropdown .dropdown-menu {
    position: fixed; top: 65px; left: 12px; right: 12px; width: auto;
    max-height: calc(100dvh - 82px); overflow-y: auto;
  }
}
@media (max-width: 600px) {
  .contact-details { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .contact-links { grid-template-columns: minmax(0, 1fr); }
  .brand-logo { width: 155px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
}

/* Keep both actions visible while a form field is focused. */
body:has(#estimate-form:focus-within) .floating-actions,
.is-editing-form .floating-actions { display: grid; }
@media (max-width: 380px) {
  .floating-actions { gap: 8px; }
  .floating-phone { flex-wrap: wrap; gap: 3px; font-size: 12px; }
  .floating-estimate { font-size: 12px; }
}
