/* =========================
   HOME STYLE
========================= */

.bf-btn--wide {
  width: 100%;
  padding: 8px 10px;
  font-size: .85rem;
}

.bf-btn--addToList {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, .75);
  color: rgba(0, 0, 0, .88);
}

.bf-heroWrap {
  width: 100%;
  padding: 56px 0 40px;
}

.bf-heroBox {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.hero-text h1 {
  color: var(--text);
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  margin: 0 0 14px;
  font-weight: 900;
  line-height: 1.08;
}

.hero-text .highlight {
  color: var(--blue2);
}

.hero-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

.bf-search__box {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  max-width: 760px;
  margin: 18px auto 0;
}

.bf-search__box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 16px 18px;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  min-width: 0;
}

.bf-search__box input::placeholder {
  color: var(--muted);
  opacity: .85;
}

.bf-search__btn {
  border: none;
  background: transparent;
  padding: 0 18px;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.bf-search__hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  opacity: .85;
}

.bf-section {
  padding: 18px 0 10px;
}

.bf-section__header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 14px;
}

.bf-h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
}

.bf-h2--green {
  color: var(--blue1);
  font-size: 35px;
}

.bf-feature {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.bf-arrow {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 14px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.bf-feature__card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.bf-feature__title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 900;
  color: var(--blue1);
}

.bf-feature__desc {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.bf-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
  background: var(--card);
}

.bf-hero__frame img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
}

.bf-hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  z-index: 2;
}

.bf-hero__arrow:hover {
  background: rgba(0, 0, 0, .65);
}

#heroPrev {
  left: 12px;
}

#heroNext {
  right: 12px;
}

/* ===== BEST SELLERS GRID ===== */
.bf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.bf-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 420px;
  transition: transform .15s ease, box-shadow .15s ease;
  min-width: 0;
}

.bf-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
}

.bf-card__imgWrap {
  height: 160px;
  background: rgba(0, 0, 0, .06);
}

.bf-card__imgWrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bf-card__body {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.bf-card__title {
  margin: 0;
  font-size: .95rem;
  font-weight: 900;
  line-height: 1.25;
}

.bf-card__author {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: .8rem;
}

.bf-card__text {
  margin: 0;
  color: var(--text);
  opacity: .92;
  line-height: 1.35;
  font-size: .85rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}

.bf-card__footer {
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  background: var(--card);
  margin-top: auto;
  min-width: 0;
}

.bf-card__footer>* {
  min-width: 0;
}

/* BADGE */
.bf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .2px;
  background: rgba(0, 0, 0, .06);
  color: rgba(0, 0, 0, .75);
  border: 1px solid rgba(0, 0, 0, .12);
  white-space: nowrap;
}

.bf-badge--green {
  background: rgba(25, 135, 84, .16);
  color: rgba(20, 100, 60, .95);
  border: 1px solid rgba(25, 135, 84, .28);
}

.bf-badge--orange {
  background: rgba(245, 159, 0, .18);
  color: rgba(180, 83, 9, .95);
  border: 1px solid rgba(245, 159, 0, .3);
}

.bf-badge--blue {
  background: rgba(13, 202, 240, .18);
  color: rgba(3, 96, 120, .95);
  border: 1px solid rgba(13, 202, 240, .3);
}

.bf-badge--purple {
  background: rgba(102, 51, 153, .16);
  color: rgba(74, 35, 115, .95);
  border: 1px solid rgba(102, 51, 153, .28);
}

/* =========================
   CTA HERO
========================= */
.cta-hero {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 80px 20px;
  background-image: url("images/paintedlaibrary.jfif");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.cta-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 500px at 50% 40%, rgba(0, 0, 0, 0), rgba(0, 0, 0, .35)),
    linear-gradient(0deg, rgba(88, 40, 16, .86), rgba(88, 40, 16, .7));
  z-index: 1;
}

.cta-hero__content {
  position: relative;
  z-index: 2;
  max-width: 980px;
}

