/* ==========================================================================
   DRONECENTRAL v15 — Mobile, modal, hamburger, audience grid, image-fallback
   This layer is LOADED AFTER dronecentral.css and overrides / extends it.
   ========================================================================== */

/* ---------- 1. Image fallback placeholder ---------- */
img.img-broken,
.product-card img.img-broken,
.pd-gal-stage img.img-broken {
  background: linear-gradient(135deg, #EEF2F8 0%, #E1E7F0 100%);
  object-fit: contain;
  padding: 24px;
}

/* ---------- 2. MODAL / DIALOG SYSTEM ---------- */
/* Works for exit-intent, quote forms, drone matcher overlays */
.dc-modal,
.ex-modal,
.pd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 21, 38, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: dcModalFade 0.2s ease-out;
}
.dc-modal.is-open,
.ex-modal.is-open,
.pd-lightbox.is-open {
  display: flex;
}
@keyframes dcModalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dc-modal-card,
.ex-modal .ex-card,
.pd-lightbox > .pd-gal-stage,
.pd-lightbox > .pd-lb-body {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(2, 84, 146, 0.24), 0 10px 30px rgba(2, 84, 146, 0.1);
  max-width: min(640px, 94vw);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 36px 32px;
  animation: dcModalRise 0.28s cubic-bezier(.2,.9,.3,1);
}
@keyframes dcModalRise {
  from { transform: translateY(18px) scale(.98); opacity: .4; }
  to { transform: none; opacity: 1; }
}
.dc-modal-close,
.ex-modal .ex-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 38px; height: 38px;
  border: none;
  background: #F7F9FC;
  border-radius: 50%;
  font-size: 20px;
  color: #6C7C92;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.dc-modal-close:hover,
.ex-modal .ex-close:hover {
  background: #EEF2F8;
  color: #0A1526;
  transform: rotate(90deg);
}

/* Mobile modal: full-width sheet */
@media (max-width: 640px) {
  .dc-modal,
  .ex-modal,
  .pd-lightbox {
    align-items: flex-end;
    padding: 0;
  }
  .dc-modal-card,
  .ex-modal .ex-card {
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    max-height: 88vh;
    padding: 28px 22px 36px;
  }
  .dc-modal-close,
  .ex-modal .ex-close {
    top: 10px; right: 10px;
  }
}

