/* ==========================================================================
   רבנו ספרים — Redesign layer (unique identity + conversion).
   Reversible: enqueued by mu-plugin rabenu-redesign.php (kill: RABENU_REDESIGN=false).
   Loads AFTER tokens/base/woo/home, so it overrides.
   ========================================================================== */

/* ---- Display serif for headings (Frank Ruhl Libre, variable, self-hosted) ---- */
@font-face {
  font-family: 'Frank Ruhl Libre';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/FrankRuhlLibre-hebrew.woff2') format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Frank Ruhl Libre';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/FrankRuhlLibre-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-head: 'Frank Ruhl Libre', 'Rubik', Georgia, 'Times New Roman', serif;
  --rbr-spine: linear-gradient(180deg, var(--gold-500), var(--gold-700));
}

/* Apply serif to the real heading surfaces (eyebrows stay Rubik = small kicker). */
h1, h2, h3, h4,
.section-title,
.hero-title,
.product_title,
.rabenu-card__title,
.single-product .related.products > h2,
.cart_totals h2,
.faq-section__title {
  font-family: var(--font-head);
  letter-spacing: 0;
}
.hero-title,
.product_title { font-weight: 800; }
.section-eyebrow, .hero-eyebrow { font-family: var(--font-body); }

/* ==========================================================================
   Product cards — book-spine motif, lift on hover, clearer price.
   ========================================================================== */
.rabenu-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex;
  flex-direction: column;
}
.rabenu-card:hover,
.rabenu-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
  border-color: var(--brand-200);
}
/* Book-spine accent on the start edge. */
.rabenu-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--rbr-spine);
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 2;
}
.rabenu-card:hover::before,
.rabenu-card:focus-within::before { opacity: 1; }

.rabenu-card__link { display: block; text-decoration: none; color: inherit; }
.rabenu-card__media {
  position: relative;
  background: var(--surface-2);
  padding: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
}
.rabenu-card__media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 6px 14px rgba(20,20,20,.14));
  transition: transform .2s ease;
}
.rabenu-card:hover .rabenu-card__media img { transform: scale(1.03); }

/* Badges */
.rabenu-card__media .onsale,
.rabenu-card__media .oos-badge {
  position: absolute;
  inset-block-start: var(--sp-3);
  inset-inline-end: var(--sp-3);
  z-index: 3;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-xs);
  line-height: 1;
  padding: .4em .7em;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
}
.rabenu-card__media .onsale { background: var(--sale); color: #fff; }
.rabenu-card__media .oos-badge { background: var(--ink-2); color: #fff; }

.rabenu-card__title {
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  font-weight: 700;
  margin: var(--sp-4) var(--sp-4) var(--sp-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(var(--fs-md) * var(--lh-snug) * 2);
}
.rabenu-card:hover .rabenu-card__title { color: var(--brand-800); }

.rabenu-card__foot {
  margin-top: auto;
  padding: 0 var(--sp-4) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.rabenu-card__price {
  color: var(--gold-800);
  font-weight: 800;
  font-size: var(--fs-lg);
  font-family: var(--font-body);
}
/* Price anchoring: struck original (muted) + sale (red) */
.rabenu-card__price del,
.single-product .summary .price del {
  color: var(--ink-3);
  font-weight: 500;
  font-size: .72em;
  margin-inline-end: .4em;
  text-decoration: line-through;
}
.rabenu-card__price ins,
.single-product .summary .price ins {
  text-decoration: none;
  color: var(--sale);
}
.rabenu-card__stock.low {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--sale);
}
.rabenu-card__stock.low::before { content: "🔥 "; }

/* Loop add-to-cart button → full width, brand */
.rabenu-card__foot .button,
.rabenu-card__foot a.add_to_cart_button,
.rabenu-card__foot a.button.product_type_simple {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--brand-700);
  color: #fff;
  border: 0;
  border-radius: var(--r-md);
  padding: .7em 1em;
  font-weight: 700;
  font-size: var(--fs-sm);
  min-height: 44px;
  transition: background .15s ease;
}
.rabenu-card__foot .button:hover,
.rabenu-card__foot a.add_to_cart_button:hover { background: var(--brand-800); color: #fff; }
.rabenu-card__foot .added_to_cart { display:none; }

/* ==========================================================================
   Trust strip (home + PDP) — real guarantees, no fabricated data.
   ========================================================================== */
/* Auto-fit = adapts to the CONTAINER (narrow PDP summary column), not the viewport,
   so it never cramps into too-many columns. Centered badge tiles. */
.rbr-trust {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
  padding: var(--sp-5) var(--sp-4);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--r-lg);
}
.rbr-trust__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--brand-900);
  min-width: 0;
}
.rbr-trust__ico {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: #fff;
  border: 1px solid var(--brand-100);
  color: var(--brand-700);
  box-shadow: var(--shadow-1);
}
.rbr-trust__ico svg { width: 22px; height: 22px; }
.rbr-trust__t { font-weight: 700; display: block; line-height: 1.25; }
.rbr-trust__s { color: var(--ink-3); font-size: var(--fs-xs); display: block; line-height: 1.3; }
.rbr-trust a { color: inherit; text-decoration: none; }
.rbr-trust a:hover .rbr-trust__t { color: var(--brand-700); }

/* ==========================================================================
   PDP — buy-now button + sticky add-to-cart bar.
   ========================================================================== */
.single-product .cart { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: stretch; }
.rbr-buynow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  background: var(--gold-500);
  color: #1a1200 !important;
  font-weight: 800;
  font-size: var(--fs-base);
  min-height: 52px;
  padding-inline: var(--sp-6);
  border-radius: var(--r-md);
  text-decoration: none;
  flex: 1;
  min-width: 180px;
  transition: background .15s ease;
}
.rbr-buynow:hover { background: var(--gold-600); color: #1a1200 !important; }

/* Sticky add-to-cart bar */
.rbr-sticky {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 950;
  background: rgba(255,255,255,.97);
  backdrop-filter: saturate(1.1) blur(6px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(20,20,20,.10);
  transform: translateY(110%);
  transition: transform .22s ease;
  padding: var(--sp-3) var(--sp-4);
}
.rbr-sticky.is-visible { transform: translateY(0); }
.rbr-sticky__in {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.rbr-sticky__info { min-width: 0; flex: 1; display: flex; align-items: center; gap: var(--sp-3); }
.rbr-sticky__thumb { width: 44px; height: 44px; object-fit: contain; flex: 0 0 auto; border-radius: var(--r-sm); background: var(--surface-2); }
.rbr-sticky__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rbr-sticky__price { font-family: var(--font-body); font-weight: 800; color: var(--gold-800); white-space: nowrap; }
.rbr-sticky__price del { color: var(--ink-3); font-weight: 500; font-size: .8em; margin-inline-end: .3em; }
.rbr-sticky__btn {
  flex: 0 0 auto;
  background: var(--brand-700);
  color: #fff;
  border: 0;
  border-radius: var(--r-md);
  font-weight: 800;
  font-size: var(--fs-sm);
  min-height: 48px;
  padding-inline: var(--sp-5);
  cursor: pointer;
  transition: background .15s ease;
}
.rbr-sticky__btn:hover { background: var(--brand-800); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 560px) {
  .rbr-sticky__price { display: none; }
  .rbr-sticky__thumb { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rabenu-card, .rabenu-card__media img, .rbr-sticky { transition: none; }
}
