/* Aluminum alloy selector — refined visual system + hover material preview cards */

/* Higher specificity than the shared section surface rules. */
.home #main > section#materials.home-alloys[data-home-surface] {
  background: #ffffff;
}
#materials.home-alloys .container { width: min(1180px, calc(100% - 64px)); }
#materials.home-alloys h2 { margin-bottom: 10px; }

/* ---- Section intro row ---- */
.home-alloy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e4edf6;
}
.home-alloy-intro { margin: 0; color: #52677d; font-size: 16px; }
.home-alloy-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 15px;
  border: 1px solid #d9e8f7;
  border-radius: 999px;
  background: #fff;
  color: #4b6684;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 3px 10px #173b6208;
}
.home-alloy-hint-icon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1d488e;
  animation: home-alloy-pulse 2.4s ease-in-out infinite;
}
@keyframes home-alloy-pulse {
  0%, 100% { box-shadow: 0 0 0 4px #1d488e26; }
  50%      { box-shadow: 0 0 0 8px #1d488e0a; }
}

/* ---- Series grid ---- */
.home-alloy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}
.home-alloy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 18px 18px;
  border: 1px solid #dbe7f3;
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
}
.home-alloy-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #1d488e, #52677d 55%, transparent);
  opacity: 0;
  transition: opacity .25s ease;
}
.home-alloy-card:hover {
  transform: translateY(-4px);
  border-color: #bcd7ef;
  box-shadow: 0 18px 42px #173b621a;
}
.home-alloy-card:hover::before { opacity: 1; }

