/* =====================================================================
   ENERGY SOLUTIONS
   =====================================================================
   Styles for the /energy section. Everything here is a *delta* on top of
   the theme's existing vocabulary — the templates reuse `.container`,
   `.btn/.btn-primary`, `.section-badge*`, `.breadcrumb*`, `.catalog-hero*`,
   `.catalog-list*`, `.catalog-seo*`, `.product-category*`,
   `.product-breadcrumb*`, `.product-hero*`, `.product-desc-content*`,
   `.product-specs*` and `.specs-*` wherever they fit.

   Tokens, radii, colours, transitions and breakpoints follow global.css /
   catalog.css / product.css (1439 / 1023 / 767 / 480).
   ===================================================================== */

/* ─────────────────────────────────────────────────────────────
   1. LANDING — hero
   The landing shows exactly ONE hero: the `.catalog-hero` header, with the
   copy of the editable `sensei:energy_hero` component merged into
   `.catalog-hero__content` right under the H1. Only the two elements the
   catalog hero has no equivalent for are new — the tagline line and the CTA
   row; the paragraph reuses `.catalog-hero__desc`.
   ───────────────────────────────────────────────────────────── */
.energy-hero__tagline {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: var(--color-dark);
  max-width: 620px;
  margin: 0 0 14px;
}

.energy-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ─────────────────────────────────────────────────────────────
   1b. LISTING — hero photo (`.catalog-hero--energy`)
   The catalog hero paints its photo as an absolutely positioned band on
   the right of the card. That works for `/catalog`, whose headings are
   short, but an energy listing carries a three-level breadcrumb and a
   wide H1, so on narrow screens the text slid under the photo.

   Fixed here, scoped to the modifier, so `catalog.css` and every
   `/catalog` page stay byte-for-byte as they are. Desktop is untouched:
   the rules below start at the tablet breakpoint.
   ───────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .catalog-hero--energy .catalog-hero__media {
    width: 300px;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 55%);
            mask-image: linear-gradient(to right, transparent 0%, black 55%);
  }
}

@media (max-width: 767px) {
  /* On a phone the photo is dropped rather than stacked: the cover is the
     first product's own shot, which reappears full-size in the very first
     card a few pixels below, and a product-on-white photo stacked inside the
     grey card reads as a stray white slab. The gradient card with breadcrumb
     and H1 is what every other mobile hero in the theme shows. */
  .catalog-hero--energy .catalog-hero__media {
    display: none;
  }

  .catalog-hero--energy .catalog-hero__card {
    padding: 70px 20px 28px;
  }

  .catalog-hero--energy .catalog-hero__content {
    max-width: none;
  }
}

/* ─────────────────────────────────────────────────────────────
   2. LANDING — category cards
   The cards themselves are .product-category* from home.css; only the
   item counter is new.
   ───────────────────────────────────────────────────────────── */
/* Breathing room under the hero card. 80px is what `/catalog/{root}` gets
   between its hero and the first card (`.catalog-cats`: 20px top + 60px
   bottom padding), so the two sections line up. */
.energy-categories {
  padding-top: 80px;
}

/* Product photos are shot on white, so `cover` crops them badly and the
   white label disappears against them. Contain the photo and deepen the
   overlay so the category name always reads. */
.energy-categories .product-category__card {
  background: var(--color-white);
}

.energy-categories .product-category__img {
  object-fit: contain;
  padding: 18px 18px 34px;
}

.energy-categories .product-category__overlay {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.62) 100%);
}

.energy-categories .product-category__name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.energy-category__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 70px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--color-white);
  vertical-align: middle;
}

/* ─────────────────────────────────────────────────────────────
   3. LISTING — grid + card
   Vertical sibling of .series-card (catalog.css): same surface colour,
   radius and type scale, stacked because this is a 2–4 column grid.
   ───────────────────────────────────────────────────────────── */
/* Same 80px gap under the hero as on the landing; `.catalog-list` supplies
   the 100px tail before the footer. */
.energy-list {
  padding-top: 80px;
}

.energy-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.energy-grid[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.energy-grid[data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.energy-grid[data-columns="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Product photos are shot on white, so a borderless card on a white page
   dissolves into the background. A resting shadow (the theme's own
   --shadow-block, as used by .product-category__card) plus a hairline border
   give the card an edge; the hover state keeps the existing lift and just
   deepens the shadow. */
.energy-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-2);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-block);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.energy-card:hover {
  transform: translateY(-4px);
  border-color: #dfe4ea;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Off-white media panel with a separator, so a white-background photo still
   reads as sitting inside a card. */
.energy-card__media {
  display: block;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border-bottom: 1px solid var(--color-border);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.energy-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
}

.energy-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(252, 0, 8, 0.05) 0%, transparent 55%),
    var(--color-bg-3);
}

.energy-card__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
  min-width: 0;
}

.energy-card__top {
  flex: 1;
  min-width: 0;
}

.energy-card__brand {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 6px;
}

.energy-card__name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-dark);
  margin: 0;
}

.energy-card__name a {
  transition: color var(--transition);
}

.energy-card__name a:hover {
  color: var(--color-primary);
}

.energy-card__sku {
  font-size: 13px;
  color: var(--color-text-light);
  margin: 6px 0 0;
}

.energy-card__specs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.energy-card__spec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.energy-card__spec-label {
  color: var(--color-text);
  flex: 0 1 auto;
  min-width: 0;
}

