/*
 * SmartStructure category detail pages
 * Shared presentation for every /building-materials/{category}/ page.
 */

/* Keep the requested site typeface even when JavaScript is unavailable. */
.cat-wrap .cat-hero h1 {
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif) !important;
  font-weight: 800 !important;
  letter-spacing: -0.035em !important;
}

.cat-wrap.ss-category-page {
  --ss-category-navy: #061b4f;
  --ss-category-blue: #064bc5;
  --ss-category-blue-dark: #03348f;
  --ss-category-yellow: #fbbf24;
  --ss-category-ink: #0b1d43;
  --ss-category-muted: #66748d;
  --ss-category-line: #e2e8f2;
  --ss-category-surface: #ffffff;
  --ss-category-page-bg: #f5f7fb;
  --ss-category-shadow: 0 15px 42px rgba(15, 35, 75, 0.08);
  --ss-category-hero-min-height: 300px;
  margin: 0;
  padding: 108px 20px 30px;
  background: var(--ss-category-page-bg);
  color: var(--ss-category-ink);
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
}

.ss-category-page,
.ss-category-page * {
  box-sizing: border-box;
}

.ss-category-page .ss-category-page__inner {
  width: min(1200px, 100%);
  max-width: 1200px;
  margin: 0 auto;
}

.ss-category-page .ss-category-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 16px;
  color: #7a879c;
  font-size: 12.5px;
  line-height: 1.5;
}

.ss-category-page .ss-category-breadcrumb a {
  color: #29436f;
  font-weight: 600;
  text-decoration: none;
}

.ss-category-page .ss-category-breadcrumb a:hover {
  color: var(--ss-category-blue);
}

/* Hero */
.ss-category-hero {
  position: relative;
  isolation: isolate;
  min-height: var(--ss-category-hero-min-height);
  display: flex;
  align-items: center;
  overflow: hidden;
  margin: 0 0 22px;
  padding: 42px 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(128deg, #06163f 0%, #07337f 62%, #092660 100%);
  box-shadow: 0 18px 42px rgba(4, 26, 76, 0.18);
}

.ss-category-hero__surface,
.ss-category-hero__image-layer,
.ss-category-hero__pattern,
.ss-category-hero__overlay,
.ss-category-hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ss-category-hero__surface {
  z-index: -6;
  background: linear-gradient(128deg, #06163f 0%, #07337f 62%, #092660 100%);
}

.ss-category-hero__image-layer {
  z-index: -5;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.ss-category-hero__pattern {
  z-index: -4;
  opacity: 0.26;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 45%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 4%, #000 45%, #000 100%);
}

.ss-category-hero__overlay {
  z-index: -3;
  opacity: 0;
}

.ss-category-hero__glow {
  z-index: -2;
  background:
    radial-gradient(circle at 86% 13%, rgba(255, 204, 48, 0.22), transparent 25%),
    linear-gradient(90deg, rgba(2, 14, 48, 0.5) 0%, rgba(2, 18, 57, 0.18) 52%, rgba(5, 26, 77, 0.02) 100%);
}

.ss-category-hero__content {
  position: relative;
  z-index: 3;
  width: min(65%, 690px);
}

.ss-category-hero__eyebrow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 13px;
}

.ss-category-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 6px 24px 6px 14px;
  color: #10224b;
  background: var(--ss-category-yellow);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 5px 50%);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 7px 16px rgba(251, 191, 36, 0.22);
}

.ss-category-hero__title {
  max-width: 760px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 0.22em;
  row-gap: 0.04em;
  margin: 0;
  color: #fff;
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif) !important;
  font-size: clamp(31px, 4.1vw, 52px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.06;
  text-wrap: balance;
}

.ss-category-hero__title > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ss-category-hero__title-highlight {
  color: var(--ss-category-yellow);
}

.ss-category-hero__description {
  max-width: 640px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.87);
  font-size: 14px;
  font-weight: 450;
  line-height: 1.65;
}

.ss-category-hero__trust {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 18px;
}

.ss-category-hero__trust-item,
.ss-category-hero__count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.ss-category-hero__trust-item img,
.ss-category-hero__count img {
  width: 24px;
  height: 24px;
  padding: 5px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 50%;
  background: rgba(5, 27, 76, 0.55);
  object-fit: contain;
}

