/* AI computing (owner 18-19 Nov 2026, pages/ai.js): product cards in the hardware store layout and the product pop-up.
   The pop-up's frame, head, big figures, buy box and spec tables are the containers' (containers.css .ct-*); this file
   adds the cards, the accelerator / memory / price-per-GB marks, the product page's offer rows inside the pop-up, and the
   running-cost box with its own electricity price. Nested corners: inner radius = outer − padding. */

/* the cards */
.aic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 4px; }
.aic { position: relative; display: flex; flex-direction: column; padding: 8px; border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--card));
  cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.aic:hover { border-color: hsl(var(--foreground) / .35); box-shadow: var(--bm-shadow-hi); transform: translateY(-2px); }
.aic.is-partner { border-color: transparent; background: linear-gradient(var(--cta-soft), hsl(var(--card)) 46%); }
.aic-img { display: grid; place-items: center; height: 168px; border-radius: 8px; background: #fff; border: 1px solid hsl(var(--border) / .7); overflow: hidden; }
.aic-img img { width: auto; height: auto; max-width: 78%; max-height: 148px; object-fit: contain; transition: transform .25s ease; }
.aic:hover .aic-img img { transform: scale(1.04); }
.aic-img--none { background: var(--bm-surface2); border-color: transparent; }
.aic-img--none img { width: 48px; height: 48px; }
.aic-tags { position: absolute; top: 16px; left: 16px; display: flex; gap: 6px; }
.aic-type { font-size: 11.5px; font-weight: 700; line-height: 1; padding: 5px 8px; border-radius: 6px; background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.aic-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px 4px; flex: 1; }
.aic-body .fbadge { margin: 0 0 2px; }
.aic-mk { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.aic-name { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; min-height: 2.6em; }
.aic-name a { color: var(--title); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aic-name a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.aic-acc { margin-top: 4px; }
.aic-acc .ai-sub { display: inline; margin: 0 0 0 6px; }
.aic-specs { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid hsl(var(--border)); }
.aic-specs div { min-width: 0; }
.aic-specs dt { margin: 0 0 4px; font-size: 11.5px; font-weight: 600; color: hsl(var(--muted-foreground)); }
.aic-specs dd { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.aic-specs .ai-big { font-size: 15px; }
.aic-specs .ai-mt { font-size: 11.5px; line-height: 1.3; }
.aic-specs .ai-bar { width: 100%; max-width: 92px; margin-top: 4px; }
.aic-specs .ai-na { font-size: 12.5px; }
.aic-specs .ai-pgb { font-size: 13.5px; padding: 2px 7px; }
.aic-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 12px 8px 6px; border-top: 1px solid hsl(var(--border)); }
.aic-pr { display: flex; flex-direction: column; min-width: 0; }
.aic-pl { font-size: 11.5px; color: hsl(var(--muted-foreground)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aic-pr b { font-size: 21px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--title); }
.aic-pr b.aic-q { font-size: 16px; }
.aic-go { flex: none; padding: 7px 12px; border-radius: 9px; font-size: 13px; }
.aic-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: hsl(var(--muted-foreground)); }
.aic-sort select { height: 36px; width: auto; font-size: 14px; }
.aic-foot-note { margin-top: 16px; }

/* the marks a card and the pop-up share */
.ai-acc { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.ai-chip, .ai-n { white-space: nowrap; }
.ai-n { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ai-chip { display: inline-block; font-size: 12.5px; font-weight: 700; line-height: 1.5; padding: 1px 8px; border-radius: 6px; background: var(--bm-lime); color: #05603a; }
.ai-chip--amd { background: #fde8ea; color: #a3142f; }
.ai-chip--open { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.ai-sub { font-size: 12px; color: hsl(var(--muted-foreground)); }
.ai-big { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--title); }
.ai-big small { margin-left: 1px; font-size: 11.5px; font-weight: 600; color: hsl(var(--muted-foreground)); }
.ai-mt { color: hsl(var(--muted-foreground)); }
.ai-bar { display: block; height: 5px; border-radius: 99px; background: hsl(var(--muted)); overflow: hidden; }
.ai-bar i { display: block; height: 100%; border-radius: inherit; background: var(--bm-green); }
.ai-na { color: hsl(var(--muted-foreground)); line-height: 1.35; }
.ai-pgb { display: inline-block; border-radius: 8px; background: hsl(var(--muted)); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-pgb small { font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); }
.ai-pgb--good { background: var(--bm-lime); color: #05603a; }
.ai-pgb--good small { color: #05603a; opacity: .75; }

/* the pop-up: the whole machine shows in the photo frame (sellers' shots, not banners) */
.aip-photo { position: relative; }
.aip-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 18px; box-sizing: border-box; }
/* running cost: its own power price (the site-wide setting) and hours a day */
.aip-fill-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.aip-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.aip-elec { margin-left: 0; font-size: 13px; }
.aip-elec input { width: 92px; height: 34px; font-size: 14px; }
.aip-run { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.aip-hrs { height: 34px; padding: 0 8px; border: 1px solid hsl(var(--field-border, var(--border))); border-radius: 8px; background: hsl(var(--card)); color: inherit; font: inherit; font-size: 13px; }
.aip-secs { grid-template-columns: repeat(3, minmax(0, 1fr)); }

:root[data-theme="dark"] .ai-chip, :root[data-theme="dark"] .ai-pgb--good, :root[data-theme="dark"] .ai-pgb--good small { color: #7be3ad; }
:root[data-theme="dark"] .aic-img, :root[data-theme="dark"] .aip-photo { background: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .ai-chip, :root:not([data-theme]) .ai-pgb--good { color: #7be3ad; } }
@media (prefers-reduced-motion: reduce) { .aic, .aic-img img { transition: none; } .aic:hover { transform: none; } }

@media (max-width: 900px) { .aip-secs { grid-template-columns: minmax(0, 1fr); } }
/* phones: two cards per row, a compact card; the details stay in the pop-up */
@media (max-width: 640px) {
  .aic-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .aic { padding: 6px; border-radius: 14px; }
  .aic:hover { transform: none; }
  .aic-img { height: 118px; border-radius: 8px; }
  .aic-img img { max-height: 104px; }
  .aic-tags { display: none; }
  .aic-body { padding: 10px 4px 2px; gap: 3px; }
  .aic-name { font-size: 14px; }
  .aic-acc .ai-sub { display: none; }
  .aic-acc .ai-n { font-size: 13.5px; }
  .aic-acc .ai-chip { font-size: 11.5px; padding: 0 6px; }
  .aic-specs { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; padding-top: 8px; }
  .aic-specs .aic-pow, .aic-specs .ai-bar { display: none; }
  .aic-specs .ai-big { font-size: 14px; }
  .aic-foot { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 8px; padding: 8px 4px 4px; }
  .aic-pr b { font-size: 18px; }
  .aic-go { justify-content: center; text-align: center; }
  .aic-sort span { display: none; }
}
