/* =========================================================
   V441 — GLOBAL RESPONSIVE SAFETY LAYER
   Scope: public website only (.store-body)
   Goal: adapt existing modules without changing their visual identity.
   ========================================================= */

.store-body,
.store-body *{box-sizing:border-box}
.store-body{max-width:100%;overflow-x:hidden}
.store-body img,
.store-body video,
.store-body svg,
.store-body canvas{max-width:100%}
.store-body img,.store-body video{height:auto}
.store-body iframe{max-width:100%}
.store-body input,
.store-body select,
.store-body textarea,
.store-body button{max-width:100%;font:inherit}
.store-body textarea{resize:vertical}
.store-body table{max-width:100%}
.store-body [class*="grid"],
.store-body [class*="layout"],
.store-body [class*="row"],
.store-body [class*="columns"]{min-width:0}
.store-body [class*="grid"] > *,
.store-body [class*="layout"] > *,
.store-body [class*="row"] > *{min-width:0}

/* Keep all common public shells inside viewport. */
.store-body :is(.v381-shell,.v410-shell,.v232-shell,.v194-news-page,.product-list-page,.v135-product-list-page,.v136-product-list-page,.v137-product-list-page,.v120-product-page,.category-page,.ll80-public,.v306-gara-directory,.gx439-page,.v229-about-page,.v231-policy-page){
  width:min(100% - 32px,1600px)!important;
  max-width:1600px!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

/* Long user/database text must never push cards wider than viewport. */
.store-body :is(h1,h2,h3,h4,h5,h6,p,a,span,strong,b,small,li,td,th,address){
  overflow-wrap:anywhere;
  word-break:normal;
}

/* Embedded maps/media. */
.store-body :is(.leaflet-container,[class*="map-wrap"],[class*="map-box"],[class*="map-column"] iframe){
  max-width:100%!important;
}

/* Table fallback for public pages. */
.store-body .table-responsive,
.store-body .ll75-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}

/* ---------- Large laptops / compact desktop ---------- */
@media (max-width:1366px){
  .store-body :is(.v381-shell,.v410-shell,.v232-shell,.v194-news-page,.product-list-page,.v135-product-list-page,.v136-product-list-page,.v137-product-list-page,.v120-product-page,.category-page,.ll80-public,.v306-gara-directory,.gx439-page,.v229-about-page,.v231-policy-page){
    width:min(100% - 28px,1280px)!important;
  }
  .store-body .gx439-layout{grid-template-columns:minmax(0,1fr) minmax(260px,310px)!important;gap:18px!important}
  .store-body .v381-main-grid{gap:18px!important}
}

/* ---------- Tablet landscape / small laptop ---------- */
@media (max-width:1100px){
  .store-body :is(.v381-shell,.v410-shell,.v232-shell,.v194-news-page,.product-list-page,.v135-product-list-page,.v136-product-list-page,.v137-product-list-page,.v120-product-page,.category-page,.ll80-public,.v306-gara-directory,.gx439-page,.v229-about-page,.v231-policy-page){
    width:calc(100% - 24px)!important;
  }

  /* Home */
  .store-body .v381-service-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .store-body .v381-near-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .store-body .v381-news-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}

  /* Product list */
  .store-body :is(.v135-product-grid,.v136-product-grid,.v137-product-grid){grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .store-body .v136-list-layout{grid-template-columns:minmax(190px,240px) minmax(0,1fr)!important;gap:16px!important}

  /* Garage detail */
  .store-body .gx439-layout{grid-template-columns:1fr!important}
  .store-body .gx439-sidebar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px!important}
  .store-body .gx439-sidebar > *{margin:0!important}

  /* Contact / local */
  .store-body .v232-contact-grid,
  .store-body .v232-nationwide-grid,
  .store-body .ll80-hero-grid{grid-template-columns:1fr 1fr!important;gap:18px!important}
}

