/**
* 2010-2026 SwissGeek | Web Developer Freelance
*
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https:// opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https:// devdocs.prestashop.com/ for more information.
*
* @Module		SGK Product Lists
* @Description	Best sellers, hand-picked, brand, keyword, same category, bought together, also viewed and recently viewed products, in any hook, as a grid, a scrolling strip, a compact list or tabs. Replaces four native product list modules and takes over their settings; featured, new and on sale products have their own modules.
* @Version		1.2.0
* @Copyright	SwissGeek | Web Developer Freelance <https://swissgeek.dev/>
* @support		Support Requests <https://admin.swissgeek.dev/forms/ticket?styled=1&with_logo=1>
* @Blog			Breaking News <https://news.swissgeek.dev/> <https://news.prestageek.ch/>
* @Addons		Developments <https://prestageek.ch/> <https://add.swissgeek.dev/>
*
* @license		http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*				Valid for 1 website (or project) for each purchase of license International Registered 
*				Trademark & Property of SwissGeek. More information on <https://swissgeek.dev/license/>
*/

/* SGK Product Lists — neutral styles: spacing, strip and compact list. Colours and fonts come
   from the theme (links, buttons, product miniatures). */

.sgkpl {
  --sgkpl-gap: 1.5rem;
  margin-block: 2rem;
}

.sgkpl__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sgkpl__heading {
  min-width: 0;
}

.sgkpl__eyebrow {
  margin: 0 0 .35rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .75;
}

.sgkpl__title {
  margin: 0;
}

.sgkpl__footer {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

/* ── Scrolling strip ───────────────────────────────────────────────── */

.sgkpl__nav {
  display: flex;
  flex: 0 0 auto;
  gap: .5rem;
}

.sgkpl__nav[hidden] {
  display: none;
}

.sgkpl__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: .8;
  transition: opacity .15s ease, background-color .15s ease;
}

.sgkpl__arrow:hover:not(:disabled),
.sgkpl__arrow:focus-visible {
  opacity: 1;
}

.sgkpl__arrow:disabled {
  cursor: default;
  opacity: .3;
}

.sgkpl--scroller .products {
  display: flex !important;
  flex-wrap: nowrap;
  gap: var(--sgkpl-gap);
  margin: 0;
  padding: .25rem .125rem 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: .125rem;
  scrollbar-width: thin;
  grid-template-columns: none;
}

.sgkpl--scroller .products > * {
  flex: 0 0 calc((100% - var(--sgkpl-gap)) / 1.25);
  width: auto;
  max-width: none;
  margin: 0;
  scroll-snap-align: start;
}

@media (min-width: 576px) {
  .sgkpl--scroller .products > * {
    flex-basis: calc((100% - var(--sgkpl-gap)) / 2);
  }
}

@media (min-width: 768px) {
  .sgkpl--scroller .products > * {
    flex-basis: calc((100% - 2 * var(--sgkpl-gap)) / 3);
  }
}

@media (min-width: 1200px) {
  .sgkpl--scroller .products > * {
    flex-basis: calc((100% - 3 * var(--sgkpl-gap)) / 4);
  }
}

/* ── Compact list (side columns) ───────────────────────────────────── */

.sgkpl--compact .sgkpl__head {
  margin-bottom: .75rem;
}

.sgkpl--compact .sgkpl__title {
  font-size: 1.125rem;
}

.sgkpl__compact {
  display: grid;
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sgkpl__item {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.sgkpl__thumb {
  flex: 0 0 4rem;
  width: 4rem;
  overflow: hidden;
  border-radius: .5rem;
}

.sgkpl__thumb img {
  display: block;
  width: 100%;
  height: auto;
}

.sgkpl__info {
  display: flex;
  flex-direction: column;
  gap: .125rem;
  min-width: 0;
}

.sgkpl__name {
  overflow: hidden;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sgkpl__price {
  font-size: .9rem;
}

.sgkpl__regular {
  margin-right: .35rem;
  opacity: .6;
}

.sgkpl--compact .sgkpl__footer {
  justify-content: flex-start;
  margin-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .sgkpl__arrow {
    transition: none;
  }
}

/* ---------- Lists grouped in tabs (1.1.0) ---------- */
.sgkpl-tabs {
  margin-block: 2rem;
}

.sgkpl-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--sgk-line, rgba(127, 127, 127, 0.28));
}

.sgkpl-tabs__tab {
  min-height: 2.5rem;
  padding: 0.4rem 1rem;
  font-family: var(--sgk-font-display, inherit);
  font-size: 1rem;
  font-weight: 700;
  color: var(--sgk-text-strong, inherit);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
}

.sgkpl-tabs__tab:hover {
  border-color: var(--sgk-line, rgba(127, 127, 127, 0.4));
}

.sgkpl-tabs__tab:focus-visible {
  outline: 2px solid var(--sgk-red-text, var(--bs-primary, #d7141c));
  outline-offset: 2px;
}

.sgkpl-tabs__tab.is-active {
  color: #fff;
  background: var(--sgk-red-ink, var(--bs-primary, #d7141c));
  border-color: var(--sgk-red-ink, var(--bs-primary, #d7141c));
}

.sgkpl-tabs__panel[hidden] {
  display: none !important;
}

/* The list of a panel keeps its arrows, without the space of its title */
.sgkpl-tabs__panel .sgkpl,
.sgkpl-tabs__panel .sgkpl__head {
  margin-top: 0;
}

.sgkpl-tabs__panel .sgkpl__head:not(:has(.sgkpl__nav)) {
  display: none;
}
