/**
 * Copyright since 2026 Solauv
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License 3.0 (AFL-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/AFL-3.0
 *
 * @author    Solauv
 * @copyright Since 2026 Solauv
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 */

/* The theme sorts its CSS in cascade layers, in this order (theme.css). Stated again in
   case this file is read first: the layer named below would otherwise come first. */
@layer vendors, bs-base, bs-components, bs-custom-components, ps-base, ps-components, ps-pages, ps-modules, utilities;

/* Star of a featured product, at the top left of its cart line. */
.product-line {
  position: relative;
}

.ebi43-star {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  font-size: 18px;
  line-height: 1;
  color: var(--bs-primary, #3d87ff);
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/*
 * Product on quote: the quote button of the module replaces the quantity field and the
 * add to cart button of the product page, and the availability above them.
 */
.js-product-add-to-cart:has(.ebi43-quote) .product__availability,
.js-product-add-to-cart:has(.ebi43-quote) .product-actions__quantity,
.js-product-add-to-cart:has(.ebi43-quote) [data-button-action="add-to-cart"],
.js-product-add-to-cart:has(.ebi43-quote) .product__minimal-quantity {
  display: none;
}

/* Category pages: no subcategories above the products (hummingbird: .subcategory). */
.subcategory {
  display: none;
}

/* Product lists with the left column (categories with their filters, search results, native
   and ambjolisearch): 4 products per row on computers, as on the pages without column
   (hummingbird: 3). */
@media (min-width: 1200px) {
  .layout-left-column .products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Search bar of the header, on computers: it takes the free room, up to 45rem. */
@media (min-width: 768px) {
  #_desktop_ps_searchbar {
    flex: 1 1 auto;
    max-width: 45rem;
  }

  #_desktop_ps_searchbar .ps-searchbar {
    width: 100%;
  }
}

/* Product miniatures: the name on 2 lines at most, then "…". */
.product-miniature__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* Footer: the copyright line of the module replaces the one of the theme. */
.copyright:not(.ebi43-copyright) {
  display: none;
}

/*
 * Addresses: they are kept by the ERP, customers choose among theirs. No link to create,
 * edit or delete one (my account, checkout), nor to use a different billing address.
 */
.address-card__actions,
.address-card--add-address,
.js-address-form a[href*="newAddress="],
.js-address-form a[data-link-action="different-invoice-address"] {
  display: none;
}

/* Login page: the "No account?" block of the module (to the contact form) replaces the
   one of the theme (to the registration). */
.login__register-prompt:not(.ebi43-register-prompt) {
  display: none;
}

/* Cart, shipping line: the free shipping message under the amount, in regular text. */
.cart-summary__value:has(.ebi43-free-shipping) {
  flex-direction: column;
  align-items: flex-end;
  white-space: normal;
}

.ebi43-free-shipping {
  font-size: 0.875rem;
  font-weight: 400;
}

/*
 * Footer: link that opens the cookie settings, under the copyright line.
 */
.ebi43-cookie-settings {
  padding-bottom: 1rem;
  font-size: 0.875rem;
  text-align: center;
}

/*
 * Cookie banner (tarteaucitron.js), as the one the shop had: a box at the bottom right,
 * 300 px wide, dark and slightly transparent, text of 12 px. Information message (no choice
 * offered): no "Deny all" nor "Personalize" button, no line for the message in the panel.
 */
html body #tarteaucitronRoot #tarteaucitronAlertBig {
  right: 10px;
  bottom: 10px;
  left: auto;
  box-sizing: border-box;
  width: 300px;
  max-width: calc(100% - 20px);
  padding: 10px 20px;
  font-size: 12px !important;
  line-height: 1.4;
  background: rgba(23, 25, 28, 0.85);
}

html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronDisclaimerAlert {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: #efefef;
}

html body #tarteaucitronRoot #tarteaucitronAlertBig .tarteaucitronAllow {
  padding: 6px 12px;
  font-size: 13px !important;
}

