/**
 * Solution category landing pages
 * (Critical care, Imaging, In-Vitro Diagnosis, Sterilizer & Lab Equipment,
 *  and dynamic categories via products-list.html?category=)
 */

:root {
  --mr-brand: #c8102e;
  --mr-brand-dark: #a30d24;
  --mr-brand-soft: #fff5f6;
  --mr-text: #0f172a;
  --mr-text-muted: #64748b;
  --mr-border: #e5e7eb;
  --mr-border-soft: #f1f5f9;
  --mr-bg: #f5f7fa;
  --mr-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --mr-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.04);
  --mr-shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(15, 23, 42, 0.05);
}

/* ── Page background ── */
body.products.page {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(200, 16, 46, 0.04), transparent 60%),
    radial-gradient(900px 600px at -10% 10%, rgba(15, 23, 42, 0.04), transparent 55%),
    var(--mr-bg);
  background-attachment: fixed;
}

/* Hide the original AEM hero — we render our own header inside the panel */
body.products.page .kv.aem-GridColumn,
body.products.page #categoryHero {
  display: none !important;
}

/* ── Main grid container (override AEM grid behavior) ── */
/* KV hero is hidden and header is sticky — content already sits below the nav;
   avoid duplicate top offset (was 96–120px and looked like a huge empty band). */
body.products.page .mr-grid-container-1 {
  display: block !important;
  max-width: min(1680px, 94vw);
  margin: 0 auto !important;
  padding: 24px 32px 48px;
}

@media (min-width: 1600px) {
  body.products.page .mr-grid-container-1 {
    max-width: min(1760px, 95vw);
    padding-left: 40px;
    padding-right: 40px;
  }
}

/* Force every direct child to span the full container width.
   Overrides AEM rule `.mr-grid-container-1 :first-child { grid-column: 1/13 }` */
body.products.page .mr-grid-container-1 > * {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ── Main white panel ── */
body.products.page .mr-solution-products {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--mr-border);
  box-shadow: var(--mr-shadow-md);
  padding: 28px 32px 36px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

/* Decorative top accent bar */
body.products.page .mr-solution-products::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--mr-brand) 0%, #e53e58 50%, var(--mr-brand) 100%);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

/* ── Section title ── */
body.products.page .mr-solution-products .mr-solution-text-img-text {
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--mr-border-soft);
}

body.products.page .mr-solution-products .mr-solution-text-img-tit {
  font-size: 28px !important;
  font-weight: 700 !important;
  color: var(--mr-text) !important;
  line-height: 1.25 !important;
  margin: 0 !important;
  padding: 0 0 0 16px !important;
  position: relative;
  display: inline-block;
  letter-spacing: -0.01em;
}

body.products.page .mr-solution-products .mr-solution-text-img-tit::before {
  content: "" !important;
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px;
  background: var(--mr-brand);
  display: block !important;
  height: auto !important;
}

/* ── Category tabs (pill style, wrap, no horizontal scroll) ── */
body.products.page .mr-solution-products .mr-solution-text-img-nav-list {
  display: flex !important;
  flex-wrap: wrap !important;
  -webkit-flex-wrap: wrap !important;
  gap: 10px;
  margin: 0 0 24px !important;
  padding: 0 !important;
  width: 100% !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  border: none;
}

body.products.page .mr-solution-products .mr-solution-text-img-nav-item {
  flex: 0 1 auto;
  flex-shrink: 1;
  margin: 0 !important;
  padding: 10px 20px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  color: var(--mr-text-muted) !important;
  background: #fff;
  border: 1px solid var(--mr-border) !important;
  border-radius: 999px !important;
  cursor: pointer;
  transition: background 0.22s, color 0.22s, border-color 0.22s,
    box-shadow 0.22s, transform 0.22s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

body.products.page .mr-solution-products .mr-solution-text-img-nav-item:hover {
  color: var(--mr-brand) !important;
  border-color: rgba(200, 16, 46, 0.35) !important;
  background: var(--mr-brand-soft);
  transform: translateY(-1px);
}

body.products.page .mr-solution-products .mr-solution-text-img-nav-item.active {
  color: #fff !important;
  background: linear-gradient(135deg, var(--mr-brand) 0%, var(--mr-brand-dark) 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 6px 18px rgba(200, 16, 46, 0.32);
  transform: translateY(-1px);
}

/* ── Product grid wrapper ── */
body.products.page .mr-solution-products .mr-solution-text-img-bottom-list,
body.products.page .mr-solution-products .mr-solution-text-img-bottom-item.active,
body.products.page .mr-solution-products .mr-solution-text-img-bottom-item-con {
  width: 100% !important;
  max-width: 100% !important;
}

/* Subcategory label (e.g. "Cardiac Monitor" above product cards) */
body.products.page .mr-solution-products .mr-islandcare-subcat-label {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--mr-text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 18px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.products.page .mr-solution-products .mr-islandcare-subcat-label::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--mr-brand);
  border-radius: 2px;
  display: inline-block;
}

body.products.page .mr-solution-products .mr-islandcare-subcat-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--mr-border-soft);
}

