/* ============================================================
   KAISON product templates: single-product.php,
   template-product-category.php (ice type), template-product-
   category-machine-type.php, product archives.
   Loaded together with home.css (section design system).
   ============================================================ */

/* ---------- Breadcrumb ---------- */
.kaison-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 22px 0 6px;
  color: var(--color-cool-gray);
  font-size: 13px;
}
.kaison-crumbs a {
  color: var(--color-slate);
  text-decoration: none;
}
.kaison-crumbs a:hover { color: var(--color-precision-blue); }
.kaison-crumbs .crumb-current {
  color: var(--color-cool-gray);
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Single product: simple photo + spec hero ----------
   Matches the reference layout: one bordered product photo, title,
   divider, spec table, optional capacity pills, full-width CTA. */
.product-hero-simple {
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 26px 0 40px;
}
.p-photo-box {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--color-line-gray);
  border-radius: var(--radius-lg);
  background: var(--color-white);
}
.p-photo-box .p-photo-img,
.p-photo-box .p-gallery-ph {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  display: block;
}
.p-gallery-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(rgba(216,225,232,.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,225,232,.4) 1px, transparent 1px);
  background-size: 24px 24px;
  background-color: var(--color-mist);
  color: var(--color-cool-gray);
  font-size: 14px;
}
/* Product names are long descriptive strings ("KS-100F 15-25kg/24h
   Anti-Corrosion Gourmet Cube Ice Machine"), not short marketing
   headlines — the site's H1 scale (44px) makes them tower over the
   compact photo + spec table next to them, so this page gets its own
   smaller title scale instead of inheriting .kaison-page h1. */
.p-summary h1 {
  margin: 0 0 22px;
  font-size: 28px;
  line-height: 36px;
}
@media (max-width: 1023px) {
  .p-summary h1 { font-size: 24px; line-height: 32px; }
}
@media (max-width: 639px) {
  .p-summary h1 { font-size: 21px; line-height: 28px; }
}
.p-divider {
  height: 0;
  margin: 0 0 24px;
  border: 0;
  border-top: 1px solid var(--color-line-gray);
}
.p-spec-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 26px 0 14px;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}
.p-spec-head::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-precision-blue);
}
.p-summary .p-spec-head:first-of-type { margin-top: 0; }
.p-summary .p-spec-wrap,
.p-summary .p-spec-table { max-width: none; }
.p-variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.p-variant-list span {
  padding: 10px 18px;
  border: 1px solid var(--color-line-gray);
  border-radius: var(--radius-sm);
  color: var(--color-slate);
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 700;
}
.p-inquiry-cta { margin-top: 30px; }
.p-inquiry-cta .btn.block {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.p-inquiry-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--color-slate);
  font-size: 13.5px;
  text-decoration: none;
}
.p-inquiry-wa svg { width: 16px; height: 16px; color: #25d366; }
.p-inquiry-wa:hover { color: var(--color-precision-blue); }

.p-lede {
  margin: 14px 0 0;
  color: var(--color-slate);
  font-size: 17px;
  line-height: 1.65;
  max-width: 640px;
}

/* Trust bullets under CTAs */
.p-trust {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.p-trust li {
  position: relative;
  padding-left: 24px;
  color: var(--color-slate);
  font-size: 14px;
}
.p-trust li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-glacier-blue);
  box-shadow: inset 0 0 0 4px var(--color-white), inset 0 0 0 14px var(--color-steel-cyan);
}

/* ---------- Shared section block ---------- */
.p-block { padding: 34px 0; }
.p-content {
  max-width: 860px;
  color: var(--color-slate);
  line-height: 1.7;
}
.p-content ul { padding-left: 22px; }
.p-content li { margin-bottom: 8px; }
.p-content img { border-radius: var(--radius-md); border: 1px solid var(--color-line-gray); }