.energy-card__spec-value {
  font-weight: 600;
  color: var(--color-text-body);
  text-align: right;
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.energy-card__actions {
  display: flex;
}

.energy-card__actions .btn {
  width: 100%;
}

/* Empty state */
.energy-empty {
  padding: 80px 0 100px;
}

.energy-empty__text {
  font-size: 18px;
  color: var(--color-text);
  text-align: center;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   4. LISTING — pagination
   No precedent in the theme; pill shapes and the red active state come
   from .btn-primary.
   ───────────────────────────────────────────────────────────── */
.pagination {
  margin-top: 40px;
}

.pagination__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pagination__item {
  display: flex;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-body);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.pagination__link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pagination__link--current,
.pagination__link--current:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-btn);
  cursor: default;
}

/* ─────────────────────────────────────────────────────────────
   5. PRODUCT — gallery
   The catalog page uses a Slick slider; the energy section ships a static
   grid, so the main frame borrows .product-hero__slider-wrap's proportions
   and the thumbs borrow .product-hero__thumb's chrome.
   ───────────────────────────────────────────────────────────── */
.energy-gallery {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.energy-gallery__main {
  border-radius: 24px;
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  aspect-ratio: 755 / 508;
  display: flex;
  align-items: center;
  justify-content: center;
}

.energy-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
}

.energy-gallery__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(252, 0, 8, 0.05) 0%, transparent 55%),
    var(--color-bg-3);
}

.energy-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.energy-gallery__thumb {
  flex: 0 0 calc((100% - 60px) / 4);
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.05);
  background: var(--color-white);
  transition: border-color var(--transition);
}

.energy-gallery__thumb:hover {
  border-color: var(--color-primary);
}

/* The picked thumb stays marked while its photo is in the main frame. */
.energy-gallery__thumb--active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), inset 0 0 14px rgba(0, 0, 0, 0.05);
}

/* Real <button> so the thumb is focusable and Enter / Space activate it. */
.energy-gallery__thumb-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.energy-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

/* ─────────────────────────────────────────────────────────────
   6. PRODUCT — info column
   ───────────────────────────────────────────────────────────── */
.energy-product__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.energy-product__head .product-hero__series a {
  transition: color var(--transition);
}

.energy-product__head .product-hero__series a:hover {
  color: var(--color-primary);
}

.energy-product__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0;
}

.energy-product__brand {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--color-primary);
}

.energy-product__sku {
  font-size: 14px;
  color: var(--color-text-light);
}

/* Key-spec chips — same pill language as .product-feature */
.energy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.energy-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 70px;
  box-shadow: 0 0 13px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  line-height: 1.2;
}

.energy-chip__label {
  color: var(--color-text);
  text-transform: uppercase;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.energy-chip__value {
  font-weight: 600;
  color: var(--color-text-body);
}

/* ─────────────────────────────────────────────────────────────
   7. PRODUCT — description, specs heading, documents
   ───────────────────────────────────────────────────────────── */
.energy-section__title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--color-dark);
  margin: 0 0 24px;
}

.energy-prose {
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
}

.energy-prose h2,
.energy-prose h3,
.energy-prose h4 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-body);
  margin: 28px 0 12px;
}

.energy-prose p {
  margin: 0 0 14px;
}

.energy-prose p:last-child {
  margin-bottom: 0;
}

.energy-prose ul,
.energy-prose ol {
  margin: 0 0 14px;
  padding-left: 22px;
  list-style: disc;
}

.energy-prose ol {
  list-style: decimal;
}

.energy-prose li {
  margin-bottom: 6px;
}

.energy-prose strong {
  color: var(--color-text-body);
  font-weight: 600;
}

.energy-prose img {
  border-radius: 16px;
  margin: 14px 0;
}

.energy-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

.energy-prose td,
.energy-prose th {
  border: 1px solid var(--color-border);
  padding: 8px 12px;
  text-align: left;
}

.energy-docs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─────────────────────────────────────────────────────────────
   8. RESPONSIVE — breakpoints mirror catalog.css / product.css
   ───────────────────────────────────────────────────────────── */
@media (max-width: 1439px) {
  .energy-hero__tagline {
    font-size: 21px;
  }

  .energy-grid[data-columns="4"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .energy-hero__tagline {
    font-size: 19px;
  }

  .energy-hero__actions {
    margin-top: 22px;
  }

  .energy-categories,
  .energy-list {
    padding-top: 56px;
  }

  .energy-empty {
    padding: 56px 0 60px;
  }

  .energy-grid,
  .energy-grid[data-columns="3"],
  .energy-grid[data-columns="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .energy-gallery__thumb {
    flex: 0 0 calc((100% - 40px) / 3);
  }

  .energy-section__title {
    font-size: 24px;
  }
}

@media (max-width: 767px) {
  .energy-hero__tagline {
    font-size: 18px;
  }

  .energy-hero__actions,
  .energy-hero__actions .btn {
    width: 100%;
  }

  .energy-categories,
  .energy-list {
    padding-top: 40px;
  }

  .energy-empty {
    padding: 40px 0 48px;
  }

  .energy-gallery {
    gap: 12px;
  }

  .energy-grid,
  .energy-grid[data-columns="2"],
  .energy-grid[data-columns="3"],
  .energy-grid[data-columns="4"] {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .energy-card__info {
    padding: 16px 18px 20px;
  }

  .energy-card__name {
    font-size: 17px;
  }

  .energy-gallery__main {
    border-radius: 16px;
  }

  .energy-gallery__main img {
    padding: 14px;
  }

  .energy-gallery__thumb {
    flex: 0 0 calc((100% - 30px) / 3);
    border-radius: 12px;
  }

  .energy-gallery__thumbs {
    gap: 12px;
  }

  .energy-section__title {
    font-size: 20px;
    margin-bottom: 16px;
  }

  .energy-chip {
    padding: 8px 12px;
  }

  .pagination__link {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .energy-card__spec {
    flex-direction: column;
    gap: 2px;
  }

  .energy-card__spec-value {
    text-align: left;
  }
}