.ss-category-hero__location {
  position: absolute;
  z-index: 5;
  top: 30px;
  right: -10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  padding: 13px 26px 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px 0 0 999px;
  color: #13264f;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(1, 13, 47, 0.18);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 750;
}

.ss-category-hero__location img {
  width: 23px;
  height: 23px;
}

.ss-category-hero__media {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: -5%;
  width: 45%;
  height: 88%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.ss-category-hero__product-image {
  display: block;
  width: min(100%, 500px);
  max-width: 500px;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 22px 22px rgba(1, 13, 43, 0.36));
  -webkit-mask-image: radial-gradient(ellipse 64% 62% at 52% 63%, #000 30%, rgba(0, 0, 0, 0.9) 48%, transparent 82%);
  mask-image: radial-gradient(ellipse 64% 62% at 52% 63%, #000 30%, rgba(0, 0, 0, 0.9) 48%, transparent 82%);
}

.ss-category-hero__media.is-missing {
  display: none;
}

/* Dealer / brand results */
.ss-category-page .ss-dealer-section {
  margin: 0 0 20px;
  padding: 25px 24px 28px;
  border: 1px solid #e8edf5;
  border-radius: 17px;
  background: var(--ss-category-surface);
  box-shadow: var(--ss-category-shadow);
}

.ss-dealer-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 21px;
}

.ss-dealer-section__heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
}

.ss-dealer-section__heading > div:last-child {
  min-width: 0;
}

.ss-dealer-section__icon {
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid #fde39a;
  border-radius: 50%;
  color: #a86b00;
  background: #fff8df;
}

.ss-dealer-section__icon svg {
  width: 22px;
  height: 22px;
}