/* ---------- Spec table ---------- */
.p-spec-wrap { overflow-x: auto; }
.p-spec-table {
  width: 100%;
  max-width: 860px;
  border-collapse: collapse;
  border: 1px solid var(--color-line-gray);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-white);
  font-size: 15px;
}
.p-spec-table th,
.p-spec-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-line-gray);
  text-align: left;
  vertical-align: top;
}
.p-spec-table tr:last-child th,
.p-spec-table tr:last-child td { border-bottom: 0; }
.p-spec-table th {
  width: 240px;
  background: var(--color-mist);
  color: var(--color-ink);
  font-weight: 600;
  white-space: nowrap;
}
.p-spec-table td {
  color: var(--color-slate);
  font-family: var(--font-data);
  font-size: 14px;
}

/* ---------- Description / Detail / Contact tabs ----------
   CSS-only: radio inputs + general-sibling selectors, no JS. All
   three panels stay in the DOM (just visually hidden), so crawlers
   still see the full content — only the presentation is tabbed. */
.p-tabs { position: relative; }
.p-tab-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.p-tab-labels {
  display: flex;
  gap: 40px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--color-line-gray);
}
.p-tab-labels label {
  padding: 8px 2px 18px;
  border-bottom: 2px solid transparent;
  color: var(--color-cool-gray);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}
.p-tab-labels label:hover { color: var(--color-ink); }
.p-tab-panel { display: none; }
.p-tab-panel .p-content { max-width: none; }
.p-tab-empty {
  margin: 0;
  padding: 32px 0;
  color: var(--color-cool-gray);
  font-size: 14.5px;
}
#tab-desc:checked ~ .p-tab-labels label[for="tab-desc"],
#tab-detail:checked ~ .p-tab-labels label[for="tab-detail"],
#tab-contact:checked ~ .p-tab-labels label[for="tab-contact"] {
  border-bottom-color: var(--color-ink);
  color: var(--color-ink);
}
#tab-desc:checked ~ .p-tab-panel-desc,
#tab-detail:checked ~ .p-tab-panel-detail,
#tab-contact:checked ~ .p-tab-panel-contact,
.p-tab-panel-contact:target {
  display: block;
}
.p-tab-panel-contact:target { scroll-margin-top: 130px; }
/* A direct #product-contact link (hero CTA) always wins over whichever
   tab happens to be checked, so two panels never show at once. */
.p-tabs:has(.p-tab-panel-contact:target) .p-tab-panel-desc,
.p-tabs:has(.p-tab-panel-contact:target) .p-tab-panel-detail {
  display: none;
}
.p-tabs:has(.p-tab-panel-contact:target) .p-tab-labels label {
  border-bottom-color: transparent;
  color: var(--color-cool-gray);
}
.p-tabs:has(.p-tab-panel-contact:target) .p-tab-labels label[for="tab-contact"] {
  border-bottom-color: var(--color-ink);
  color: var(--color-ink);
}
.p-detail-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.p-detail-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--color-line-gray);
  border-radius: var(--radius-md);
}

/* ---------- Product grid + cards ---------- */
/* auto-fit + minmax: settles near 4 columns wide, but a thin catalog
   (new categories, few related items) fills the row instead of leaving
   empty tracks next to a lone card. */
.p-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.p-card {
  display: flex;
  flex-direction: column;
  max-width: 320px;
  border: 1px solid var(--color-line-gray);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  overflow: hidden;
  transition: box-shadow .18s ease, transform .18s ease;
}
.p-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}
.p-card-media {
  display: block;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-line-gray);
}
.p-card-media img,
.p-card-ph {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  padding: 14px;
  display: block;
}
.p-card-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-mist);
  color: var(--color-cool-gray);
  font-size: 13px;
}
.p-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  flex: 1;
}
.p-card-body h3 {
  margin: 0;
}
.p-card-body h3 a {
  color: var(--color-ink);
  text-decoration: none;
}
.p-card-body h3 a:hover { color: var(--color-precision-blue); }
.p-card-body p {
  margin: 0;
  color: var(--color-cool-gray);
  font-size: 13.5px;
  line-height: 21px;
}
.p-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.p-card-meta span {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-mist);
  color: var(--color-slate);
  font-family: var(--font-data);
  font-size: 12px;
}
.p-card-body .card-link { margin-top: auto; }

