/* ICE-IT shared components — used by home and catalog
 * Rule: this file contains only component implementations that are
 * reused between pages. Page-specific overrides live in home.css/catalog.css.
 */

/* ---------- Product grid ---------- */
.ice-grid { display: grid; gap: var(--ice-s-5); }
.ice-grid--products { grid-template-columns: repeat(3, 1fr); gap: var(--ice-s-5); }

/* ---------- Product card (base) ----------
 * Shared between popular-products on home and catalog grid.
 * Per-page overrides (grid size, image ratio) go to catalog.css / home.css.
 */
.ice-card {
  background: #fff; border: 1px solid var(--ice-line);
  border-radius: var(--ice-r-3); overflow: hidden;
  display: flex; flex-direction: column;
  transition: .2s var(--ice-ease);
}
/* Hover effect applies only to product cards (catalog + home popular).
 * Plain .ice-card (e.g. on delivery/about pages) stays static. */
.ice-card--product:hover { box-shadow: var(--ice-sh-2); border-color: var(--ice-primary-50); }

.ice-card__media {
  display: block; position: relative;
  aspect-ratio: 4/3;
  background: var(--ice-soft); overflow: hidden;
}
.ice-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ice-card__placeholder {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #2a3858 0%, #0e1a33 100%);
}

.ice-card__body {
  padding: var(--ice-s-4);
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
}

.ice-card__sku {
  font-size: 11px; color: var(--ice-muted);
  text-transform: uppercase; letter-spacing: .04em;
}

.ice-card__title {
  margin: 0;
  font: 700 var(--ice-fs-md)/1.25 var(--ice-font-sans);
  color: var(--ice-ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}
.ice-card__title a { color: inherit; text-decoration: none; }
.ice-card__title a:hover { color: var(--ice-primary); }

.ice-card__meta {
  margin: 0;
  display: flex; flex-direction: column; gap: 2px;
  font-size: var(--ice-fs-sm); color: var(--ice-muted);
}
.ice-card__meta > div { display: flex; gap: 6px; }
.ice-card__meta dt { color: var(--ice-muted); margin: 0; font-weight: 400; }
.ice-card__meta dd { color: var(--ice-ink-2); margin: 0; }

.ice-card__price {
  font: 800 1.375rem/1 var(--ice-font-sans);
  color: var(--ice-primary);
  margin-top: 4px;
}
.ice-card__price--ask {
  font-size: var(--ice-fs-base); font-weight: 700; color: var(--ice-ink);
}

.ice-card__actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: var(--ice-s-3);
}

/* Product modifier — shared card with a stock badge on top-right */
.ice-card--product .ice-badge {
  position: absolute; top: 10px; right: 10px; left: auto;
  padding: 5px 10px; border-radius: 6px;
  font: 600 11px/1.2 var(--ice-font-sans);
  letter-spacing: .02em; text-transform: none;
}
.ice-badge--stock { background: var(--ice-success); color: #fff; }
.ice-badge--order { background: #f59e0b; color: #fff; }

/* Small button variant */
.ice-btn--sm { padding: 8px 12px; font-size: var(--ice-fs-sm); border-radius: 8px; }

/* ---------- Pagination ---------- */
.ice-pager {
  margin: var(--ice-s-6) 0 0;
  display: flex; justify-content: center;
}
.ice-pager ul.page-numbers {
  display: flex; gap: 6px; padding: 0; margin: 0;
  list-style: none; flex-wrap: wrap; justify-content: center;
}
.ice-pager li { display: block; }
.ice-pager li > a.page-numbers,
.ice-pager li > span.page-numbers {
  display: grid; place-items: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border-radius: 8px; background: #fff;
  border: 1px solid var(--ice-line); color: var(--ice-ink-2);
  font: 600 var(--ice-fs-sm)/1 var(--ice-font-sans);
  text-decoration: none;
}
.ice-pager li > span.page-numbers.current {
  background: var(--ice-primary); color: #fff; border-color: var(--ice-primary);
}
.ice-pager li > a.page-numbers:hover {
  border-color: var(--ice-primary); color: var(--ice-primary);
}
.ice-pager li > span.page-numbers.dots {
  border: 0; background: transparent; color: var(--ice-muted);
}

/* ---------- Section head ----------
 * Shared block-title: "H2 + (optional sub/link)".
 * Two modifiers:
 *  --center  : stacks vertically, centered.
 *  --simple  : just a centered <h2>, no row layout. Used by static pages.
 */
.ice-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 0 var(--ice-s-6); gap: var(--ice-s-4); flex-wrap: wrap;
}
.ice-section-head h2 {
  margin: 0;
  font: 700 clamp(1.5rem, 2.4vw, 2rem)/1.2 var(--ice-font-sans);
  color: var(--ice-ink);
}
.ice-section-head__sub { margin: 8px 0 0; color: var(--ice-muted); font-size: var(--ice-fs-md); }
.ice-section-head__link { color: var(--ice-primary); font-weight: 600; white-space: nowrap; }
.ice-section-head--center { flex-direction: column; align-items: center; text-align: center; }
.ice-section-head--center h2 { text-align: center; }

/* ---------- Empty state (no results) ---------- */
.ice-empty {
  padding: var(--ice-s-7) var(--ice-s-5);
  text-align: center;
  background: var(--ice-soft);
  border-radius: var(--ice-r-3);
  color: var(--ice-muted);
}
.ice-empty a { color: var(--ice-primary); font-weight: 600; }
