/* Full product catalog and shared dynamic product detail */

body.page-products .page-hero,
body.page-generic-product .page-hero {
  background: #f4f2ea;
}

.catalog-section {
  background: #fbfbf8;
}

.catalog-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  margin-bottom: 30px;
}

.catalog-intro .section-title {
  max-width: 780px;
  margin: 8px 0 0;
}

.catalog-stat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.catalog-stat {
  min-width: 138px;
  padding: 16px 18px;
  background: #e5efec;
  border: 1px solid rgba(0, 125, 119, 0.16);
  border-radius: 12px;
}

.catalog-stat strong,
.catalog-stat span {
  display: block;
}

.catalog-stat strong {
  color: var(--refresh-ink);
  font-size: 25px;
  line-height: 1;
}

.catalog-stat span {
  margin-top: 7px;
  color: var(--refresh-copy);
  font-size: 13px;
}

.catalog-control-panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(210px, 280px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 22px;
  padding: 24px;
  background: #eef2ee;
  border: 1px solid rgba(16, 39, 46, 0.12);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(26, 48, 54, 0.06);
}

.catalog-control {
  display: grid;
  gap: 8px;
}

.catalog-control label {
  color: var(--refresh-ink);
  font-size: 13px;
  font-weight: 750;
}

.catalog-control input,
.catalog-control select {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  background-color: #fff;
  border: 1px solid rgba(16, 39, 46, 0.24);
  border-radius: 10px;
  color: var(--refresh-ink);
  font: 600 16px/1.2 var(--refresh-font);
}

.catalog-control input {
  padding-left: 48px;
  background-image: url("assets/icons/search.svg");
  background-position: 16px center;
  background-repeat: no-repeat;
  background-size: 20px;
}

.catalog-control input:focus,
.catalog-control select:focus {
  outline: 3px solid rgba(96, 211, 203, 0.34);
  border-color: var(--refresh-teal);
}

