.hyrma-catalog {
  --hyrma-border: #dfe3e7;
  --hyrma-text: #20262d;
  --hyrma-muted: #5d6873;
  --hyrma-green: #1c7c45;
  --hyrma-red: #a33131;
  --hyrma-amber: #8a6500;
  color: var(--hyrma-text);
  container-type: inline-size;
}

.hyrma-catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--hyrma-gap, 24px);
}

.hyrma-catalog__tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 0.8rem 1.2rem;
  align-items: end;
  margin-bottom: var(--hyrma-gap, 24px);
  padding: 1rem;
  border: 1px solid var(--hyrma-border);
  border-radius: var(--hyrma-radius, 12px);
  background: #f7f8f9;
}
.hyrma-catalog__search { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 700; }
.hyrma-catalog__search input {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #aab3bb;
  border-radius: 7px;
  background: #fff;
  color: var(--hyrma-text);
  font: inherit;
}
.hyrma-catalog__search input:focus { border-color: var(--hyrma-button, var(--hyrma-green)); outline: 2px solid color-mix(in srgb, var(--hyrma-button, var(--hyrma-green)) 24%, transparent); }
.hyrma-catalog__available-filter { display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; font-weight: 650; }
.hyrma-catalog__available-filter input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--hyrma-button, var(--hyrma-green)); }
.hyrma-catalog__count { margin: 0; padding-bottom: 0.7rem; color: var(--hyrma-muted); white-space: nowrap; }
.hyrma-catalog__no-results { margin: var(--hyrma-gap, 24px) 0 0; }

.hyrma-catalog--columns-2 .hyrma-catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hyrma-catalog--columns-3 .hyrma-catalog__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hyrma-catalog--columns-4 .hyrma-catalog__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.hyrma-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hyrma-border);
  border-radius: var(--hyrma-radius, 12px);
  background: #fff;
  box-shadow: 0 2px 12px rgba(22, 31, 40, 0.06);
}

.hyrma-catalog--inquiry-enabled .hyrma-card { cursor: pointer; }
.hyrma-catalog--inquiry-enabled .hyrma-card:focus-within {
  outline: 3px solid var(--hyrma-green);
  outline: 3px solid color-mix(in srgb, var(--hyrma-green) 55%, white);
  outline-offset: 3px;
}

.hyrma-card__trigger {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.hyrma-card__trigger .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hyrma-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f3f5f6;
}
.hyrma-catalog--ratio-1-1 .hyrma-card__media { aspect-ratio: 1 / 1; }
.hyrma-catalog--ratio-16-9 .hyrma-card__media { aspect-ratio: 16 / 9; }

.hyrma-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hyrma-catalog--image-cover .hyrma-card__media img { object-fit: cover; }

.hyrma-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.1rem;
}

.hyrma-card__title {
  margin: 0;
  color: inherit;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}

.hyrma-card__description-wrap {
  position: relative;
  margin-top: 0.75rem;
}

.hyrma-card__description {
  display: -webkit-box;
  max-height: var(--hyrma-description-height, 6.2em);
  margin: 0;
  overflow: hidden;
  color: var(--hyrma-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--hyrma-description-lines, 4);
}

.hyrma-card__description-wrap.has-toggle .hyrma-card__description { padding-right: 2.45rem; }

.hyrma-card__description.is-expanded {
  display: block;
  max-height: none;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.hyrma-card__description-toggle {
  position: absolute;
  z-index: 3;
  right: -0.15rem;
  bottom: -0.15rem;
  display: flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--hyrma-button, var(--hyrma-green));
  border-radius: 50%;
  background: #fff;
  box-shadow: -0.55rem 0 0.65rem 0.45rem #fff;
  color: var(--hyrma-button, var(--hyrma-green));
  font: inherit;
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.hyrma-card__description-toggle::before {
  position: absolute;
  inset: -0.4rem;
  content: '';
}

.hyrma-card__description-toggle[hidden] { display: none; }
.hyrma-card__description-toggle:hover,
.hyrma-card__description-toggle:focus-visible,
.hyrma-card__description-toggle.is-expanded {
  background: var(--hyrma-button, var(--hyrma-green));
  color: #fff;
}

.hyrma-card__description-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hyrma-green) 38%, white);
  outline-offset: 2px;
}