.home-alloy-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid #edf3f9;
}
.home-alloy-index {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(140deg, #1d488e, #1d488e);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .02em;
  box-shadow: 0 6px 14px #1d488e33;
}
.home-alloy-card-title { min-width: 0; flex: 1 1 auto; }
.home-alloy-card h3 {
  margin: 1px 0 7px;
  color: #153e6b;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .075em;
  line-height: 1.3;
  white-space: nowrap;
}
.home-alloy-family {
  display: inline-flex;
  margin: 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #1d6bb5;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .055em;
  line-height: 1.5;
}
.home-alloy-count {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 2px 7px;
  border: 1px solid #e3ecf5;
  border-radius: 7px;
  background: #f8fbfe;
  color: #6c8299;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.6;
}

/* ---- Grade chips ---- */
.home-alloy-grades {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-alloy-grades li { min-width: 0; }
.home-alloy-grade {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #e6eef6;
  border-radius: 9px;
  background: #fbfdff;
  color: #1d488e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  transition: background .2s ease, color .2s ease, border-color .2s ease,
              box-shadow .2s ease, transform .2s ease;
}
.home-alloy-grade span {
  color: #9ab4cc;
  font-size: 16px;
  font-weight: 400;
  padding-left: 2px;
  transition: color .2s ease, transform .2s ease;
}
.home-alloy-grade:hover,
.home-alloy-grade:focus-visible,
.home-alloy-grade.is-active {
  background: #eaf0f6;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px #1d488e38;
  transform: translateY(-2px);
}
.home-alloy-grade:hover span,
.home-alloy-grade:focus-visible span,
.home-alloy-grade.is-active span { color: #fff; transform: translateX(3px); }
.home-alloy-grades .ch-canvas-material-button { display: none; }
.home-alloy-link { color: #153e6b; font-size: 13px; font-weight: 650; }
.home-alloy-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---- Hover material card ---- */
.home-material-preview {
  position: fixed;
  z-index: 9999;
  width: 322px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  padding: 0;
  border: 1px solid #d9e6f2;
  border-radius: 16px;
  color: #12243a;
  background: #fff;
  box-shadow: 0 28px 70px #102b4540, 0 4px 12px #102b4514;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px) scale(.985);
  transform-origin: top left;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.home-material-preview[hidden] { display: none; }
.home-material-preview.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.home-material-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #ffffff80;
  border-radius: 50%;
  color: #fff;
  background: #102b4559;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .18s ease;
}
.home-material-preview-close:hover { background: #102b45cc; }
.home-material-preview-image {
  position: relative;
  height: 166px;
  background: #edf2f6;
  overflow: hidden;
}
.home-material-preview-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  height: 3px;
  background: linear-gradient(90deg, #1d488e, #52677d 60%, transparent);
}
.home-material-preview-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0d2a4738, transparent 42%);
  pointer-events: none;
}
.home-material-preview-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-material-preview-copy { padding: 18px 20px 20px; }
.home-material-preview-eyebrow {
  display: block;
  margin: 0 0 9px;
  color: #1d488e;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.home-material-preview-copy h3 {
  margin: 0 0 8px;
  color: #12243a;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.35;
}
.home-material-preview-copy p {
  margin: 0 0 16px;
  color: #63758a;
  font-size: 13px;
  line-height: 1.65;
}
.home-material-preview-copy a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border-radius: 9px;
  background: #1d488e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: background .18s ease, transform .18s ease;
}
.home-material-preview-copy a:hover { background: #1d488e; transform: translateY(-1px); }

.home-alloy-card a:focus-visible,
.home-material-preview a:focus-visible,
.home-material-preview button:focus-visible {
  outline: 3px solid #1d488e;
  outline-offset: 3px;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .home-alloy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #materials.home-alloys .container { width: calc(100% - 40px); }
  .home-alloy-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
  .home-alloy-hint { white-space: normal; }
  .home-alloy-grid { gap: 14px; }
  .home-alloy-card { padding: 18px 14px 14px; }
  .home-alloy-card h3 { font-size: 12px; }
  .home-alloy-grade { padding: 7px 8px; font-size: 12px; }
  .home-material-preview { width: min(300px, calc(100vw - 24px)); }
}
@media (max-width: 420px) {
  .home-alloy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .home-alloy-card,
  .home-alloy-card::before,
  .home-alloy-grade,
  .home-alloy-grade span,
  .home-material-preview,
  .home-material-preview-copy a,
  .home-alloy-hint-icon { transition: none; animation: none; }
  .home-alloy-card:hover,
  .home-alloy-grade:hover,
  .home-alloy-grade.is-active { transform: none; }
}

/* Match the site's navy, white and blue-gray surfaces. */
.home-alloy-hint { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: #647589; font-weight: 400; }
.home-alloy-card { border-radius: 6px; border-color: #d4dfe8; transition: border-color .15s ease; }
.home-alloy-card::before { content: none; }
.home-alloy-card:hover { transform: none; box-shadow: none; border-color: #9cabbc; }
.home-alloy-card-head { gap: 0; }
.home-alloy-family { padding: 0; border-radius: 0; background: none; color: #647589; font-weight: 500; }
.home-alloy-grade { border: 1px solid #cbd8e5; border-radius: 4px; background: #fff; min-height: 44px; font-weight: 600; }
.home-alloy-grade:hover, .home-alloy-grade:focus-visible, .home-alloy-grade.is-active { background: #eaf0f6; color: #173b62; box-shadow: none; transform: none; }
.home-alloy-grade:hover span, .home-alloy-grade:focus-visible span, .home-alloy-grade.is-active span { color: #173b62; transform: none; }
.home-material-preview { border-radius: 8px; max-height: calc(100dvh - 24px); overflow-y: auto; box-shadow: 0 12px 32px #102b4526; }
.home-material-preview-image::before, .home-material-preview-image::after { content: none; }
.home-material-preview-copy a { border-radius: 4px; }
@media (min-width: 901px) { .home-alloy-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 500px) {
 .home-alloy-card { padding: 16px 10px 10px; }
 .home-alloy-card h3 { font-size: 12px; letter-spacing: .02em; white-space: normal; }
 .home-alloy-grades { gap: 6px; }
 .home-alloy-grade { padding: 8px 4px; }
}
.home-alloy-card { border-color: #9eb3c9; background: #f1f5f9; border-top: 3px solid #234d75; }
.home-alloy-card h3 { color: #173b62; font-weight: 750; font-size: 14px; letter-spacing: .035em; }
.home-alloy-card-head { border-bottom-color: #c1d0de; }
.home-alloy-family { color: #3b5874; font-weight: 600; }
.home-alloy-grade { border-color: #9eb3c9; color: #163f69; background: #fff; }
.home-alloy-grade:hover, .home-alloy-grade.is-active, .home-alloy-grade:focus-visible { color: #fff; background: #234d75; border-color: #234d75; }
.home-alloy-grade:hover span, .home-alloy-grade.is-active span, .home-alloy-grade:focus-visible span { color: #fff; }
.home-material-preview { border-color: #9eb3c9; }
@media(max-width:500px) { .home-alloy-card h3 { font-size:12px; } }

.home-alloy-series-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
  margin-bottom: 14px;
}
.home-alloy-series-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-alloy-card .home-alloy-link {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #c1d0de;
}

.home-alloy-card .home-alloy-grade-label {
  justify-content: center;
  cursor: default;
  pointer-events: none;
}

.home-alloy-card:has(.home-alloy-series-photo) {
  padding-top: 0;
}
.home-alloy-series-photo {
  margin-inline: -18px;
  border-radius: 0;
}
@media (max-width: 760px) {
  .home-alloy-series-photo { margin-inline: -14px; }
}
@media (max-width: 500px) {
  .home-alloy-series-photo { margin-inline: -10px; }
}

#materials .home-alloy-card {
  background: #fff;
}
#materials .home-alloy-card-head {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
}
#materials .home-alloy-card h3 {
  margin: 0;
}
#materials .home-alloy-grades {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
}
#materials .home-alloy-grade-label {
  min-height: 0;
  padding: 4px 8px;
  border: 0;
  background: #edf3f8;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}
#materials .home-alloy-card .home-alloy-link {
  padding-top: 10px;
  border-color: #e1e8ef;
}

.home-alloy-series-photo > a {
  display: block;
  height: 100%;
}
.home-alloy-card .home-alloy-series-photo > a:focus-visible {
  outline-offset: -4px;
}