/* ---------- 3. Exit-intent modal refinement ---------- */
.ex-modal { display: none; }
.ex-modal.is-open { display: flex; }
.ex-modal .ex-card h3 { font-size: 24px; margin-bottom: 8px; line-height: 1.2; }
.ex-modal .ex-card p { font-size: 14.5px; color: #6C7C92; margin-bottom: 20px; }
.ex-modal .ex-f {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ex-modal .ex-f input[type="email"] {
  flex: 1; min-width: 200px;
  padding: 14px 16px;
  border: 1.5px solid #CFD7E3;
  border-radius: 10px;
  font-size: 15px;
}
.ex-modal .ex-f input:focus {
  outline: none;
  border-color: #0096D4;
  box-shadow: 0 0 0 3px rgba(0,150,212,.15);
}
.ex-modal .ex-f button { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 640px) {
  .ex-modal .ex-f { flex-direction: column; }
  .ex-modal .ex-f button { width: 100%; }
}

/* ---------- 4. HAMBURGER / MOBILE NAV ---------- */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: #0A1526;
  border-radius: 2px;
  transition: all .25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: #fff;
    border-top: 1px solid #E1E7F0;
    border-bottom: 1px solid #E1E7F0;
    padding: 12px 16px;
    gap: 0 !important;
    box-shadow: 0 12px 24px rgba(2,84,146,.08);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a {
    padding: 14px 16px !important;
    border-bottom: 1px solid #F2F5FA;
    font-size: 15px !important;
    min-height: 44px;
    display: flex; align-items: center;
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-search { display: none; }
  .nav-in { flex-wrap: wrap; }
}

/* ---------- 5. Tap-target minimum 44px ---------- */
.btn, .ico-btn, .cart-btn, .nav-links a, .ch-row a {
  min-height: 44px;
}

/* ---------- 6. AUDIENCE GRID on homepage ---------- */
.audience-section {
  padding: 72px 0;
  background: linear-gradient(180deg, #FAFBFD 0%, #F7F9FC 100%);
}
.audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 40px;
}
.audience-card {
  background: #fff;
  border: 1px solid #E1E7F0;
  border-radius: 18px;
  padding: 28px 22px;
  text-decoration: none;
  color: inherit;
  transition: all .22s cubic-bezier(.2,.9,.3,1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.audience-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #025492, #0096D4);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s ease;
}
.audience-card:hover {
  border-color: #0096D4;
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(2,84,146,.1);
}
.audience-card:hover::before { transform: scaleX(1); }
.audience-ico, .audience-card .ai {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, rgba(0,150,212,.12), rgba(2,84,146,.08));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.audience-card h3, .audience-card h4 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #0A1526;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 4px 0 0;
}
.audience-card p {
  font-size: 13.5px;
  color: #6C7C92;
  line-height: 1.5;
  margin: 0;
}
.audience-card .rd, .audience-card .audience-link {
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #025492;
  display: flex;
  align-items: center;
  gap: 6px;
}
.audience-card:hover .rd, .audience-card:hover .audience-link { color: #0096D4; }

/* ---------- 7. Shop filter chips refinements ---------- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 32px;
}
.filter-chips .chip {
  padding: 10px 16px;
  border: 1.5px solid #E1E7F0;
  background: #fff;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: #6C7C92;
  cursor: pointer;
  min-height: 40px;
  transition: all .18s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-chips .chip:hover {
  border-color: #0096D4;
  color: #025492;
  background: #F7F9FC;
}
.filter-chips .chip.is-active {
  background: linear-gradient(135deg, #025492, #0096D4);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(0,150,212,.28);
}

/* ---------- 8. Product card tweaks ---------- */
.product-card {
  background: #fff;
  border: 1px solid #E1E7F0;
  border-radius: 16px;
  padding: 18px;
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.product-card:hover {
  border-color: #0096D4;
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(2,84,146,.1);
}
.product-card .p-img-wrap {
  aspect-ratio: 4/3;
  background: #FAFBFD;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card .p-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- 9. Hero + section mobile tightening ---------- */
@media (max-width: 640px) {
  .section, section.block, .page-hero { padding: 48px 0; }
  h1 { font-size: clamp(28px, 7vw, 38px); }
  h2 { font-size: clamp(22px, 5vw, 28px); }
  .container, .container-sm { padding: 0 18px; }
  .matcher-card { padding: 24px 18px !important; }
}

/* ---------- 10. FORMS — better mobile UX ---------- */
.field input, .field textarea, .field select,
form[data-ht-form] input, form[data-ht-form] textarea, form[data-ht-form] select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #CFD7E3;
  border-radius: 10px;
  font-size: 16px; /* prevents iOS zoom */
  background: #fff;
  color: #0A1526;
  transition: all .15s ease;
  min-height: 48px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: #0096D4;
  box-shadow: 0 0 0 3px rgba(0,150,212,.15);
}
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #1A2942;
  margin-bottom: 6px;
}
.field { margin-bottom: 16px; }

/* ---------- 11. Table → cards on mobile ---------- */
@media (max-width: 640px) {
  table.responsive { display: block; overflow-x: auto; }
}

/* ---------- 12. Mobile bottom-bar spacing so FAB-style CTAs clear content ---------- */
.m-cart {
  display: none;
  position: fixed;
  bottom: 12px; left: 12px; right: 12px;
  z-index: 60;
  gap: 10px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  padding: 10px;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(2,84,146,.16);
  border: 1px solid #E1E7F0;
}
.m-cart a {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-cart .b1 {
  background: #fff;
  border: 1.5px solid #0096D4;
  color: #025492;
}
.m-cart .b2 {
  background: linear-gradient(135deg, #025492, #0096D4);
  color: #fff;
}
@media (max-width: 720px) {
  .m-cart { display: flex; }
  body { padding-bottom: 80px; }
}

/* ---------- 13. Toast ---------- */
.toast {
  position: fixed;
  bottom: 96px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0A1526;
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
  z-index: 200;
  opacity: 0;
  transition: all .28s cubic-bezier(.2,.9,.3,1);
  max-width: 90vw;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { background: #065F46; }
.toast.error { background: #991B1B; }

/* ---------- 14. Breadcrumbs ---------- */
.crumb {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: #6C7C92;
  padding: 16px 0;
}
.crumb a { color: #025492; text-decoration: none; }
.crumb a:hover { color: #0096D4; }
.crumb .sep { color: #CFD7E3; }

/* ---------- 15. Button min-heights + consistent feel ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all .18s ease;
  min-height: 48px;
}
.btn-primary {
  background: linear-gradient(135deg, #025492, #0096D4);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,150,212,.2);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,150,212,.32);
  color: #fff;
}
.btn-ghost {
  background: #fff;
  color: #025492;
  border: 1.5px solid #CFD7E3;
}
.btn-ghost:hover {
  border-color: #0096D4;
  color: #025492;
}
.btn-amber {
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245,158,11,.25);
}
.btn-amber:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(245,158,11,.35);
  color: #fff;
}

/* ---------- 16. Safety — no horizontal overflow ---------- */
html, body { overflow-x: hidden; }
section, .container { max-width: 100vw; }

/* ---------- 17. Matcher on mobile (homepage) ---------- */
@media (max-width: 640px) {
  .matcher-card { padding: 24px 18px !important; border-radius: 18px; }
  .matcher-card h2 { font-size: 24px; }
  .matcher-steps .mstep {
    flex: 1 1 auto;
    height: 4px;
    min-width: 30px;
  }
  .mq-opts { grid-template-columns: 1fr 1fr !important; }
  .mq-opts button { padding: 14px 10px !important; font-size: 13px !important; }
  .mq-result { flex-direction: column; text-align: center; }
  .mq-result img { width: 150px; margin: 0 auto; }
}
