/* ===== SMART Brand Directory UI Phase 1.4 ===== */

html.smart-brand-ui-ready {
  scroll-behavior: smooth;
}

body.smart-brand-ui-ready {
  --smart-chip-radius: 18px;
  --smart-card-radius: 22px;
  --smart-shadow-sm: 0 8px 22px rgba(17, 24, 39, 0.07);
  --smart-shadow-md: 0 18px 46px rgba(17, 24, 39, 0.14);
  --smart-transition: 260ms cubic-bezier(.2,.7,.2,1);
}

/* Brand chips */
.smart-brand-chip-container {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px !important;
  align-items: stretch;
}

@media (min-width: 980px) {
  .smart-brand-chip-container {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.smart-brand-chip-item {
  min-width: 0;
}

.smart-brand-chip {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  border-radius: var(--smart-chip-radius) !important;
  transition:
    transform var(--smart-transition),
    box-shadow var(--smart-transition),
    background-color var(--smart-transition),
    border-color var(--smart-transition),
    color var(--smart-transition) !important;
  will-change: transform;
}

.smart-brand-chip:hover {
  transform: translateY(-3px);
  box-shadow: var(--smart-shadow-sm);
}

.smart-brand-chip.smart-brand-chip-all {
  grid-column: 1 / -1;
}

/* Animation */
.smart-animated-reveal {
  opacity: 0;
  transform: translateY(22px) scale(.99);
  transition:
    opacity 620ms ease,
    transform 620ms cubic-bezier(.2,.7,.2,1);
}

.smart-animated-reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.smart-delay-1 { transition-delay: 20ms; }
.smart-delay-2 { transition-delay: 60ms; }
.smart-delay-3 { transition-delay: 100ms; }
.smart-delay-4 { transition-delay: 140ms; }
.smart-delay-5 { transition-delay: 180ms; }
.smart-delay-6 { transition-delay: 220ms; }
.smart-delay-7 { transition-delay: 260ms; }
.smart-delay-8 { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  .smart-animated-reveal,
  .smart-animated-reveal.is-visible,
  .smart-brand-chip,
  .smart-product-card,
  .smart-product-card img {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* Product card: natural flex layout, no absolute CTA */
.smart-product-grid {
  align-items: stretch !important;
  gap: 24px !important;
}

.smart-product-card {
  overflow: hidden !important;
  border-radius: var(--smart-card-radius) !important;
  background: #fff;
  display: flex !important;
  flex-direction: column !important;
  height: var(--smart-card-row-height, auto) !important;
  min-height: 500px !important;
  padding-bottom: 0 !important;
  transition:
    transform var(--smart-transition),
    box-shadow var(--smart-transition),
    border-color var(--smart-transition);
  will-change: transform;
  isolation: isolate;
}

.smart-product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--smart-shadow-md);
}

.smart-card-media {
  height: 220px !important;
  max-height: 220px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
  flex: 0 0 220px !important;
}

.smart-product-card img {
  width: 100% !important;
  height: 220px !important;
  max-height: 220px !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  margin: 0 auto !important;
  transition: transform 520ms cubic-bezier(.2,.7,.2,1);
}

.smart-product-card:hover img {
  transform: scale(1.025);
}

.smart-card-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.smart-cta-holder {
  margin-top: auto !important;
  padding-top: 18px !important;
}

.smart-product-cta {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  align-self: flex-start !important;
  z-index: 1 !important;
}

.smart-product-card .smart-title-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.smart-product-card .smart-desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pagination alignment */
.smart-pagination-area {
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 14px !important;
  margin: 28px auto 58px !important;
  text-align: center !important;
}

.smart-pagination-area > * {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.smart-pagination-area input,
.smart-pagination-area select {
  text-align: center !important;
}

/* Detail page readability */
body.single-product .smart-oldsite-spec-block,
body.single-product .smart-oldsite-intro-block,
body.single-product .smart-oldsite-overview-block,
body.single-product .smart-oldsite-download-block {
  line-height: 1.72 !important;
  word-break: normal;
  overflow-wrap: anywhere;
}

body.single-product .smart-oldsite-spec-block p,
body.single-product .smart-oldsite-intro-block p,
body.single-product .smart-oldsite-overview-block p {
  margin: 0 0 .72rem !important;
}

body.single-product .smart-oldsite-spec-block br + br,
body.single-product .smart-oldsite-intro-block br + br,
body.single-product .smart-oldsite-overview-block br + br {
  display: none;
}

body.single-product .smart-spec-clean-list {
  padding: 0 !important;
  margin: 0 !important;
}

body.single-product .smart-spec-clean-card {
  padding: 0 !important;
}

body.single-product .smart-spec-clean-card h3 {
  font-size: 1.05rem !important;
  letter-spacing: .04em;
  color: #64748b;
  margin: 0 0 .85rem !important;
  text-transform: uppercase;
}

body.single-product .smart-spec-lead {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin-bottom: .55rem !important;
}

body.single-product .smart-spec-points {
  margin: 1rem 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
  display: grid;
  gap: .62rem;
}

body.single-product .smart-spec-points li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 1rem !important;
  font-weight: 500 !important;
  color: #172033 !important;
  line-height: 1.72 !important;
}

body.single-product .smart-spec-points li::before {
  content: "";
  width: .42rem;
  height: .42rem;
  border-radius: 999px;
  background: #334155;
  position: absolute;
  left: 0;
  top: .68em;
}

body.single-product .smart-spec-points li.smart-spec-subhead {
  padding-left: 0;
  margin-top: .35rem;
  font-weight: 800 !important;
  color: #0f172a !important;
}

body.single-product .smart-spec-points li.smart-spec-subhead::before {
  display: none;
}

.smart-stat-box {
  transition:
    transform var(--smart-transition),
    box-shadow var(--smart-transition);
}

.smart-stat-box:hover {
  transform: translateY(-3px);
  box-shadow: var(--smart-shadow-sm);
}