.hyrma-card__status {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: auto 0 0;
  padding-top: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.hyrma-card__status-dot {
  width: 0.7rem;
  height: 0.7rem;
  flex: 0 0 auto;
  margin-top: 0.25em;
  border-radius: 50%;
  background: currentColor;
}

.hyrma-card__status--available { color: var(--hyrma-green); }
.hyrma-card__status--unavailable { color: var(--hyrma-red); }
.hyrma-card__status--unknown { color: var(--hyrma-amber); }

.hyrma-card__cta {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 0.8rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  border-color: var(--hyrma-button, var(--hyrma-text));
  color: var(--hyrma-button, var(--hyrma-text));
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.hyrma-catalog__empty {
  color: var(--hyrma-muted);
  font-size: 0.88rem;
}

.hyrma-catalog__empty {
  padding: 1rem;
  border: 1px solid var(--hyrma-border);
  border-radius: 8px;
  background: #f7f8f9;
}

.hyrma-catalog--layout-compact .hyrma-catalog__grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: var(--hyrma-gap, 14px);
}

.hyrma-catalog--layout-compact.hyrma-catalog--columns-2 .hyrma-catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hyrma-catalog--layout-compact.hyrma-catalog--columns-3 .hyrma-catalog__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hyrma-catalog--layout-compact.hyrma-catalog--columns-4 .hyrma-catalog__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.hyrma-catalog--layout-compact .hyrma-card { border-radius: var(--hyrma-radius, 9px); }
.hyrma-catalog--layout-compact .hyrma-card__body { padding: 0.8rem; }
.hyrma-catalog--layout-compact .hyrma-card__title { font-size: 1rem; }
.hyrma-catalog--layout-compact .hyrma-card__description { font-size: 0.87rem; line-height: 1.45; }
.hyrma-catalog--layout-compact .hyrma-card__status { padding-top: 0.75rem; font-size: 0.84rem; }

.hyrma-catalog--layout-list .hyrma-catalog__grid { grid-template-columns: 1fr; }
.hyrma-catalog--layout-list .hyrma-card { flex-direction: row; }
.hyrma-catalog--layout-list .hyrma-card__media {
  width: clamp(150px, 28%, 260px);
  flex: 0 0 auto;
  aspect-ratio: 4 / 3;
}
.hyrma-catalog--layout-list .hyrma-card__body { min-width: 0; }

.hyrma-inquiry {
  position: fixed;
  z-index: 999999;
  inset: 50% auto auto 50%;
  box-sizing: border-box;
  width: min(720px, calc(100vw - 2rem));
  max-width: none;
  max-height: min(90vh, 850px);
  max-height: min(90dvh, 850px);
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--hyrma-text, #20262d);
  box-shadow: 0 24px 70px rgba(10, 20, 30, 0.3);
  transform: translate(-50%, -50%);
}

.hyrma-inquiry::backdrop { background: rgba(14, 22, 30, 0.68); }

.hyrma-inquiry__panel {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: clamp(1.25rem, 4vw, 2.2rem);
}
.hyrma-inquiry__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef1f3;
  color: #20262d;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.hyrma-inquiry__close:hover,
.hyrma-inquiry__close:focus-visible { background: #dfe4e7; }
.hyrma-inquiry__title { margin: 0 3rem 0 0; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; }
.hyrma-inquiry__intro { margin: 0.7rem 0 0; color: #5d6873; line-height: 1.55; }
.hyrma-inquiry__product {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.2rem 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--hyrma-green, #1c7c45);
  background: #f2f7f4;
}
.hyrma-inquiry__product img { width: 88px; height: 66px; flex: 0 0 auto; border-radius: 7px; background: #fff; object-fit: contain; }
.hyrma-inquiry__product > div { display: flex; min-width: 0; flex-direction: column; gap: 0.15rem; }
.hyrma-inquiry__product strong { overflow-wrap: anywhere; }
.hyrma-inquiry__product small { color: #496157; font-weight: 650; }

.hyrma-inquiry__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.hyrma-field { display: flex; min-width: 0; flex-direction: column; gap: 0.35rem; overflow-wrap: anywhere; font-weight: 650; }
.hyrma-field--wide { grid-column: 1 / -1; }
.hyrma-field input,
.hyrma-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #aab3bb;
  border-radius: 6px;
  background: #fff;
  color: #20262d;
  font: inherit;
  font-weight: 400;
}

.hyrma-field textarea { min-height: 7rem; resize: vertical; }
.hyrma-field input:focus,
.hyrma-field textarea:focus { border-color: var(--hyrma-green, #1c7c45); outline: 2px solid rgba(28, 124, 69, 0.22); }
.hyrma-inquiry__consent { display: flex; align-items: flex-start; gap: 0.65rem; margin-top: 1rem; font-size: 0.9rem; line-height: 1.45; }
.hyrma-inquiry__consent input { flex: 0 0 auto; margin-top: 0.25em; }
.hyrma-inquiry__consent a { margin-left: 0.25em; }
.hyrma-inquiry__submit {
  margin-top: 1rem;
  padding: 0.75rem 1.1rem;
  border: 0;
  border-radius: 7px;
  background: var(--hyrma-button, var(--hyrma-green, #1c7c45));
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.hyrma-inquiry__nonbinding { margin: 0.9rem 0 0; color: #5d6873; font-size: 0.88rem; line-height: 1.45; }
.hyrma-inquiry__review h3 { margin: 0 0 1rem; font-size: 1.2rem; }
.hyrma-inquiry__review dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem 1.2rem; margin: 0; }
.hyrma-inquiry__review dl > div { min-width: 0; padding: 0.7rem; border-radius: 7px; background: #f5f7f8; }
.hyrma-inquiry__review dt { color: #5d6873; font-size: 0.82rem; font-weight: 700; }
.hyrma-inquiry__review dd { margin: 0.15rem 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.hyrma-inquiry__review-wide { grid-column: 1 / -1; }
.hyrma-inquiry__review-actions { display: flex; gap: 0.75rem; align-items: center; justify-content: flex-end; }
.hyrma-inquiry__back { margin-top: 1rem; padding: 0.7rem 1rem; border: 1px solid #84909a; border-radius: 7px; background: #fff; color: #20262d; font: inherit; font-weight: 700; cursor: pointer; }
.hyrma-inquiry__back:hover { background: #f2f4f5; }

.hyrma-inquiry__submit:hover { filter: brightness(0.92); }
.hyrma-inquiry__submit:disabled { cursor: wait; opacity: 0.65; }
.hyrma-inquiry__status { min-height: 1.45em; margin-top: 0.8rem; }
.hyrma-inquiry__status.is-error { color: #a33131; font-weight: 650; }
.hyrma-inquiry__success { padding: 1rem; border-radius: 8px; background: #eaf6ee; color: #145c33; font-weight: 700; }
.hyrma-inquiry__honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

html.hyrma-modal-open { overflow: hidden; }

@media (max-width: 620px) {
  .hyrma-inquiry {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 11px;
  }

  .hyrma-inquiry__panel { padding: 1rem; }
  .hyrma-inquiry__close {
    top: 0.55rem;
    right: 0.55rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .hyrma-inquiry__title {
    margin-right: 3rem;
    font-size: clamp(1.3rem, 7vw, 1.65rem);
    overflow-wrap: anywhere;
  }

  .hyrma-inquiry__intro { line-height: 1.45; }
  .hyrma-inquiry__product {
    margin: 1rem 0;
    padding: 0.7rem 0.8rem;
    overflow-wrap: anywhere;
  }
  .hyrma-inquiry__product img { width: 72px; height: 58px; }

  .hyrma-inquiry__fields { grid-template-columns: 1fr; }
  .hyrma-field--wide { grid-column: auto; }
  .hyrma-field input,
  .hyrma-field textarea {
    min-width: 0;
    font-size: 16px;
  }

  .hyrma-inquiry__consent { font-size: 0.88rem; }
  .hyrma-inquiry__submit {
    width: 100%;
    min-height: 3rem;
  }
  .hyrma-inquiry__review dl { grid-template-columns: 1fr; }
  .hyrma-inquiry__review-wide { grid-column: auto; }
  .hyrma-inquiry__review-actions { display: grid; grid-template-columns: 1fr; }
  .hyrma-inquiry__back { width: 100%; min-height: 3rem; }
}

@container (max-width: 820px) {
  .hyrma-catalog--columns-3 .hyrma-catalog__grid,
  .hyrma-catalog--columns-4 .hyrma-catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .hyrma-catalog--layout-list .hyrma-catalog__grid { grid-template-columns: 1fr; }

  .hyrma-catalog--layout-list .hyrma-card__media { width: clamp(140px, 34%, 220px); }
}

@container (max-width: 620px) {
  .hyrma-catalog__tools { grid-template-columns: 1fr; align-items: stretch; }
  .hyrma-catalog__count { padding-bottom: 0; }
  .hyrma-catalog--columns-2 .hyrma-catalog__grid,
  .hyrma-catalog--columns-3 .hyrma-catalog__grid,
  .hyrma-catalog--columns-4 .hyrma-catalog__grid { grid-template-columns: 1fr; }

  .hyrma-catalog--layout-list .hyrma-card { flex-direction: column; }
  .hyrma-catalog--layout-list .hyrma-card__media { width: 100%; }
  .hyrma-card__title,
  .hyrma-card__description,
  .hyrma-card__status { overflow-wrap: anywhere; }
  .hyrma-card__cta {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}

.hyrma-card[hidden],
.hyrma-catalog__no-results[hidden],
.hyrma-inquiry__edit[hidden],
.hyrma-inquiry__review[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .hyrma-card { transition: box-shadow 160ms ease, transform 160ms ease; }
  .hyrma-card:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(22, 31, 40, 0.1); }
}