.ss-category-page .ss-dealer-title {
  margin: 1px 0 4px;
  color: var(--ss-category-ink);
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ss-dealer-section__subtitle {
  margin: 0;
  color: var(--ss-category-muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ss-dealer-search {
  position: relative;
  flex: 0 1 310px;
  min-width: 230px;
}

.ss-dealer-search img {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  opacity: 0.75;
  pointer-events: none;
}

.ss-dealer-search input {
  width: 100%;
  height: 43px;
  padding: 0 43px 0 14px;
  border: 1px solid #dce3ee;
  border-radius: 8px;
  outline: none;
  color: var(--ss-category-ink);
  background: #fff;
  /* 16px prevents iOS Safari from auto-zooming the viewport on focus. */
  font: 500 16px/1.2 var(--font, 'Plus Jakarta Sans', sans-serif);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ss-dealer-search input::placeholder {
  color: #8a96a9;
}

.ss-dealer-search input:focus {
  border-color: #82a9ef;
  box-shadow: 0 0 0 4px rgba(6, 75, 197, 0.1);
}

.ss-dealer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.ss-dealer-card {
  min-width: 0;
  min-height: 166px;
  display: flex;
  flex-direction: column;
  padding: 15px 14px 13px;
  border: 1px solid #dfe5ee;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(13, 36, 80, 0.025);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ss-dealer-card:hover {
  border-color: #a9c2ee;
  transform: translateY(-3px);
  box-shadow: 0 13px 28px rgba(8, 48, 125, 0.09);
}

.ss-dealer-card[hidden] {
  display: none !important;
}

.ss-dealer-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 33px;
}

.ss-dealer-card__name {
  min-width: 0;
  margin: 0;
  color: #102047;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.ss-dealer-card__verified {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 5px;
  border: 1px solid #8eb7ff;
  border-radius: 3px;
  color: #1764d8;
  background: #f5f9ff;
  font-size: 7px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.ss-dealer-card__verified svg {
  width: 8px;
  height: 8px;
}

.ss-dealer-card__location {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  margin: 4px 0 7px;
  color: #6f7c91;
  font-size: 9.5px;
  line-height: 1.35;
}

.ss-dealer-card__location img {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
}

.ss-dealer-card__price {
  margin-top: auto;
  color: #164d9d;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.ss-dealer-card__button {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 9px;
  padding: 10px 10px;
  border: 0;
  border-radius: 5px;
  color: #fff !important;
  background: linear-gradient(100deg, #0b4dc0, #0355d6);
  box-shadow: 0 6px 12px rgba(5, 74, 190, 0.16);
  font-size: 9.5px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ss-dealer-card__button:hover {
  color: #fff !important;
  background: linear-gradient(100deg, #063da3, #0347b5);
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(5, 74, 190, 0.22);
}

.ss-dealer-empty {
  grid-column: 1 / -1;
  display: none;
  padding: 36px 20px;
  border: 1px dashed #cbd5e4;
  border-radius: 12px;
  color: var(--ss-category-muted);
  background: #f9fbfe;
  font-size: 13px;
  text-align: center;
}

.ss-dealer-empty.is-visible {
  display: block;
}

/* Horizontal benefits */
.ss-category-page .ss-benefits-section {
  margin: 0 0 20px;
  padding: 20px 22px;
  border: 1px solid #e8edf5;
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--ss-category-shadow);
}

.ss-benefits-section__title {
  margin: 0 0 17px;
  color: var(--ss-category-ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ss-benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ss-benefit-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 5px 18px;
  border-right: 1px solid #e1e6ee;
}

.ss-benefit-item:first-child {
  padding-left: 5px;
}

.ss-benefit-item:last-child {
  padding-right: 5px;
  border-right: 0;
}

.ss-benefit-item__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.ss-benefit-item__icon img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.ss-benefit-item h3 {
  margin: 1px 0 4px;
  color: #13264e;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.ss-benefit-item p {
  margin: 0;
  color: #7a8698;
  font-size: 8.5px;
  line-height: 1.55;
}

/* App download CTA */
.ss-category-page .ss-app-cta {
  position: relative;
  isolation: isolate;
  min-height: 188px;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin: 0;
  padding: 30px 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(3, 29, 80, 0.96), rgba(3, 54, 137, 0.92)),
    url('../dealer/patterns/blueprint-navy.svg') center / cover no-repeat;
  box-shadow: 0 16px 38px rgba(5, 34, 92, 0.16);
}

.ss-app-cta::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 70% 35%, rgba(32, 112, 232, 0.28), transparent 29%),
    linear-gradient(90deg, rgba(2, 22, 65, 0.76), transparent 58%);
  pointer-events: none;
}

.ss-app-cta__copy {
  position: relative;
  z-index: 2;
  width: min(63%, 670px);
  padding-left: 18%;
}

.ss-app-cta__title {
  margin: 0;
  color: #fff;
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif) !important;
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.ss-app-cta__title strong {
  color: var(--ss-category-yellow);
}

.ss-app-cta__text {
  max-width: 560px;
  margin: 9px 0 15px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10.5px;
  line-height: 1.55;
}

.ss-app-cta__stores {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.ss-app-cta__stores a {
  display: inline-flex;
  border-radius: 6px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.ss-app-cta__stores a:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.ss-app-cta__stores img {
  display: block;
  width: auto;
  height: 36px;
}

.ss-app-cta__phone {
  position: absolute;
  z-index: 1;
  right: 10%;
  bottom: -72px;
  width: 235px;
  max-width: 28%;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.3));
  transform: rotate(-1deg);
  pointer-events: none;
}

@media (max-width: 1080px) {
  .ss-category-hero__content {
    width: 66%;
  }

  .ss-category-hero__media {
    right: -3%;
    width: 46%;
    opacity: 0.9;
  }

  .ss-dealer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ss-app-cta__copy {
    padding-left: 7%;
  }
}

@media (max-width: 820px) {
  .cat-wrap.ss-category-page {
    padding: 96px 15px 24px;
  }

  .ss-category-hero {
    min-height: max(320px, var(--ss-category-hero-min-height));
    padding: 38px 28px;
  }

  .ss-category-hero__content {
    width: 76%;
  }

  .ss-category-hero__media {
    right: -12%;
    width: 54%;
    opacity: 0.48;
  }

  .ss-category-hero__glow {
    background: linear-gradient(90deg, rgba(2, 14, 48, 0.78) 0%, rgba(2, 18, 57, 0.48) 66%, rgba(5, 26, 77, 0.2) 100%);
  }

  .ss-category-hero__location {
    top: 20px;
    right: -8px;
    min-width: 138px;
    padding: 10px 19px 10px 14px;
    font-size: 11px;
  }

  .ss-dealer-section__header {
    align-items: stretch;
    flex-direction: column;
  }

  .ss-dealer-search {
    flex-basis: auto;
    width: 100%;
    min-width: 0;
  }

  .ss-dealer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ss-benefits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 0;
  }

  .ss-benefit-item:nth-child(2) {
    border-right: 0;
  }

  .ss-benefit-item:nth-child(3),
  .ss-benefit-item:nth-child(4) {
    padding-top: 18px;
    border-top: 1px solid #e1e6ee;
  }

  .ss-benefit-item:nth-child(3) {
    padding-left: 5px;
  }

  .ss-app-cta__copy {
    width: 70%;
    padding-left: 0;
  }

  .ss-app-cta__phone {
    right: 1%;
    bottom: -56px;
    max-width: 35%;
  }
}

@media (max-width: 560px) {
  .cat-wrap.ss-category-page {
    padding: 88px 11px 18px;
  }

  .ss-category-page .ss-category-breadcrumb {
    margin: 0 5px 11px;
    font-size: 11px;
  }

  .ss-category-hero {
    min-height: 390px;
    align-items: flex-start;
    padding: 72px 21px 28px;
    border-radius: 15px;
  }

  .ss-category-hero__content {
    width: 100%;
  }

  .ss-category-hero__title {
    font-size: clamp(28px, 9.5vw, 39px);
  }

  .ss-category-hero__description {
    max-width: 100%;
    font-size: 12.5px;
  }

  .ss-category-hero__media {
    right: -24%;
    bottom: -14%;
    width: 72%;
    height: 65%;
    opacity: 0.2;
  }

  .ss-category-hero__eyebrow {
    font-size: 9px;
  }

  .ss-category-hero__trust {
    gap: 9px 13px;
  }

  .ss-category-hero__count {
    width: 100%;
  }

  .ss-category-hero__location {
    right: 11px;
    min-width: 0;
    padding: 9px 13px;
    border-radius: 999px;
  }

  .ss-category-page .ss-dealer-section {
    padding: 20px 14px;
    border-radius: 14px;
  }

  .ss-dealer-section__icon {
    width: 39px;
    height: 39px;
  }

  .ss-dealer-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ss-dealer-card {
    min-height: 156px;
  }

  .ss-category-page .ss-benefits-section {
    padding: 18px 14px;
  }

  .ss-benefits-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ss-benefit-item,
  .ss-benefit-item:first-child,
  .ss-benefit-item:nth-child(3),
  .ss-benefit-item:last-child {
    padding: 13px 3px;
    border-top: 1px solid #e1e6ee;
    border-right: 0;
  }

  .ss-benefit-item:first-child {
    padding-top: 3px;
    border-top: 0;
  }

  .ss-app-cta {
    min-height: 245px;
    align-items: flex-start;
    padding: 28px 21px !important;
  }

  .ss-app-cta__copy {
    width: 100%;
  }

  .ss-app-cta__text {
    width: 75%;
  }

  .ss-app-cta__phone {
    right: -14%;
    bottom: -42px;
    width: 190px;
    max-width: 52%;
    opacity: 0.82;
  }

  .ss-app-cta__stores img {
    height: 32px;
  }
}

@media (max-width: 380px) {
  .ss-category-hero {
    height: auto;
    min-height: 390px;
    padding: 66px 17px 32px;
  }

  .ss-category-hero__location {
    top: 16px;
    right: 8px;
    max-width: calc(100% - 16px);
  }

  .ss-app-cta__text {
    position: relative;
    z-index: 2;
    width: 100%;
  }

  .ss-app-cta__stores {
    position: relative;
    z-index: 2;
  }

  .ss-app-cta__phone {
    right: -24%;
    max-width: 62%;
    opacity: 0.2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ss-category-page *,
  .ss-category-page *::before,
  .ss-category-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