/* ---------- Tablet portrait ---------- */
@media (max-width:900px){
  .store-body .v381-main-grid{grid-template-columns:1fr!important}
  .store-body .v381-service-grid,
  .store-body .v381-near-grid,
  .store-body .v381-news-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  .store-body .v136-list-layout{grid-template-columns:1fr!important}
  .store-body .v136-sidebar{display:none!important}
  .store-body :is(.v135-product-grid,.v136-product-grid,.v137-product-grid){grid-template-columns:repeat(2,minmax(0,1fr))!important}

  .store-body .gx439-summary,
  .store-body .gx439-bottom-grid{grid-template-columns:1fr!important}
  .store-body .gx439-promises{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  .store-body .v232-contact-grid,
  .store-body .v232-nationwide-grid,
  .store-body .ll80-hero-grid{grid-template-columns:1fr!important}

  .store-body .v194-news-page :is(.news-layout,.v194-layout,[class*="news-grid"]){grid-template-columns:1fr!important}
}

/* ---------- Mobile / tablet small ---------- */
@media (max-width:760px){
  .store-body{font-size:14px}
  .store-body :is(.v381-shell,.v410-shell,.v232-shell,.v194-news-page,.product-list-page,.v135-product-list-page,.v136-product-list-page,.v137-product-list-page,.v120-product-page,.category-page,.ll80-public,.v306-gara-directory,.gx439-page,.v229-about-page,.v231-policy-page){
    width:calc(100% - 20px)!important;
  }

  .store-body h1{font-size:clamp(25px,7vw,34px)!important;line-height:1.18!important}
  .store-body h2{font-size:clamp(20px,5.8vw,28px)!important;line-height:1.24!important}
  .store-body h3{line-height:1.3!important}

  /* Generic buttons/touch targets. */
  .store-body :is(button,.btn,[class*="-btn"],[class*="button"]){min-height:40px}

  /* Horizontal toolbars/tabs may scroll instead of breaking layout. */
  .store-body :is(.gx439-tabs,.category-toolbar,.product-toolbar,.v135-product-toolbar,.v136-toolbar,.v137-toolbar){
    overflow-x:auto!important;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .store-body :is(.gx439-tabs,.category-toolbar,.product-toolbar,.v135-product-toolbar,.v136-toolbar,.v137-toolbar)::-webkit-scrollbar{display:none}

  /* Home */
  .store-body .v381-hero{min-height:0!important}
  .store-body .v381-hero-inner{min-height:0!important}
  .store-body .v381-service-grid,
  .store-body .v381-near-grid,
  .store-body .v381-news-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .store-body .v381-section-head{align-items:flex-end!important;gap:10px!important}

  /* Product listing */
  .store-body :is(.v135-product-grid,.v136-product-grid,.v137-product-grid){grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .store-body :is(.v135-pagination,.v136-pagination){display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:6px!important}

  /* Garage directory and detail */
  .store-body .v306-gara-directory :is(.garage-grid,[class*="gara-grid"],[class*="garage-list"]){grid-template-columns:1fr!important}
  .store-body .gx439-sidebar{grid-template-columns:1fr!important}
  .store-body .gx439-promises{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .store-body .gx439-gallery{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .store-body .gx439-section{padding:16px!important}

  /* Forms */
  .store-body .v232-form-grid{grid-template-columns:1fr!important}
  .store-body :is(.v232-contact-form,.v232-form-card) input,
  .store-body :is(.v232-contact-form,.v232-form-card) select,
  .store-body :is(.v232-contact-form,.v232-form-card) textarea{width:100%!important}

  /* Rich content and tables from CMS */
  .store-body :is(.product-content,.article-content,.v120-content-main,.v229-about-page,.v231-policy-page) table{display:block!important;width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  .store-body :is(.product-content,.article-content,.v120-content-main,.v229-about-page,.v231-policy-page) img{max-width:100%!important;height:auto!important}

  /* Avoid fixed media heights becoming enormous/tiny. */
  .store-body iframe[src*="map"],
  .store-body iframe[src*="google"],
  .store-body .leaflet-container{min-height:280px}
}

/* ---------- Phones ---------- */
@media (max-width:560px){
  .store-body :is(.v381-shell,.v410-shell,.v232-shell,.v194-news-page,.product-list-page,.v135-product-list-page,.v136-product-list-page,.v137-product-list-page,.v120-product-page,.category-page,.ll80-public,.v306-gara-directory,.gx439-page,.v229-about-page,.v231-policy-page){
    width:calc(100% - 16px)!important;
  }

  .store-body .v381-service-grid,
  .store-body .v381-near-grid,
  .store-body .v381-news-grid{grid-template-columns:1fr!important}

  /* Keep products 2-up on normal phones; compact spacing prevents overflow. */
  .store-body :is(.v135-product-grid,.v136-product-grid,.v137-product-grid){gap:8px!important}
  .store-body :is(.v135-product-grid,.v136-product-grid,.v137-product-grid) > *{min-width:0!important}

  .store-body .gx439-promises{grid-template-columns:1fr!important}
  .store-body .gx439-gallery{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}

  .store-body .v232-contact-main,
  .store-body .v232-form-card,
  .store-body .v232-info-card{padding-left:14px!important;padding-right:14px!important}
}

/* ---------- Very small phones ---------- */
@media (max-width:390px){
  .store-body :is(.v135-product-grid,.v136-product-grid,.v137-product-grid){grid-template-columns:1fr!important}
  .store-body .gx439-gallery{grid-template-columns:1fr!important}
  .store-body :is(.v381-shell,.v410-shell,.v232-shell,.v194-news-page,.product-list-page,.v135-product-list-page,.v136-product-list-page,.v137-product-list-page,.v120-product-page,.category-page,.ll80-public,.v306-gara-directory,.gx439-page,.v229-about-page,.v231-policy-page){
    width:calc(100% - 14px)!important;
  }
}

/* Accessibility / device preferences. */
@media (prefers-reduced-motion:reduce){
  .store-body *,
  .store-body *::before,
  .store-body *::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}


/* V448 GPS map loading feedback */
#garageMap.v448-map-loading,
#map.v448-map-loading{position:relative}
.v448-map-loading-badge{
  position:absolute;
  left:50%;
  top:50%;
  z-index:1000;
  transform:translate(-50%,-50%);
  padding:10px 16px;
  border-radius:999px;
  background:rgba(255,255,255,.96);
  box-shadow:0 8px 28px rgba(17,64,45,.15);
  color:#174A31;
  font-weight:700;
  font-size:13px;
  pointer-events:none;
}
