/*
 * Page-specific styles for /bundles.
 *
 * The base `.page-head`, `.crumbs`, `.head-meta`, `.section-title`,
 * `.faq-section`/`.faq-grid`/`.faq` rules are shared (in /style.css).
 * What's here is bundles-specific:
 *   * page-head .savings cells (3-up stat grid in the right column)
 *   * sticky filter bar with tabs
 *   * bundle list (.bundle / .bv visual side / .bb body side)
 *   * compare table
 *   * split CTAs (education + custom bundle)
 *
 * Bundle visual backgrounds live at /media/bundles/.
 */

/* ---------- page-head variant ---------- */

.bundles-head h1 {
  font-size: clamp(56px, 8.4vw, 140px);
}

.bundles-head .head-meta .savings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 0.5px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.bundles-head .head-meta .savings .cell {
  padding: 20px;
  border-right: 0.5px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bundles-head .head-meta .savings .cell:last-child { border-right: 0; }
.bundles-head .head-meta .savings .num {
  font-family: var(--display);
  font-weight: 500;
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.bundles-head .head-meta .savings .num em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.bundles-head .head-meta .savings .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* Sticky filter strip (`.filterbar / .ftab / .filter-meta`) hoisted to
   /style.css when products became the second page to use it. */

/* Mobile: the sticky bar wrapped to ~4 rows (chips over two lines + the
   "sorted by / all prices" meta + the CTA), eating the viewport. Drop the
   informational meta line, put the filter chips on a single horizontally
   scrollable row, and let the "Build a bundle" CTA sit on its own row.
   Scoped to this page (bundles.css is only loaded here) so the shared
   products-page filter bar is untouched. */
@media (max-width: 720px) {
  .filter-meta { display: none; }
  .filter-tabs {
    flex: 1 1 100%;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .ftab { flex: 0 0 auto; }
  /* CTA on its own full-width row, aligned to the right. */
  .filter-right { flex: 1 1 100%; justify-content: flex-end; }
}

/* ---------- bundle list ---------- */

.bundles {
  padding: 48px 0 96px;
  border-bottom: 0.5px solid var(--line);
}
.bundles-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bundle {
  position: relative;
  border: 0.5px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  transition: transform 0.3s ease;
}
.bundle:hover {
  transform: translateY(-2px);
}
.bundle.featured { border-color: var(--accent); }
.bundle[hidden] { display: none; }
@media (max-width: 1000px) {
  .bundle { grid-template-columns: 1fr; }
}

/* ---------- visual side ----------
   Same glow-background texture + accent hover sweep as the product cards
   (see public/pages/products.css). Only the *background* of the
   visual area glows on hover — the card border stays put, per the
   design brief. The bundle key visual is rendered as a centred <img>
   (.ph-img) over the texture, mirroring how product cards render their
   product shots. */

.bv {
  position: relative;
  min-height: 480px;
  overflow: hidden;
  border-right: 0.5px solid var(--line);
}
@media (max-width: 1000px) {
  .bv {
    min-height: 360px;
    border-right: 0;
    border-bottom: 0.5px solid var(--line);
  }
}
/* .ph treatment: solid base colour + two masked layers stacked on
   the pseudo-elements.
     ::before = at-rest "normal" glow (masked colour from
                --bundle-glow-base-color at --bundle-glow-base-opacity,
                always visible — also scales 1.5× on hover so the
                visible glow expands when entering the card)
     ::after  = hover sweep (0 → --bundle-glow-opacity on hover,
                masked colour from --bundle-glow-color)
   Both pseudos use the same glow-background.png as a mask.
   `!important` on the base background beats the global
   `:root[data-theme="light"] .ph` placeholder rule in /style.css. */
/* `.bundle .bv .ph` (not `.bv .ph`) — the extra `.bundle` class
   bumps specificity to 3 so this rule can beat the global
   `:root[data-theme="light"] .ph` placeholder stripe-gradient in
   /style.css (also 3 classes, also !important). With only 2
   classes the global rule wins in light mode and the cards show
   diagonal hatched stripes instead of `--bundle-glow-bg`. */
.bundle .bv .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bundle-glow-bg) !important;
  transition: background-color 0.35s ease;
  container-type: inline-size;
  color: var(--fg-faint);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.bv .ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bundle-glow-base-color);
  -webkit-mask: url("https://cdn.imaginando.pt/website3/global/glow-background.webp") center center / 180% 180% no-repeat;
          mask: url("https://cdn.imaginando.pt/website3/global/glow-background.webp") center center / 180% 180% no-repeat;
  opacity: var(--bundle-glow-base-opacity);
  transition: scale 0.5s ease;
  pointer-events: none;
  z-index: 0;
  transform: scale(1.5);
}
.bv .ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bundle-glow-color);
  -webkit-mask: url("https://cdn.imaginando.pt/website3/global/glow-background.webp") center center / 180% 180% no-repeat;
          mask: url("https://cdn.imaginando.pt/website3/global/glow-background.webp") center center / 180% 180% no-repeat;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
  transform: scale(1.5);
}
.bundle:hover .bv .ph::after {
  opacity: var(--bundle-glow-opacity);
}

