/**
 * Copyright since 2011 BEST FOR NET s.r.o.
 *
 * COPYRIGHT NOTICE / UPOZORNĚNÍ NA AUTORSKÁ PRÁVA
 *
 * This code is protected by copyright and may not be distributed without prior written consent of the author.
 * Under the license terms, you may use and modify this code only for your own needs.
 * For any questions or further information, please contact us.
 *
 * Tento software je chráněn autorským právem a jeho šíření bez předchozího písemného souhlasu autora není povoleno.
 * Tento kód smíte v souladu s licencí používat a upravovat jen pro své vlastní účely.
 * V případě dotazů nebo zájmu o další informace nás neváhejte kontaktovat.
 *
 * @author    BEST FOR NET s.r.o. <info@bestfornet.cz>
 * @copyright Since 2011 BEST FOR NET s.r.o.
 * @license   Komerční licence – použití, šíření a úpravy tohoto software jsou možné pouze na základě individuální smlouvy s autorem. Pro více informací kontaktujte info@bestfornet.cz
 */
/* Best sellers in the category. Font and link colour come from the theme; the module colours are
   variables, the rank badge ones are set in the module configuration (Appearance tab). */
.b4ncbsp {
  --b4ncbsp-line: #e5e7eb;
  --b4ncbsp-image-bg: #f3f4f6;
  --b4ncbsp-text: inherit;
  --b4ncbsp-muted: #6b7280;
  --b4ncbsp-in-stock: #15803d;
  --b4ncbsp-on-the-way: #b45309;
  --b4ncbsp-out-of-stock: #6b7280;
  --b4ncbsp-sale: #c0392b;
  --b4ncbsp-button-bg: #fff;
  --b4ncbsp-button-border: #d1d5db;
  --b4ncbsp-button-color: inherit;
  margin: 1.5rem 0;
  color: var(--b4ncbsp-text);
}

.b4ncbsp__title {
  margin: 0 0 .5rem;
  font-size: 1.5rem;
  line-height: 1.25;
}

.b4ncbsp__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--b4ncbsp-line);
}

.b4ncbsp__item {
  margin: 0;
  border-bottom: 1px solid var(--b4ncbsp-line);
}

.b4ncbsp__link {
  display: grid;
  grid-template-columns: 64px 32px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
  padding: 12px 4px;
  color: inherit;
  text-decoration: none;
}

.b4ncbsp__link:hover,
.b4ncbsp__link:focus {
  color: inherit;
  text-decoration: none;
}

.b4ncbsp__link:hover .b4ncbsp__name,
.b4ncbsp__link:focus-visible .b4ncbsp__name {
  text-decoration: underline;
}

.b4ncbsp--no-images .b4ncbsp__link {
  grid-template-columns: 32px minmax(0, 1fr) auto;
}

.b4ncbsp__image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--b4ncbsp-image-bg);
}

.b4ncbsp__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.b4ncbsp__rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--b4ncbsp-rank-bg, #f2f3f5);
  color: var(--b4ncbsp-rank-color, #c0392b);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.b4ncbsp__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.b4ncbsp__name {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.b4ncbsp__stock {
  font-size: .8125rem;
  font-weight: 600;
}

.b4ncbsp__stock--in_stock {
  color: var(--b4ncbsp-in-stock);
}

.b4ncbsp__stock--on_the_way {
  color: var(--b4ncbsp-on-the-way);
}

.b4ncbsp__stock--out_of_stock {
  color: var(--b4ncbsp-out-of-stock);
}

.b4ncbsp__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  white-space: nowrap;
}

.b4ncbsp__regular {
  color: var(--b4ncbsp-muted);
  font-size: .8125rem;
}

.b4ncbsp__current {
  font-size: 1.0625rem;
  font-weight: 700;
}

.b4ncbsp__current--sale {
  color: var(--b4ncbsp-sale);
}

/* Show more / Show less: a visually hidden checkbox and its label, no script */
.b4ncbsp__toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  opacity: 0;
}

.b4ncbsp__item--more,
.b4ncbsp__more-hide {
  display: none;
}

.b4ncbsp__toggle:checked ~ .b4ncbsp__list .b4ncbsp__item--more {
  display: list-item;
}

.b4ncbsp__toggle:checked ~ .b4ncbsp__footer .b4ncbsp__more-show {
  display: none;
}

.b4ncbsp__toggle:checked ~ .b4ncbsp__footer .b4ncbsp__more-hide {
  display: inline;
}

.b4ncbsp__footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}

.b4ncbsp__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid var(--b4ncbsp-button-border);
  border-radius: 999px;
  background: var(--b4ncbsp-button-bg);
  color: var(--b4ncbsp-button-color);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.b4ncbsp__more:hover {
  border-color: var(--b4ncbsp-muted);
}

.b4ncbsp__toggle:focus-visible ~ .b4ncbsp__footer .b4ncbsp__more {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.b4ncbsp__more-icon {
  position: relative;
  width: 14px;
  height: 14px;
}

.b4ncbsp__more-icon::before,
.b4ncbsp__more-icon::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.b4ncbsp__more-icon::after {
  transform: rotate(90deg);
}

.b4ncbsp__toggle:checked ~ .b4ncbsp__footer .b4ncbsp__more-icon::after {
  display: none;
}

/* phones: the rank sits on the image, stock and price share one line under the name */
@media (max-width: 575px) {
  .b4ncbsp__title {
    font-size: 1.25rem;
  }

  .b4ncbsp__link {
    position: relative;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas: "image name name" "image stock price";
    align-items: baseline;
    column-gap: 12px;
    row-gap: 6px;
    padding: 12px 0;
  }

  .b4ncbsp--no-images .b4ncbsp__link {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-areas: "rank name name" "rank stock price";
  }

  .b4ncbsp__image {
    grid-area: image;
    align-self: center;
    width: 56px;
    height: 56px;
  }

  .b4ncbsp__rank {
    position: absolute;
    top: 6px;
    left: -6px;
    width: 24px;
    height: 24px;
    font-size: 12px;
    box-shadow: 0 0 0 2px #fff;
  }

  .b4ncbsp--no-images .b4ncbsp__rank {
    position: static;
    grid-area: rank;
    align-self: center;
    box-shadow: none;
  }

  .b4ncbsp__info {
    display: contents;
  }

  .b4ncbsp__name {
    grid-area: name;
    font-size: .9375rem;
  }

  .b4ncbsp__stock {
    grid-area: stock;
  }

  .b4ncbsp__price {
    grid-area: price;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }

  .b4ncbsp__current {
    font-size: 1rem;
  }

  .b4ncbsp__footer {
    justify-content: stretch;
  }

  .b4ncbsp__more {
    justify-content: center;
    width: 100%;
  }
}
