/*
 * Black Friday 2026 on the category 14 and 15 trees (catalog/_partials/bf-root.tpl decides): the header
 * (catalog/_partials/bf-category-header.tpl), the landing page's dark look and its product cards
 * (catalog/_partials/miniatures/product.tpl, class is-bf). Linked by catalog/_partials/category-header.tpl on every
 * page of those categories and nowhere else, so the page-wide rules below touch only them. Colours follow the landing
 * page (assets/css/pch_landingpages/page-1.css) and the theme's --bb-* variables (custom.css).
 */

.bf-cat {
  --bf-green: var(--bb-green, #2ab283);
  --bf-dark: var(--bb-footer-bg, #1a1a1a);
  --bf-red: var(--bb-accent, #ff4444);
  --bf-heading: 'Playfair Display', Georgia, serif;
}

/* custom.css places the header parts on grid rows; the hero gets the first */
.category__header.bf-cat > .bf-cat__hero { grid-row: 1; }

html:has(.bf-cat) { scroll-behavior: smooth; }
body:has(.bf-cat) #products { scroll-margin-top: 16px; }

/* ------------------------------------------------------------------- Hero */

.bf-cat__hero {
  display: grid;
  gap: 32px;
  align-items: center;
  margin: 8px 0 24px;
  padding: 36px 20px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 85% 0%, rgba(42, 178, 131, 0.35) 0%, rgba(42, 178, 131, 0) 60%),
    var(--bf-dark);
  color: #fff;
}

@media (min-width: 992px) {
  .bf-cat__hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    padding: 48px 56px;
  }
}

.bf-cat__kicker {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bf-green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.bf-cat .bf-cat__title {
  margin: 0 0 12px;
  color: #fff;
  font-family: var(--bf-heading);
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.bf-cat__lead {
  max-width: 600px;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 16px;
  line-height: 1.6;
}

.bf-cat__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 600;
}

.bf-cat__facts li {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.bf-cat__facts .material-icons {
  color: var(--bf-green);
  font-size: 20px;
}

.bf-cat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.bf-cat .bf-cat__btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 14px 26px;
  border: 2px solid var(--bf-green);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.bf-cat .bf-cat__btn.btn-primary,
.bf-cat .bf-cat__btn.btn-primary:hover,
.bf-cat .bf-cat__btn.btn-primary:focus {
  color: #fff;
}

.bf-cat .bf-cat__btn .material-icons {
  font-size: 20px;
  line-height: 24px;
}

.bf-cat .bf-cat__btn--ghost {
  border-color: rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #fff;
}

.bf-cat .bf-cat__btn--ghost:hover,
.bf-cat .bf-cat__btn--ghost:focus {
  border-color: #fff;
  background: #fff;
  color: var(--bb-text, #1a1a1a);
}

.bf-cat__media {
  display: none;
}

@media (min-width: 992px) {
  .bf-cat__media {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .bf-cat__media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }

  .bf-cat__media img:nth-child(even) {
    transform: translateY(18px);
  }

  .bf-cat__hero--single .bf-cat__media {
    grid-template-columns: minmax(0, 1fr);
    justify-items: end;
  }

  .bf-cat__hero--single .bf-cat__media img {
    max-width: 280px;
    aspect-ratio: 450 / 550;
  }
}

/* Phones: the hero buttons one under the other, full width */
@media (max-width: 575px) {
  .bf-cat__actions .bf-cat__btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ============================================================ Dark page (PM, 2026-10-21: "take over the darkness")
   The landing page's ground under everything between the header and the footer; white panels and cards on it. */

body {
  --bf-ground: #161917;
  --bf-ground-2: #111311;
  --bf-ink: #1a1a1a;
  --bf-forest: #1f4636;
  --bf-green-2: #208662;
  --bf-green-soft: #e8f5e9;
  --bf-red-text: #e53935;
  --bf-red-hot: #ff4d4d;
  --bf-text: #1a1a1a;
  --bf-grey: #737a75;
  --bf-soft: #f2f5f3;
  --bf-on-dark: #eef2ef;
  --bf-on-dark-2: #b3bdb6;
}

body,
body #wrapper,
body .footer__before {
  background: var(--bf-ground-2) !important;
}

body #wrapper {
  background: linear-gradient(180deg, var(--bf-ground) 0, var(--bf-ground-2) 2600px, var(--bf-ground-2)) !important;
  color: var(--bf-on-dark);
}

/* Breadcrumb */
#wrapper .breadcrumb,
#wrapper .breadcrumb-item,
#wrapper .breadcrumb-item::before,
#wrapper .breadcrumb-link {
  color: var(--bf-on-dark-2) !important;
}

#wrapper .breadcrumb-item span,
#wrapper .breadcrumb-link:hover {
  color: #fff !important;
}

/* The hero on the dark ground: the landing hero's green-tinted gradient, so its edge shows */
.bf-cat__hero {
  background:
    radial-gradient(ellipse at 85% 0%, rgba(42, 178, 131, 0.3) 0%, rgba(42, 178, 131, 0) 60%),
    linear-gradient(105deg, var(--bf-ink) 0%, #191e1b 42%, var(--bf-forest) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Description under the hero, and the long part after the products */
#wrapper .category__description,
#wrapper .category__description *,
#wrapper .category-extra,
#wrapper .category-extra * {
  color: var(--bf-on-dark-2) !important;
}

#wrapper .category__description :is(h1, h2, h3, h4, strong, b),
#wrapper .category-extra :is(h1, h2, h3, h4, strong, b) {
  color: #fff !important;
}

#wrapper .category__description a,
#wrapper .category-extra a,
#wrapper .category__description-toggle {
  color: var(--bf-green) !important;
}

/* The folded description fades into the page: the fade has to be the dark ground, not white */
#wrapper .category__description.is-truncated::after {
  background: linear-gradient(180deg, rgba(22, 25, 23, 0), var(--bf-ground)) !important;
}