.cta-hero__title {
  margin: 0 0 18px;
  color: #fff;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.05;
  font-size: clamp(40px, 5vw, 72px);
  text-shadow: 0 8px 28px rgba(0, 0, 0, .35);
}

.cta-hero__subtitle {
  margin: 0 auto 34px;
  max-width: 820px;
  color: #f1c87a;
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.6;
  text-shadow: 0 6px 22px rgba(0, 0, 0, .35);
}

.cta-hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 44px;
  border-radius: 999px;
  background: #cf5e0f;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .15s ease, filter .15s ease;
}

.cta-hero__btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.cta-hero__btn:active {
  transform: translateY(0);
}

/* =========================
   DARK MODE EXTRAS
========================= */
html[data-theme="dark"] .bf-hero__arrow,
body.dark .bf-hero__arrow {
  background: rgba(255, 255, 255, .14);
}

html[data-theme="dark"] .bf-hero__arrow:hover,
body.dark .bf-hero__arrow:hover {
  background: rgba(255, 255, 255, .22);
}

html[data-theme="dark"] .bf-btn--addToList,
body.dark .bf-btn--addToList {
  border-color: rgba(255, 255, 255, .7);
  color: rgba(255, 255, 255, .92);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width:1024px) {
  .bf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bf-hero__frame img {
    height: 320px;
  }

  .cta-hero {
    min-height: 380px;
    padding: 70px 20px;
  }
}

@media (min-width:481px) and (max-width:768px) {
  .bf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .bf-hero__frame img {
    height: 280px;
  }

  .bf-search__box {
    max-width: 640px;
  }

  .cta-hero {
    min-height: 360px;
    padding: 64px 18px;
  }

  .cta-hero__btn {
    padding: 14px 34px;
    font-size: 17px;
  }
}

/* ✅ MOBILE */
@media (max-width:480px) {

  .bf-heroWrap {
    padding: 40px 0 28px;
  }

  .hero-text h1 {
    font-size: 30px;
    line-height: 1.12;
  }

  .hero-subtitle {
    font-size: 14px;
    padding: 0 6px;
  }

  .bf-search__box {
    max-width: 100%;
    margin: 14px auto 0;
    border-radius: 18px;
  }

  .bf-search__box input {
    padding: 14px 14px;
    font-size: 15px;
  }

  .bf-search__btn {
    padding: 0 14px;
  }

  .bf-feature {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .bf-arrow {
    display: none;
  }

  .bf-hero__frame img {
    height: 240px;
  }

  .bf-hero__arrow {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 22px;
  }

  #heroPrev {
    left: 10px;
  }

  #heroNext {
    right: 10px;
  }

  .bf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .bf-card {
    min-height: auto;
  }

  .bf-card__imgWrap {
    height: 180px;
  }

  .bf-badge {
    font-size: 10px;
    padding: 4px 8px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* הסתרת תיאור הספר */
  .bf-card__text {
    display: none !important;
  }

  /* כפתורים אחד מתחת לשני */
  .bf-card__footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
    align-items: stretch;
  }

  .bf-card__footer .bf-btn,
  .bf-card__footer button,
  .bf-card__footer a {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    border-radius: 999px;
  }

  /* סדר הכפתורים */
  .bf-btn--details {
    order: 1;
  }

  .bf-btn--addToList {
    order: 2;
  }

  .cta-hero {
    min-height: 320px;
    padding: 54px 16px;
  }

  .cta-hero__title {
    font-size: 36px;
  }

  .cta-hero__subtitle {
    font-size: 15px;
    margin-bottom: 22px;
  }

  .cta-hero__btn {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
  }
}

/* =========================
   SUCCESS MODAL
========================= */

.bf-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 9999;
}

.bf-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.bf-modal__box {
  background: #1f1f1f;
  color: #fff;
  padding: 28px 32px;
  border-radius: 16px;
  width: 340px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  animation: modalPop 0.25s ease;
}

@keyframes modalPop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.bf-modal__btn {
  margin-top: 18px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid #7aa7ff;
  background: transparent;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.bf-modal__btn:hover {
  background: #7aa7ff;
}