/* Centred bundle image. Shadows are baked into most source PNGs; the
   frms image ships without them, so it gets a filter: drop-shadow()
   tuned to roughly match. cqw units scale the shadow with the
   container's width. */
.bv .ph .ph-img {
  position: relative;
  z-index: 1;
  /* Fill the visual area at any container size. .bundle is a stretch grid, so
     .bv is sized by the (taller) body column on desktop and by min-height when
     stacked on tablet/mobile — scaling by width alone (object-fit: contain)
     left the glow background showing above/below the image. cover crops the
     full-bleed collage instead of letterboxing it. */
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bundle:hover .bv .ph .ph-img {
  transform: scale(1.03);
}
/* Shadow value lives in /style.css as `--bundle-shadow` (dark
   default + light-mode override). cqw units resolve against the .ph
   container so the shadow scales with the card. Only applied to FRMS
   because the other bundle PNGs already include baked-in shadows. */
.bv[data-tone="frms"] .ph .ph-img {
  filter: drop-shadow(var(--bundle-shadow));
}

/* Corner / save / pile sit above the centred .ph-img (z:1) and the
   masked accent sweep on .ph::before (z:0). */
.bv .corner {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: center;
}
.bv .corner .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 0.5px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.bv .corner .badge.featured {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* huge save chip 
.bv .save {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}
.bv .save .pct {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(72px, 11vw, 160px);
  line-height: 0.85;
  letter-spacing: -0.04em;
}
.bv .save .pct em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.bv .save .pct .unit {
  font-size: 0.4em;
  letter-spacing: 0.02em;
  margin-left: 6px;
  color: var(--fg-dim);
}
.bv .save .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-top: 6px;
}*/

/* ---------- body side ---------- */

.bb {
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: space-between;
}
@media (max-width: 720px) {
  .bb { padding: 24px; }
}
.bb .head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bb .mono { font-family: var(--mono); }
.bb .name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.bb h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 3.6vw, 46px);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}
.bb h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.bb .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  color: var(--accent);
  margin: 0;
  line-height: 1.2;
}
.bb .desc {
  color: var(--fg-dim);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0;
  text-wrap: pretty;
  max-width: 50ch;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* contents list inside body side */
.bb .contents {
  display: flex;
  flex-direction: column;
  border-top: 0.5px dashed var(--line);
  border-bottom: 0.5px dashed var(--line);
  padding: 12px 0;
}
.bb .contents h6 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 10px;
  font-weight: 500;
}
.bb .citem {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  padding: 8px 0;
  align-items: baseline;
  font-size: 13.5px;
}
.bb .citem .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-faint);
}
.bb .citem.lit .dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.bb .citem .name {
  font-family: var(--display);
  font-weight: 500;
}
/* Product link inside a bundle's contents list — inherits the name style,
 * gains the accent + underline on hover/focus. */
.bb .citem .name .citem-link {
  color: inherit;
  text-decoration: none;
}
.bb .citem .name .citem-link:hover,
.bb .citem .name .citem-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bb .citem .name .muted {
  color: var(--fg-faint);
  font-weight: 400;
  font-family: var(--body);
  font-size: 13px;
  margin-left: 8px;
}
.bb .citem .price {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}

