/* Small intentional customizations; layout is Tailwind-first */
html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; height: auto; }
::selection { background: rgba(15, 23, 42, .1); }
.shadow-soft { box-shadow: 0 20px 60px rgba(2,6,23,.08); }

/* Ensure header sits above page content */
.site-header{ z-index: 2000; }

/* Mobile menu (rebuilt, robust) */
.mm-root{ position: fixed; inset: 0; z-index: 99999; display: none; }
.mm-root.open{ display: block; }
.mm-backdrop{ position: absolute; inset: 0; background: rgba(2,6,23,.78); }
.mm-panel{
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(2,6,23,.18);
  transform: translateX(100%);
  transition: transform .22s ease;
  will-change: transform;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-left: 1px solid rgba(226,232,240,.9);
}
.mm-root.open .mm-panel{ transform: translateX(0); }

.mm-top{ position: sticky; top: 0; background: #fff; border-bottom: 1px solid rgba(226,232,240,.9); padding: 14px 16px; display:flex; align-items:center; justify-content:space-between; }
.mm-title{ font-size: 14px; font-weight: 600; color: #0f172a; }
.mm-close{ height: 36px; width: 36px; border-radius: 14px; border: 1px solid rgba(226,232,240,1); display:inline-flex; align-items:center; justify-content:center; background:#fff; }

.mm-nav{ padding: 14px 12px 22px; display: grid; gap: 8px; }
.mm-item{ display:block; padding: 12px 14px; border-radius: 18px; color: #0f172a; text-decoration: none; }
.mm-item:hover{ background: rgba(241,245,249,.9); }
.mm-item-strong{ background: #0f172a; color: #fff; }
.mm-item-strong:hover{ background: #111c33; }

.mm-section{ margin-top: 6px; padding-top: 4px; }
.mm-section-title{ padding: 8px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(100,116,139,1); }

@media (max-width: 640px){
  .mm-panel{ max-width: none; }
}

/* Leaflet preview map */
.map-preview{ height: 360px; min-height: 260px; width: 100%; }
.leaflet-container{ font: inherit; }

/* Homepage: left list aligned to the preview map height */
.map-preview-list{ height: 360px; min-height: 260px; width: 100%; overflow-y: auto; overscroll-behavior: contain; background: #fff; }
.mpl-item{ display: block; width: 100%; text-align: left; padding: 14px 16px; border-bottom: 1px solid rgba(226,232,240,1); background: #fff; }
.mpl-item:hover{ background: rgba(248,250,252,1); }
.mpl-top{ display:flex; align-items:flex-start; justify-content:space-between; gap: 10px; }
.mpl-left{ display:flex; align-items:flex-start; gap: 10px; }
.mpl-num{ font-size: 12px; font-weight: 700; color: rgba(100,116,139,1); line-height: 1.2; margin-top: 1px; min-width: 20px; }
.mpl-name{ font-size: 14px; font-weight: 600; color: #0f172a; line-height: 1.2; }
.mpl-badge{ font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(100,116,139,1); white-space: nowrap; }
.mpl-addr{ margin-top: 6px; font-size: 12px; color: rgba(71,85,105,1); line-height: 1.25; }
.mpl-phone{ margin-top: 6px; font-size: 12px; color: rgba(15,23,42,1); }
.mpl-phone a{ text-decoration: underline; }

/* Mobile: list under the map should size naturally (no forced fixed height) */
@media (max-width: 768px){
  .map-preview{ height: 320px; min-height: 220px; }
  .map-preview-list{ height: auto; min-height: 0; max-height: 460px; }
}

/* Prevent iOS Safari auto-zoom on inputs (font-size < 16px triggers zoom) */
@media (max-width: 640px){
  input, select, textarea { font-size: 16px !important; }
}

/* Admin: mobile ergonomics */
.admin-notifications-cards{ display: block; }
.admin-notifications-table-wrap{ display: none; }

@media (min-width: 640px){
  .admin-notifications-cards{ display: none; }
  .admin-notifications-table-wrap{ display: block; }
}

@media (max-width: 640px){
  /* Sticky action bar on the clinic edit form */
  .admin-edit-clinic{ padding-bottom: 110px; }
  .admin-form-actions{
    position: sticky;
    bottom: 0;
    z-index: 50;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(226,232,240,1);
    padding: 12px 16px;
    margin-left: -16px;
    margin-right: -16px;
  }
}



/* Device storyboard */
.media-card{
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(248,250,252,1);
  border: 1px solid rgba(226,232,240,1);
  box-shadow: 0 18px 50px rgba(2,6,23,.08);
}
.media-card img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Catalog pages (do not crop) */
.catalog-page{
  background: #fff;
}
.catalog-page img{
  object-fit: contain;
  background: #fff;
}
.media-caption{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.2;
  color: rgba(15,23,42,1);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Mobile horizontal strip (stable layout) */
.story-strip{
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.story-card{
  flex: 0 0 auto;
  width: 84vw;
  max-width: 380px;
  aspect-ratio: 4 / 5;
  scroll-snap-align: start;
}
@media (max-width: 420px){
  .story-card{ width: 88vw; }
}

/* MOBILE FIX: avoid horizontal overflow + keep captions inside viewport.
   On small screens the device section should be a vertical, stable list
   (no sideways scroll that can feel like "zooming" / floating).
*/
@media (max-width: 1024px){
  .story-strip{
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
  }
  .story-card{
    width: 100%;
    max-width: none;
    aspect-ratio: 16 / 10;
  }
  .media-caption{
    position: static;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(226,232,240,1);
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.35;
  }
}

/* Admin notifications: keep long emails/phones/messages readable without forcing horizontal scroll */
.admin-notifications-table{
  table-layout: fixed;
}

.admin-notifications-contact a{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-notifications-snippet{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-notifications-message-row{
  background: #f8fafc; /* slate-50 */
}

.lead-message{
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

/* Device spec cards: keep copy readable on small screens */
@media (max-width: 640px){
  .spec-value{
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Device spec cards: keep values readable & prevent huge vertical stacks on mobile */
@media (max-width: 640px){
  .spec-value{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
}

/* iOS/Safari: hide native play overlay/controls on background hero video */
#heroVideo::-webkit-media-controls {
  display: none !important;
}
#heroVideo::-webkit-media-controls-panel {
  display: none !important;
}
#heroVideo::-webkit-media-controls-play-button {
  display: none !important;
}
#heroVideo::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

#heroVideo::-webkit-media-controls-overlay-play-button {
  display: none !important;
}
#heroVideo::-webkit-media-controls-overlay-enclosure {
  display: none !important;
}
#heroVideo::-webkit-media-controls-enclosure {
  display: none !important;
}