/* Empty category state */
.p-empty {
  padding: 40px 28px;
  border: 1px dashed var(--color-line-gray);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  text-align: center;
}
.p-empty p {
  margin: 0 auto 18px;
  max-width: 560px;
  color: var(--color-slate);
}

/* ---------- Prev / next products ---------- */
.p-prevnext {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 40px;
}
.p-prevnext a {
  color: var(--color-slate);
  font-size: 14px;
  text-decoration: none;
}
.p-prevnext a:hover { color: var(--color-precision-blue); }
.p-prevnext .p-next { margin-left: auto; text-align: right; }

/* ---------- Dark landing hero (category + application pages) ----------
   Reuses home.css .page-hero (graphite bg + grid pattern); these rules
   adapt the landing-specific pieces (crumbs, lede, trust list, photo). */
.kaison-category-landing,
.kaison-application-landing { padding-top: 0; }
.hero-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
}
.hero-crumbs a { color: #9fb3c2; text-decoration: none; }
.hero-crumbs a:hover { color: var(--color-white); }
.hero-crumbs span { color: #6b7f8e; }
.hero-crumbs .crumb-current {
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-hero .p-lede {
  margin: 16px 0 0;
  max-width: 640px;
  color: #c8d5df;
  font-size: 16px;
  line-height: 27px;
}
.page-hero .hero-actions { margin-top: 26px; }
.page-hero .p-trust li { color: #c8d5df; }
.page-hero .p-trust li::before {
  box-shadow: inset 0 0 0 4px var(--color-deep-graphite), inset 0 0 0 14px var(--color-steel-cyan);
  background: transparent;
}
.landing-hero .app-hero-media {
  border-color: rgba(255, 255, 255, .18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

/* ---------- Category landing hero ---------- */
.cat-landing-hero {
  padding: 26px 0 10px;
}
.cat-landing-hero h1 { margin-top: 10px; }

/* Application landing hero: text + scenario photo */
.app-landing-hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 36px;
  align-items: center;
}
.app-hero-media {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-line-gray);
  border-radius: var(--radius-lg);
  background: var(--color-white);
}
.app-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
/* Category landing heroes use product cutouts on white: show the whole
   machine instead of cropping it to the 4:3 scenario-photo frame. */
.kaison-category-landing .app-hero-media img {
  object-fit: contain;
  padding: 18px;
  background: var(--color-white);
}
@media (max-width: 1024px) {
  .app-landing-hero { grid-template-columns: 1fr; gap: 22px; }
}
.cat-landing-guide {
  border-top: 1px solid var(--color-line-gray);
  border-bottom: 1px solid var(--color-line-gray);
  background: var(--color-white);
  max-width: none;
  width: 100%;
}
.cat-landing-guide .p-content { margin: 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .product-hero-simple {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .p-photo-box { max-width: 360px; }
  .p-detail-gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .p-grid { gap: 12px; }
  .p-block { padding: 24px 0; }
  .p-spec-table th { width: 150px; white-space: normal; }
  .kaison-crumbs { padding-top: 14px; }
  .kaison-crumbs .crumb-current { max-width: 24ch; }
  .p-tab-labels { gap: 24px; }
  .p-tab-labels label { font-size: 13.5px; padding-bottom: 14px; }
  .p-detail-gallery { grid-template-columns: 1fr; }
}
@media (max-width: 479px) {
  .p-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Template identity themes — ice-type / machine-type / application
   landings share the same section components (why-grid, flow-grid,
   facility-scroller, stat-band...) but each gets its own accent
   color and one signature hero component, so a visitor can tell
   which kind of category page they are on without reading copy.
   ============================================================ */

/* ---------- Ice Type: icy cyan accent + ice-shape swatch strip ---------- */
.kaison-ice-type-landing .kicker { color: var(--precision-blue); }
.kaison-ice-type-landing .page-hero .kicker { color: #8fe6ef; }
.kaison-ice-type-landing .why-card:hover,
.kaison-ice-type-landing .flow-card:hover::before { border-color: var(--color-steel-cyan); }
.kaison-ice-type-landing .flow-card::before { background: var(--color-steel-cyan); }
.kaison-ice-type-landing .p-trust li::before {
  box-shadow: inset 0 0 0 4px var(--color-deep-graphite), inset 0 0 0 14px var(--color-steel-cyan);
}

.shape-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.shape-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #c8d5df;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.shape-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-white);
}
.shape-chip:hover { border-color: var(--color-steel-cyan); color: #fff; }
.shape-chip.active {
  border-color: var(--color-steel-cyan);
  background: rgba(22, 166, 182, .22);
  color: #fff;
}

/* ---------- Machine Type: technical / blueprint accent ---------- */
.kaison-machine-type-landing .kicker { color: var(--color-precision-blue); font-family: var(--font-data); letter-spacing: .07em; }
.kaison-machine-type-landing .page-hero .kicker { color: #9fd4ff; font-family: var(--font-data); letter-spacing: .07em; }
.kaison-machine-type-landing #configuration .section-head,
.kaison-machine-type-landing #models .section-head { color: var(--color-white); }

.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 26px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, .16);
}
.spec-strip-item { padding: 14px 16px; background: rgba(9, 18, 27, .6); }
.spec-strip-item span {
  display: block;
  color: #8ea3b3;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.spec-strip-item strong {
  display: block;
  margin-top: 5px;
  color: var(--color-white);
  font-family: var(--font-data);
  font-size: 14px;
  line-height: 1.3;
}

/* Model spec-comparison table (machine-type's stand-in for the photo
   card grid — configuration buyers scan rows, not product photos). */
.model-compare-wrap { overflow-x: auto; }
.model-compare {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--color-white);
  border: 1px solid var(--color-line-gray);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 14px;
}
.model-compare thead th {
  padding: 12px 14px;
  background: var(--color-deep-graphite);
  color: var(--color-white);
  font-family: var(--font-data);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: left;
  white-space: nowrap;
}
.model-compare td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-line-gray);
  color: var(--color-slate);
  vertical-align: middle;
}
.model-compare tr:last-child td { border-bottom: 0; }
.model-compare tr:nth-child(even) td { background: var(--color-polar-white); }
.model-compare .mc-photo {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: var(--color-mist);
  border-radius: 4px;
}
.model-compare .mc-photo-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--color-mist);
  border-radius: 4px;
  color: var(--color-cool-gray);
  font-size: 9px;
  text-align: center;
}
.model-compare .mc-model { font-family: var(--font-data); font-weight: 700; color: var(--color-ink); white-space: nowrap; }
.model-compare a.mc-link { color: var(--color-precision-blue); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; }
.model-compare a.mc-link:hover { text-decoration: underline; }

/* ---------- Application: warm, real-world-proof accent ---------- */
.kaison-application-landing .kicker { color: var(--color-signal-amber); }
.kaison-application-landing .page-hero .kicker { color: #ffd699; }
.kaison-application-landing .flow-card::before { background: var(--color-signal-amber); }

.scenario-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.scenario-fact {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid rgba(245, 165, 36, .45);
  border-radius: 999px;
  background: rgba(245, 165, 36, .12);
}
.scenario-fact strong { color: #ffd699; font-family: var(--font-data); font-size: 13.5px; }
.scenario-fact span { color: #c8d5df; font-size: 12.5px; }

@media (max-width: 1024px) {
  .spec-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .shape-chip { font-size: 12px; padding: 4px 12px 4px 4px; }
  .shape-chip img { width: 24px; height: 24px; }
  .model-compare { font-size: 13px; }
  .model-compare .mc-photo,
  .model-compare .mc-photo-ph { width: 40px; height: 40px; }
}