/* Left column: headings white, the category list and the filter groups stay white panels */
#left-column .left-block__title,
#wrapper .subcategory__title,
#wrapper .subcategory > h2,
#wrapper .subcategory > .h2 {
  color: #fff !important;
}

#left-column .accordion-item {
  overflow: hidden;
  border: 0 !important;
  border-radius: 12px !important;
}

#left-column .accordion-item + .accordion-item {
  margin-top: 10px;
}

/* Count and sort: the landing page's white toolbar */
#js-product-list-top .products__selection {
  padding: 10px 14px;
  border: 0 !important;
  border-radius: 12px;
  background: #fff;
}

/* Pagination under the cards */
#wrapper .pagination__number {
  color: var(--bf-on-dark-2) !important;
}

/* ============================================================ Product cards: the landing page's (PM, 2026-10-21)
   White card without the grey frame; under the photo the strip "−35% Black Friday | la comenzi 500+ lei / Transport
   gratuit" (miniatures/product.tpl prints it); the photo's discount flag and the category line give way to it; red
   price, grey old price, "Economisești X lei", round button. */

.products .product-miniature.is-bf {
  --bf-deal-w: 112px;
  container-type: inline-size;
  border: 0 !important;
  border-radius: 12px;
}

.products .product-miniature.is-bf:hover {
  box-shadow: 0 22px 40px -18px rgba(0, 0, 0, 0.7);
  transform: translateY(-6px);
}

.products .product-miniature.is-bf .product-flags .badge.discount,
.products .product-miniature.is-bf .product-miniature__category {
  display: none !important;
}

.products .product-miniature.is-bf .product-miniature__top {
  background: var(--bf-soft);
}

.product-miniature__bf {
  position: relative;
  display: grid;
  flex: none;
  grid-template-columns: var(--bf-deal-w) minmax(0, 1fr);
  height: 40px;
}

.product-miniature__bf::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--bf-red-text), var(--bb-green, #2ab283));
}

.product-miniature__bf:not(:has(.product-miniature__bf-deal)) {
  grid-template-columns: minmax(0, 1fr);
}

.product-miniature__bf-deal {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: var(--bf-ink);
  color: #fff;
}

.product-miniature__bf-deal b {
  color: var(--bf-red-hot);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.product-miniature__bf-deal small {
  width: 5em;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.05;
  text-transform: uppercase;
}

.product-miniature__bf-note {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 2px 9px;
  background: var(--bf-green-soft);
  color: var(--bf-green-2);
  line-height: 1.1;
  white-space: nowrap;
}

.product-miniature__bf-note small {
  font-size: 10px;
  font-weight: 600;
}

.product-miniature__bf-note b {
  font-size: 13px;
  font-weight: 800;
}

/* Narrow cards (phones): drop the small words first, then shrink, so the strip never clips */
@container (max-width: 239px) {
  .product-miniature__bf {
    --bf-deal-w: 68px;
  }

  .product-miniature__bf-deal small {
    display: none;
  }
}

@container (max-width: 195px) {
  .product-miniature__bf-note small {
    display: none;
  }

  .product-miniature__bf-note b {
    font-size: 11.5px;
  }
}

/* 320px phones (cards of about 140px): "Transport gratuit" on two lines, as on the landing page */
@container (max-width: 159px) {
  .product-miniature__bf-note {
    white-space: normal;
  }

  .product-miniature__bf-note b {
    font-size: 11px;
    line-height: 1.05;
  }

  .product-miniature__bf-save {
    border-radius: 10px;
  }
}

.products .product-miniature.is-bf .product-miniature__price {
  color: var(--bf-red-text) !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em;
}

.products .product-miniature.is-bf .product-miniature__regular-price {
  color: var(--bf-grey) !important;
}

/* "Economisești X lei" highlighted (PM, 2026-10-22): the landing page's green pill */
.product-miniature__bf-save {
  align-self: flex-start;
  width: fit-content;
  margin-top: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bf-green-soft);
  color: var(--bf-green-2);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.products .product-miniature.is-bf .product-miniature__add {
  border-radius: 999px !important;
}

@media (max-width: 575px) {
  .products .product-miniature.is-bf .product-miniature__price {
    font-size: 20px !important;
  }

  .product-miniature__bf-save {
    padding: 3px 8px;
    font-size: 12px;
  }
}

/* Room between the cards and the tiles, as on the landing page (the theme has 4px) */
body #js-product-list .products {
  gap: 12px;
}

body .subcategory__list--with-images {
  gap: 10px;
}

/* "Subcategorii" (custom.css draws it as .subcategory::before, dark) */
#wrapper .subcategory::before {
  color: #fff;
  font-size: 24px;
}

/* Phones: the landing page's 16px side margin instead of the theme's 4px */
@media (max-width: 767px) {
  #wrapper .breadcrumb__wrapper > .container,
  #wrapper .category__header-band__inner,
  #wrapper .columns-container,
  #wrapper .category__subcategories-band .container {
    padding-right: 16px !important;
    padding-left: 16px !important;
  }
}