/* Empty AEM description slot still had ~25px margin from site CSS */
body.products.page .mr-solution-products .mr-solution-item-des:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.products.page .mr-solution-products .mr-solution-hot-list {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  gap: 24px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.products.page .mr-solution-products .mr-solution-hot-list .mr-solution-hot-item:nth-child(2n) {
  margin-left: 0 !important;
}

/* Undo site grid rule for hot items */
body.products.page .mr-grid-container-1 .mr-solution-hot-list > .mr-solution-hot-item,
body.products.page .mr-grid-container-1 .mr-solution-hot-list > .mr-solution-hot-item:first-child {
  grid-column: unset !important;
  grid-row: unset !important;
}

/* ── Product card ── */
/* 每行少一列 + 取消窄 max-width → 卡片更宽，图片区域更大 */
body.products.page .mr-solution-products .mr-solution-hot-item {
  grid-column: auto !important;
  flex: 0 1 calc((100% - 48px) / 3) !important;
  width: 100% !important;
  min-width: 260px !important;
  max-width: none !important;
  margin: 0 !important;
  background: #fff !important;
  border: 1px solid var(--mr-border-soft);
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: var(--mr-shadow-sm);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 0.28s ease, border-color 0.28s ease;
  position: relative;
}

@media (min-width: 1440px) {
  body.products.page .mr-solution-products .mr-solution-hot-item {
    flex-basis: calc((100% - 72px) / 4) !important;
  }
}

@media (min-width: 1920px) {
  body.products.page .mr-solution-products .mr-solution-hot-item {
    flex-basis: calc((100% - 96px) / 5) !important;
  }
}

body.products.page .mr-solution-products .mr-solution-hot-item:hover {
  transform: translateY(-6px);
  border-color: rgba(200, 16, 46, 0.25);
  box-shadow: var(--mr-shadow-lg);
}

body.products.page .mr-solution-products .mr-solution-hot-item > a,
body.products.page .mr-solution-products .mr-solution-hot-item-a {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  text-decoration: none !important;
  color: inherit;
  grid-row: 2;
  position: relative;
  z-index: 1;
}

body.products.page .mr-solution-products .mr-solution-hot-item.img-lazy-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  position: relative;
}

/* Image area — 1:1 方框，grid 子项宽度=卡片宽，aspect-ratio 才能算对 */
body.products.page .mr-solution-products .mr-solution-item-img {
  position: relative;
  top: auto;
  left: auto;
  grid-row: 1;
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: none !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
  padding: 10px 12px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 100%, rgba(200, 16, 46, 0.04), transparent 70%),
    linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  border-bottom: 1px solid var(--mr-border-soft);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}

body.products.page .mr-solution-products .mr-solution-hot-item:hover .mr-solution-item-img {
  transform: scale(1.06);
}

/* Text area */
body.products.page .mr-solution-products .mr-solution-hot-item-text {
  background: #fff !important;
  padding: 18px 20px 22px !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
}

body.products.page .mr-solution-products .mr-solution-hot-item-text-tit {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--mr-text) !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  letter-spacing: -0.005em;
  transition: color 0.22s ease;
}

body.products.page .mr-solution-products .mr-solution-hot-item-text-des {
  font-size: 12px !important;
  color: var(--mr-text-muted) !important;
  line-height: 1.55 !important;
  margin-top: 6px !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* "View detail" arrow */
body.products.page .mr-solution-products .mr-solution-hot-item-text::after {
  content: "→";
  position: absolute;
  right: 20px;
  bottom: 22px;
  font-size: 16px;
  color: var(--mr-brand);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

body.products.page .mr-solution-products .mr-solution-hot-item:hover .mr-solution-hot-item-text::after {
  opacity: 1;
  transform: translateX(0);
}

body.products.page .mr-solution-products .mr-solution-hot-item:hover .mr-solution-hot-item-text-tit {
  color: var(--mr-brand) !important;
}

/* ── Tablet ── */
@media screen and (max-width: 1024px) {
  body.products.page .mr-grid-container-1 {
    padding: 20px 24px 40px;
  }

  body.products.page .mr-solution-products {
    padding: 24px 20px 28px;
  }

  body.products.page .mr-solution-products .mr-solution-hot-item {
    flex-basis: calc((100% - 24px) / 2) !important;
  }
}

/* ── Mobile ── */
@media screen and (max-width: 768px) {
  body.products.page .mr-grid-container-1 {
    padding: 24px 16px 48px;
  }

  body.products.page .mr-solution-products {
    padding: 24px 18px 28px;
    border-radius: 16px;
  }

  body.products.page .mr-solution-products .mr-solution-text-img-tit {
    font-size: 22px !important;
  }

  body.products.page .mr-solution-products .mr-solution-text-img-nav-item {
    font-size: 13px !important;
    padding: 8px 16px !important;
  }

  body.products.page .mr-solution-products .mr-solution-hot-list {
    justify-content: flex-start !important;
    gap: 14px !important;
  }

  body.products.page .mr-solution-products .mr-solution-hot-item {
    flex: 1 1 calc((100% - 14px) / 2) !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  body.products.page .mr-solution-products .mr-solution-item-img {
    padding: 12px;
  }

  body.products.page .mr-solution-products .mr-solution-hot-item-text {
    padding: 12px 14px 16px !important;
  }

  body.products.page .mr-solution-products .mr-solution-hot-item-text-tit {
    font-size: 14px !important;
  }
}

@media screen and (max-width: 480px) {
  body.products.page .mr-solution-products .mr-solution-hot-item {
    flex-basis: 100% !important;
  }
}

/* products-list.html: single dynamic category (?category=) */
body.products.page.mr-pl-category-landing .mr-pl-catalog .container {
  max-width: none;
  width: 100%;
  padding: 0;
}

body.products.page.mr-pl-category-landing .cmp-products-list-main {
  background: transparent;
}