html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronPersonalize2,
html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronAllDenied2 {
  background: var(--ebi43-primary, #3d87ff);
  color: #fff;
}

html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronPersonalize2:hover,
html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronAllDenied2:hover {
  background: var(--ebi43-hover, #2e67c2);
}

html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronPrivacyUrl {
  background: transparent;
  color: #8db8ff;
  text-decoration: underline;
}

html.ebi43-cookie-notice body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronCloseAlert,
html.ebi43-cookie-notice body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronAllDenied2,
html.ebi43-cookie-notice body #tarteaucitronRoot #ebi43noticeLine {
  display: none;
}

/*
 * JoliSearch, quick search: star on the featured products (the module marks them with
 * .ebi-star), at the top left of the product.
 */
.jolisearch-products__list .product {
  position: relative;
}

.jolisearch-products__list .ebi-star {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  font-size: 18px;
  line-height: 1;
  color: var(--ebi43-primary, #3d87ff);
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/*
 * Personalized catalog: heart at the top right of the products of the lists, button of
 * the product page, catalog page.
 */
.product-miniature__inner {
  position: relative;
}

.ebi43-catalog-heart {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: var(--ebi43-primary, #3d87ff);
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.ebi43-catalog-heart:hover,
.ebi43-catalog-heart:focus-visible {
  color: var(--ebi43-hover, #2e67c2);
}

.ebi43-catalog-action {
  margin-top: 1rem;
}

.ebi43-catalog-button {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

/* Every cell of a line of the catalog on the same middle line (image, name, price, quantity). */
.ebi43-catalog > tbody > tr > td {
  vertical-align: middle;
}

.ebi43-catalog__product a {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--bs-body-color, #212529);
  text-decoration: none;
}

.ebi43-catalog__product a:hover .ebi43-catalog__name,
.ebi43-catalog__product a:focus-visible .ebi43-catalog__name {
  text-decoration: underline;
}

.ebi43-catalog__image {
  flex: 0 0 auto;
  width: 4rem;
  height: auto;
}

.ebi43-catalog__attributes,
.ebi43-catalog__reference {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #6c757d;
}

.ebi43-catalog__form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ebi43-catalog__qty {
  width: 5rem;
}

.ebi43-catalog__qty.is-saved {
  border-color: #198754;
}

.ebi43-catalog__price {
  white-space: nowrap;
}

.ebi43-catalog__add-all {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/*
 * Buttons « EBI catalog » (link of the online catalog) and « Personalized catalog » of the
 * header: icons on phones and tablets, the icon and its name on computers, left of the main
 * menu.
 */
.ebi43-catalog-link {
  gap: 0.5rem;
}

.ebi43-catalog-link__button {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.375rem 0.6rem;
  font-weight: 600;
  white-space: nowrap;
}

.ebi43-catalog-link__button .material-icons {
  font-size: 1.25rem;
  line-height: 1;
}

.ebi43-catalog-link__label {
  display: none;
}

/*
 * Header, on computers, as the shop had it: the logo on the left, the search bar at the top
 * and the main menu under it, both on the right of the logo, the button « EBI catalog » just
 * before the menu (the theme puts menu, then search, on one line). The desktop menu of the
 * theme shows from 1200 px.
 */
@media (min-width: 1200px) {
  .header-bottom__row {
    display: grid;
    grid-template-areas:
      "logo search search"
      "logo catalog menu";
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
  }

  .header-bottom__row > .ebi43-catalog-link {
    grid-area: catalog;
  }

  .ebi43-catalog-link__button {
    padding: 0.375rem 0.9rem;
  }

  .ebi43-catalog-link__label {
    display: inline;
  }

  .header-bottom__row > .header-bottom__logo {
    grid-area: logo;
  }

  .header-bottom__row > #_desktop_ps_searchbar {
    grid-area: search;
    justify-self: start;
    width: 100%;
  }

  .header-bottom__row > .ps-mainmenu--desktop {
    grid-area: menu;
  }

  /*
   * Submenus (they open on click, views/js/menu.js): a compact panel, at most 60 % of the
   * height of the screen, scrolled inside; 4 columns, smaller titles and gaps.
   */
  .ps-mainmenu .submenu {
    max-height: 60vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .ps-mainmenu .submenu__right {
    padding-block: 1rem;
  }

  .ps-mainmenu .submenu__right-items.active,
  .ps-mainmenu .submenu__right-items:first-child {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 1rem;
  }

  .ps-mainmenu .submenu__right-items .menu-item__group-main-item {
    margin-bottom: 0.25rem;
    font-size: 1rem;
  }

  .ps-mainmenu .submenu__left-item {
    padding-block: 0.25rem;
  }
}

/*
 * Main menu on one line next to the two buttons: from 1200 to 1399 px (narrower container of
 * the theme), smaller entries; from 1400 px, closer ones.
 */
@media (min-width: 1200px) {
  .ps-mainmenu--desktop .ps-mainmenu__tree-link {
    padding-inline: 0.375rem;
  }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .ps-mainmenu--desktop .ps-mainmenu__tree-link {
    padding-inline: 0.25rem;
    font-size: 0.875rem;
  }

  .ebi43-catalog-link__button {
    padding-inline: 0.6rem;
  }
}

/* The search bar of the theme is pushed to the right by .ms-auto, an !important rule of its
   "utilities" layer, which a rule outside the layers cannot override: on computers, the
   search bar starts right of the logo, as the menu under it. */
@layer utilities {
  @media (min-width: 1200px) {
    .header-bottom__row > #_desktop_ps_searchbar {
      margin-left: 0 !important;
    }
  }
}

/*
 * Gift cheques: block of the cart, line under the checkout button, page of the account.
 */
.ebi43-gift-cheques {
  margin-top: 1.5rem;
}

.ebi43-gift-cheques__title {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ebi43-gift-cheques__title .material-icons,
.ebi43-gift-cheques-estimate .material-icons {
  color: var(--ebi43-primary, #3d87ff);
}

/* Lines of the cheques: the columns of the product lines of the cart, an icon in place of
   the picture. */
.ebi43-gift-cheques__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  min-height: 4rem;
  border-radius: var(--bs-border-radius);
  background: var(--ebi43-tint-80, #d8e7ff);
  color: var(--ebi43-primary, #3d87ff);
}

.ebi43-gift-cheques__icon .material-icons {
  font-size: 2rem;
}

.ebi43-gift-cheques__line .product-line__price {
  white-space: nowrap;
}

.ebi43-gift-cheques__account {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.ebi43-gift-cheques-estimate {
  display: flex;
  gap: 0.375rem;
  align-items: flex-start;
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  text-align: left;
}

.ebi43-gift-cheques-page__history li {
  padding: 0.25rem 0;
}

.ebi43-gift-cheques-page__date {
  display: inline-block;
  min-width: 7rem;
  color: var(--bs-secondary-color, #6c757d);
}

/*
 * Cart of the header, as the shop had it: a button of the main colour, the word and the
 * number of products in white; outlined while the cart is empty. On phones, the icon alike.
 */
.header-top .ps-shoppingcart .header-block__action-btn,
#_mobile_ps_shoppingcart .ps-shoppingcart .header-block__action-btn {
  border: 1px solid var(--ebi43-primary, #3d87ff);
  color: var(--ebi43-primary, #3d87ff);
  font-weight: 600;
}

.header-top .ps-shoppingcart .header-block--active a.header-block__action-btn,
#_mobile_ps_shoppingcart .ps-shoppingcart .header-block--active a.header-block__action-btn {
  background: var(--ebi43-primary, #3d87ff);
  color: #fff;
}

.header-top .ps-shoppingcart .header-block--active a.header-block__action-btn:hover,
.header-top .ps-shoppingcart .header-block--active a.header-block__action-btn:focus,
#_mobile_ps_shoppingcart .ps-shoppingcart .header-block--active a.header-block__action-btn:hover,
#_mobile_ps_shoppingcart .ps-shoppingcart .header-block--active a.header-block__action-btn:focus {
  border-color: var(--ebi43-hover, #2e67c2);
  background: var(--ebi43-hover, #2e67c2);
  color: #fff;
}

.header-top .ps-shoppingcart .header-block__icon,
#_mobile_ps_shoppingcart .ps-shoppingcart .header-block__icon {
  color: inherit;
}

.header-top .ps-shoppingcart .header-block--active .header-block__badge,
#_mobile_ps_shoppingcart .ps-shoppingcart .header-block--active .header-block__badge {
  background: #fff;
  color: var(--ebi43-primary, #3d87ff);
}

#_mobile_ps_shoppingcart .ps-shoppingcart .header-block--active .header-block__badge {
  box-shadow: 0 0 0 1px var(--ebi43-primary, #3d87ff);
}

@media (max-width: 767.98px) {
  #_mobile_ps_shoppingcart .ps-shoppingcart .header-block__action-btn {
    min-height: 38px;
    padding-inline: 0.6rem;
  }
}

/*
 * Summary of the cart and of the checkout, gift cheques used, prices tax excluded (marker
 * line added by the module): the voucher of the cheques, with its bin, between the total tax
 * included and the amount left to pay.
 */
#cart-subtotal-ebi43-gift-cheques {
  display: none;
}

:is(.js-cart-detailed-totals, #js-checkout-summary):has(#cart-subtotal-ebi43-gift-cheques) {
  display: flex;
  flex-direction: column;
}

:is(.js-cart-detailed-totals, #js-checkout-summary):has(#cart-subtotal-ebi43-gift-cheques) :is(.cart-summary__total, .cart-voucher, .cart-voucher__list) {
  display: contents;
}

:is(.js-cart-detailed-totals, #js-checkout-summary):has(#cart-subtotal-ebi43-gift-cheques) .cart-summary__total > .cart-summary__line:nth-child(1) {
  order: 1;
  margin-block-start: 0.5rem;
  border-block-start: 1px solid var(--bs-border-color);
}

:is(.js-cart-detailed-totals, #js-checkout-summary):has(#cart-subtotal-ebi43-gift-cheques) .cart-summary__total > .cart-summary__line:nth-child(2) {
  order: 2;
}

:is(.js-cart-detailed-totals, #js-checkout-summary):has(#cart-subtotal-ebi43-gift-cheques) .cart-voucher__list > li:first-child {
  order: 3;
}

:is(.js-cart-detailed-totals, #js-checkout-summary):has(#cart-subtotal-ebi43-gift-cheques) .cart-summary__total > .cart-summary__line:nth-child(3) {
  order: 4;
  margin-block-end: 0.5rem;
  border-block-end: 1px solid var(--bs-border-color);
}

:is(.js-cart-detailed-totals, #js-checkout-summary):has(#cart-subtotal-ebi43-gift-cheques) .cart-voucher__list > li:not(:first-child) {
  order: 5;
}

:is(.js-cart-detailed-totals, #js-checkout-summary):has(#cart-subtotal-ebi43-gift-cheques) :is(.cart-voucher__highlight, .cart-voucher__accordion) {
  order: 6;
}

:is(.js-cart-detailed-totals, #js-checkout-summary):has(#cart-subtotal-ebi43-gift-cheques) .cart-summary__actions {
  order: 7;
}

/*
 * Order confirmation: window of the gift cheques the order earns (a native dialog, modal once
 * the script of the module runs, else shown in the page).
 */
.ebi43-gift-cheques-earned {
  position: fixed;
  inset: 0;
  z-index: 1060;
  width: min(32rem, calc(100vw - 2rem));
  margin: auto;
  padding: 1.5rem;
  border: 0;
  border-radius: var(--bs-border-radius-lg, 0.5rem);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.25);
}

.ebi43-gift-cheques-earned::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.ebi43-gift-cheques-earned__title {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ebi43-gift-cheques-earned__title .material-icons {
  color: var(--ebi43-primary, #3d87ff);
}

.ebi43-gift-cheques-earned__actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: flex-end;
  margin-top: 1rem;
}