/* price + cta */
.bb .pricing {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.bb .pricing .price-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bb .pricing .strike {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
  text-decoration: line-through;
  text-decoration-color: rgba(244, 241, 234, 0.4);
}
.bb .pricing .now {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(34px, 4.5vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1;
}
.bb .pricing .now span {
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.65em;
  margin-left: 6px;
  letter-spacing: 0;
}
.bb .pricing .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- compare table ---------- */

.compare {
  padding: 96px 0;
  border-bottom: 0.5px solid var(--line);
}
.compare .head-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: end;
  margin-bottom: 36px;
}
.compare .head-row .section-title {
  font-size: clamp(34px, 4.5vw, 60px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 8px 0 0;
}
.compare .helper {
  color: var(--fg-dim);
  font-size: 14.5px;
  line-height: 1.55;
  text-align: right;
  max-width: 42ch;
  justify-self: end;
  text-wrap: pretty;
}
@media (max-width: 800px) {
  .compare .head-row { grid-template-columns: 1fr; }
  .compare .helper { text-align: left; justify-self: start; }
}
.ctable {
  border: 0.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}
.crow {
  display: grid;
  align-items: center;
  border-top: 0.5px solid var(--line);
  font-size: 13px;
}
.crow:first-child { border-top: 0; background: rgba(244, 241, 234, 0.03); }
.crow > div {
  padding: 14px;
  border-right: 0.5px solid var(--line);
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.crow > div:first-child {
  justify-content: flex-start;
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.crow > div:last-child { border-right: 0; }
.crow.head > div {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
}
.crow.head > div em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  margin-left: 4px;
}
.crow .hint {
  color: var(--fg-faint);
  margin-left: 4px;
  font-size: 9.5px;
}
.crow .check { color: var(--accent); font-size: 14px; }
.crow .dash { color: var(--fg-faint); font-size: 14px; }
.crow .list-price {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
  text-decoration: line-through;
}
.crow.list-price-row { background: rgba(244, 241, 234, 0.03); }
.crow.bundle-price-row { background: rgba(200, 255, 58, 0.04); }
.crow.bundle-price-row > div:first-child { color: var(--fg); }
.crow .save-cell {
  font-family: var(--display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.crow .save-cell em {
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  margin-left: 4px;
}
.cscroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cscroll .ctable { min-width: 920px; }

/* ---------- split CTAs ----------
   Section class is `.bundles-split` (not `.split`) — the homepage
   already styles `.split` as a 2-col grid in style.css, and reusing
   the name here forced the inner `.wrap` into one grid track. */

.bundles-split {
  padding: 64px 0;
  border-bottom: 0.5px solid var(--line);
}
/* Single split block ("build a custom bundle") — the educational-discount
   block was removed (it doesn't stack with bundle pricing), so this is a
   single full-width banner rather than a 2-col grid. */
.sgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  position: relative;
}
.sblock {
  position: relative;
  border: 0.5px solid var(--line);
  border-radius: 18px;
  padding: 40px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: var(--card);
}
.sblock.accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.sblock h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 12px;
  text-wrap: balance;
}
.sblock h3 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.sblock.accent h3 em { color: var(--accent-ink); }
.sblock p {
  color: var(--fg-dim);
  max-width: 38ch;
  text-wrap: pretty;
  font-size: 15px;
  margin: 0;
}
.sblock.accent p { color: rgba(0, 0, 0, 0.7); }
.sblock .mono { color: var(--fg-dim); }
.sblock.accent .mono { color: rgba(0, 0, 0, 0.55); }
.sblock .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.sblock .num {
  font-family: var(--display);
  font-weight: 500;
  font-size: 120px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.sblock .tiers {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
/* Discount tiers as pill chips ("3 → 15%") so they read as scannable
   badges rather than a run of mono text. */
.sblock .tier {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  border: 0.5px solid var(--line);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* On the accent card the chips invert: dark fill + accent text so they
   stay legible and pop against the bright accent background. */
.sblock.accent .tier {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--accent);
}
.sblock .btn {
  cursor: pointer;
}
.sblock.accent .btn {
  border-color: rgba(0, 0, 0, 0.35);
  color: var(--accent-ink);
}
.sblock.accent .btn:hover {
  border-color: var(--accent-ink);
}
