/* Layout stabilization patch: protects dynamic content from unexpected media dimensions. */
html, body { max-width: 100%; overflow-x: clip; }

.framework-banner {
  min-height: clamp(360px, 42vw, 580px);
  isolation: isolate;
}
.framework-banner > img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: clamp(360px, 42vw, 580px) !important;
  max-height: none !important;
  object-fit: cover;
  object-position: center;
}
/* Preserve the full uploaded desktop banner when no overlay copy is active. */
@media (min-width: 761px) {
  .framework-banner:not(.banner-has-copy) > img {
    object-fit: contain;
    background: #071a2e;
  }
}
.framework-banner-overlay { z-index: 1; }
.framework-banner-content { position: relative; z-index: 2; }
.framework-banner:not(.banner-has-copy) .framework-banner-overlay {
  background: linear-gradient(90deg, rgba(4,18,33,.12), rgba(4,18,33,.03));
  pointer-events: none;
}
.framework-banner:not(.banner-has-copy) .framework-banner-content { display: none; }
.framework-banner.banner-has-copy [data-banner-button]:empty,
.framework-banner.banner-has-copy [data-banner-title]:empty,
.framework-banner.banner-has-copy [data-banner-subtitle]:empty { display: none; }

.dynamic-products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 20px !important;
  background: transparent !important;
  border: 0 !important;
  align-items: stretch;
}
.dynamic-products.dynamic-count-1 { grid-template-columns: minmax(260px, 320px) !important; }
.dynamic-products.dynamic-count-2 { grid-template-columns: repeat(2, minmax(260px, 320px)) !important; }
.dynamic-products.dynamic-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

.dynamic-product-card,
.dynamic-product-card.product-card {
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(8,26,44,.08) !important;
}
.dynamic-product-image,
.dynamic-product-image.product-media {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 250px !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #f1f5f8 !important;
}
.dynamic-product-image img,
.dynamic-product-image.product-media img,
.dynamic-product-card img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}
.dynamic-product-content,
.dynamic-product-content.product-body {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 20px !important;
  gap: 10px !important;
}
.dynamic-product-content > * {
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
}
.dynamic-product-content h3 {
  overflow-wrap: normal !important;
  word-break: normal !important;
  white-space: normal !important;
  line-height: 1.25 !important;
}
.dynamic-product-content > p { margin-bottom: 12px; }
.dynamic-product-content .text-link { margin-top: auto; align-self: flex-start; }

.framework-collections .portal-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
  border: 0 !important;
  background: transparent !important;
}
.portal-card {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 210px !important;
  padding: 28px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 8px 22px rgba(8,26,44,.05) !important;
}
.portal-card > span { margin-bottom: 28px !important; }
.portal-card p { margin-bottom: 16px !important; }
.portal-card .portal-link {
  margin-top: auto;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}
.has-published-products .dynamic-products { margin-top: 0; }
@media (max-width: 760px) {
  body { padding-bottom: 58px; }
}
.portal-empty { display: none !important; }
.product-feed-empty[hidden] { display: none !important; }
.product-feed-empty:not([hidden]) { display: block !important; }

.whatsapp-float {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  z-index: 9999 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 46px !important;
  padding: 0 18px !important;
  color: #fff !important;
  background: #18a765 !important;
  border-radius: 999px !important;
  box-shadow: 0 12px 30px rgba(10,92,54,.3) !important;
}

@media (max-width: 1000px) {
  .dynamic-products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 760px) {
  .framework-banner,
  .framework-banner > img { min-height: 330px !important; height: 330px !important; }
  .framework-collections .portal-grid { grid-template-columns: 1fr !important; }
  .dynamic-products,
  .dynamic-products.dynamic-count-1,
  .dynamic-products.dynamic-count-2,
  .dynamic-products.dynamic-count-3,
  .dynamic-products.dynamic-count-4 { grid-template-columns: 1fr !important; }
  .dynamic-product-image,
  .dynamic-product-image.product-media { height: 280px !important; }
  .whatsapp-float { right: 14px !important; bottom: 14px !important; }
}