.catalog-reset {
  min-height: 54px;
  padding: 0 22px;
  border: 1px solid var(--refresh-ink);
  border-radius: 10px;
  background: transparent;
  color: var(--refresh-ink);
  font: 750 14px/1 var(--refresh-font);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.catalog-results-bar {
  scroll-margin-top: 118px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  min-height: 46px;
  margin-bottom: 20px;
  padding: 0 4px;
  color: var(--refresh-copy);
  font-size: 14px;
}

.catalog-results-bar strong {
  color: var(--refresh-ink);
}

body.page-products .catalog-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

body .catalog-grid .catalog-product-card {
  min-width: 0;
  display: block;
  padding: 0 !important;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(16, 39, 46, 0.12);
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(22, 42, 48, 0.055);
}

.catalog-card-link {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  color: inherit;
  text-decoration: none;
}

body .catalog-grid .catalog-card-photo {
  height: 300px;
  display: block;
  background:
    radial-gradient(circle at 50% 48%, #fff 0, #fff 38%, #f4f4ef 100%);
}

body .catalog-grid .catalog-card-photo > img {
  width: 100%;
  height: 100%;
  padding: 54px 36px 48px;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
  transition: transform 260ms cubic-bezier(.2, .8, .2, 1);
}

.catalog-card-photo .stock-tag {
  inset: 18px auto auto 18px;
  max-width: calc(100% - 36px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(7px);
}

.catalog-photo-action {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 16px;
  left: 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(0, 125, 119, 0.94);
  border-radius: 9px;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}

body .catalog-grid .catalog-card-copy {
  min-height: 178px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 23px 24px 22px !important;
  background: #fff;
  border-top: 1px solid rgba(16, 39, 46, 0.1);
}

.catalog-card-brand {
  color: var(--refresh-teal);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.07em;
  line-height: 1.35;
  text-transform: uppercase;
}

.catalog-card-title {
  margin-top: 9px;
  color: var(--refresh-ink);
  font-size: clamp(21px, 1.5vw, 27px);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.catalog-availability {
  margin-top: 10px;
  color: var(--refresh-copy);
  font-size: 13px;
  line-height: 1.45;
}

.catalog-card-action {
  min-height: 38px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(16, 39, 46, 0.1);
  color: var(--refresh-ink);
  font-size: 14px;
  font-weight: 750;
}

.catalog-card-action > span,
.catalog-photo-action > span {
  transition: transform 180ms ease;
}

.catalog-empty {
  padding: 62px 24px;
  text-align: center;
  background: #f4f2ea;
  border: 1px solid rgba(16, 39, 46, 0.12);
  border-radius: 16px;
}

.catalog-empty h3 {
  margin: 0 0 9px;
  color: var(--refresh-ink);
  font-size: 28px;
}

.catalog-empty p {
  margin: 0;
  color: var(--refresh-copy);
}

.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
}

.catalog-page-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid rgba(16, 39, 46, 0.18);
  border-radius: 9px;
  color: var(--refresh-ink);
  font: 700 14px/1 var(--refresh-font);
  cursor: pointer;
}

.catalog-page-button[aria-current="page"] {
  background: var(--refresh-teal);
  border-color: var(--refresh-teal);
  color: #fff;
}

.catalog-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.catalog-page-ellipsis {
  min-width: 24px;
  text-align: center;
  color: var(--refresh-copy);
}

/* Generic catalog product details: only verified source facts are displayed. */

.catalog-detail-section {
  background: #fbfbf8;
}

.catalog-detail-layout {
  display: grid;
  grid-template-columns: minmax(430px, 0.96fr) minmax(500px, 1.04fr);
  gap: clamp(36px, 5vw, 78px);
  align-items: start;
}

.catalog-detail-gallery {
  position: sticky;
  top: 120px;
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px;
  background: #f0f1eb;
  border: 1px solid rgba(16, 39, 46, 0.14);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(22, 42, 48, 0.07);
}

.catalog-detail-gallery img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.catalog-detail-gallery .gallery-index {
  position: absolute;
  top: 24px;
  left: 26px;
  max-width: calc(100% - 52px);
  color: var(--refresh-copy);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.catalog-detail-summary {
  padding-top: 8px;
}

.catalog-detail-summary h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  color: var(--refresh-ink);
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 680;
  letter-spacing: -0.052em;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.catalog-detail-lead {
  max-width: 650px;
  margin: 0 0 28px;
  color: var(--refresh-copy);
  font-size: 18px;
  line-height: 1.65;
}

.catalog-product-facts {
  margin: 0 0 28px;
  padding: 0;
  border-top: 1px solid rgba(16, 39, 46, 0.15);
}

.catalog-product-facts > div {
  min-height: 58px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  align-items: center;
  border-bottom: 1px solid rgba(16, 39, 46, 0.12);
}

.catalog-product-facts dt {
  color: var(--refresh-copy);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.catalog-product-facts dd {
  margin: 0;
  color: var(--refresh-ink);
  font-size: 16px;
  font-weight: 650;
}

.catalog-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.catalog-detail-actions .button {
  min-height: 54px;
}

.catalog-detail-note {
  margin: 18px 0 0;
  padding: 16px 18px;
  background: #e5efec;
  border-left: 3px solid var(--refresh-teal);
  color: var(--refresh-copy);
  font-size: 14px;
  line-height: 1.55;
}

.product-check-section {
  background: #f4f2ea;
}

.product-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.product-check-card {
  padding: 30px;
  background: #fff;
  border: 1px solid rgba(16, 39, 46, 0.12);
  border-radius: 14px;
}

.product-check-card img {
  width: 28px;
  height: 28px;
}

.product-check-card h3 {
  margin: 24px 0 9px;
  color: var(--refresh-ink);
  font-size: 22px;
}

.product-check-card p {
  margin: 0;
  color: var(--refresh-copy);
  line-height: 1.6;
}

.catalog-not-found {
  max-width: 760px;
  margin: 0 auto;
  padding: 76px 34px;
  text-align: center;
  background: #f4f2ea;
  border-radius: 18px;
}

.catalog-not-found h1 {
  margin: 0 0 14px;
  color: var(--refresh-ink);
}

.catalog-not-found p {
  margin: 0 0 24px;
  color: var(--refresh-copy);
}

@media (hover: hover) and (pointer: fine) {
  .catalog-product-card:hover .catalog-photo-action,
  .catalog-product-card:focus-within .catalog-photo-action {
    opacity: 1;
    transform: translateY(0);
  }

  .catalog-product-card:hover .catalog-card-photo > img,
  .catalog-product-card:focus-within .catalog-card-photo > img {
    transform: scale(1.045);
  }

  .catalog-product-card:hover .catalog-card-action > span,
  .catalog-product-card:hover .catalog-photo-action > span {
    transform: translateX(4px);
  }

  .catalog-reset:hover,
  .catalog-page-button:not(:disabled):hover {
    background: var(--refresh-ink);
    color: #fff;
    transform: translateY(-1px);
  }
}

.catalog-card-link:focus-visible,
.catalog-page-button:focus-visible,
.catalog-reset:focus-visible {
  outline: 3px solid rgba(96, 211, 203, 0.58);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  body.page-products .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog-detail-layout {
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  }
}

@media (max-width: 900px) {
  .catalog-intro,
  .catalog-detail-layout {
    grid-template-columns: 1fr;
  }

  .catalog-stat-row {
    justify-content: flex-start;
  }

  .catalog-control-panel {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-reset {
    grid-column: 1 / -1;
  }

  body.page-products .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-detail-gallery {
    position: relative;
    top: auto;
    min-height: 500px;
  }
}

@media (max-width: 620px) {
  .catalog-control-panel,
  body.page-products .catalog-grid,
  .product-check-grid {
    grid-template-columns: 1fr;
  }

  .catalog-control-panel {
    padding: 18px;
  }

  .catalog-results-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  body .catalog-grid .catalog-card-photo {
    height: 320px;
  }

  .catalog-photo-action {
    opacity: 1;
    transform: none;
  }

  .catalog-pagination {
    flex-wrap: wrap;
  }

  .catalog-page-button {
    min-width: 42px;
    padding-inline: 11px;
  }

  .catalog-detail-gallery {
    min-height: 390px;
    padding: 48px 26px 26px;
  }

  .catalog-detail-summary h1 {
    font-size: clamp(38px, 12vw, 52px);
  }

  .catalog-product-facts > div {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 14px 0;
  }

  .catalog-detail-actions {
    display: grid;
  }

  .catalog-detail-actions .button {
    width: 100%;
  }
}
