/* ==========================================================================
   AD8 Theme — theme.css
   Bootstrap 5 natif. Aucune dépendance Classic.
   ========================================================================== */

/* ---- Header ---- */
.ad8-header {
  z-index: 1030;
}

.ad8-header .logo {
  max-width: 200px;
  height: auto;
}

.ad8-topnav {
  font-size: 0.825rem;
}

.ad8-topnav-track {
  position: relative;
  height: 2rem;
  overflow: hidden;
}

.ad8-topnav-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: ad8-topnav-show 8s ease-in-out infinite;
}

/* Item 1 : commence visible, item 2 décalé de 4s */
.ad8-topnav-item:nth-child(1) { animation-delay: 0s; }
.ad8-topnav-item:nth-child(2) { animation-delay: -4s; }

@keyframes ad8-topnav-show {
  0%      { opacity: 1; }
  40%     { opacity: 1; }
  50%     { opacity: 0; }
  100%    { opacity: 0; }
}

/* 1 seul texte : affichage statique, pas d'animation */
.ad8-topnav-static {
  height: auto;
}
.ad8-topnav-static .ad8-topnav-item {
  position: static;
  opacity: 1;
  animation: none;
  display: flex;
}

/* ---- AD8 Nav desktop ---- */
.ad8-nav-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: .125rem;
}

.ad8-nav-item {
  position: relative;
}

.ad8-nav-link {
  display: block;
  padding: .5rem .875rem;
  color: var(--bs-body-color);
  text-decoration: none;
  font-weight: 500;
  font-size: .9375rem;
  border-radius: var(--bs-border-radius);
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}

.ad8-nav-link:hover,
.ad8-nav-item:focus-within .ad8-nav-link {
  background: var(--bs-primary);
  color: #fff;
}

.ad8-has-dropdown > .ad8-nav-link::after {
  content: "▾";
  font-size: .65em;
  margin-left: .3rem;
  opacity: .55;
  vertical-align: middle;
}

/* ---- Dropdown ---- */
.ad8-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  list-style: none;
  padding: .4rem 0;
  margin: 0;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1);
  min-width: 200px;
  z-index: 1050;
}

.ad8-has-dropdown:hover .ad8-dropdown-menu,
.ad8-has-dropdown:focus-within .ad8-dropdown-menu {
  display: block;
}

.ad8-dropdown-item {
  display: block;
  padding: .4rem 1rem;
  color: var(--bs-body-color);
  text-decoration: none;
  font-size: .9rem;
  white-space: nowrap;
  transition: background .1s;
}

.ad8-dropdown-item:hover {
  background: var(--bs-light);
  color: var(--bs-primary);
}

/* ---- Nav mobile ---- */
.ad8-nav-mobile-link {
  display: block;
  padding: .55rem .25rem;
  font-weight: 500;
  color: var(--bs-body-color);
  text-decoration: none;
  font-size: .9375rem;
}

.ad8-nav-mobile-link:hover {
  color: var(--bs-primary);
}

.ad8-mobile-toggle {
  color: var(--bs-secondary);
  text-decoration: none;
}

.ad8-mobile-sublink {
  display: block;
  padding: .35rem .5rem;
  font-size: .875rem;
  color: var(--bs-secondary-color, #6c757d);
  text-decoration: none;
}

.ad8-mobile-sublink:hover {
  color: var(--bs-primary);
}

.ad8-nav-mobile-item + .ad8-nav-mobile-item {
  border-top: 1px solid var(--bs-border-color);
}

/* ---- Barre de recherche ---- */
.search-widget form {
  display: flex;
}

.search-widget input[type="text"],
.search-widget input[type="search"] {
  border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius) !important;
}

.search-widget button {
  border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0 !important;
}

/* ---- Nav2 (devise, langue, compte, panier) ---- */
.ad8-topnav .currency-selector,
.ad8-topnav .language-selector {
  position: relative;
}

.ad8-topnav .expand-more {
  cursor: pointer;
  user-select: none;
}

/* ---- Panier (blockcart) ---- */
.blockcart .cart-products-count {
  font-size: 0.7rem;
}

/* ---- Produits — grille ---- */
.product-miniature .card {
  transition: transform 0.15s, box-shadow 0.15s;
}

.product-miniature .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.1) !important;
}

.product-miniature .product-title a {
  color: var(--bs-body-color);
  text-decoration: none;
}

/* ---- Page produit ---- */
.product-cover img {
  border-radius: var(--bs-border-radius-lg);
}

/* Galerie images — thumbnails clickables */
.product-images .thumb {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.product-images .thumb:hover,
.product-images .thumb.selected {
  opacity: 1;
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* ---- Panier flottant (dropdown) ---- */
.cart-preview .dropdown-menu {
  min-width: 320px;
}

/* ---- Checkout ---- */
.checkout-step .step-title {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---- Sidebar filtres (ps_facetedsearch) ---- */
#search_filters .facet-title {
  font-weight: 600;
  font-size: 0.9rem;
}

#search_filters .facet-label {
  font-size: 0.875rem;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  font-size: 0.875rem;
}

/* ---- Footer ---- */
.ad8-footer a {
  color: rgba(255,255,255,.7);
  text-decoration: none;
}

.ad8-footer a:hover {
  color: #fff;
}

.ad8-footer .block_newsletter .form-control {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.25);
  color: #fff;
}

.ad8-footer .block_newsletter .form-control::placeholder {
  color: rgba(255,255,255,.4);
}

/* ---- Brands slider (CSS only) ---- */
.ad8-brands {
  overflow: hidden;
  padding: 2rem 0;
  background: #fff;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.ad8-brands-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: ad8-brands-scroll 30s linear infinite;
}

.ad8-brands:hover .ad8-brands-track {
  animation-play-state: paused;
}

@keyframes ad8-brands-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ad8-brand-item {
  flex-shrink: 0;
  margin-right: 4rem;
}

.ad8-brand-item a {
  display: block;
}

/* Spécificité 0,2,1 — bat Bootstrap's img { height: auto } chargé après */
.ad8-brands .ad8-brand-item img {
  height: 48px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: .6;
  transition: filter .3s ease, opacity .3s ease;
}

.ad8-brands .ad8-brand-item:hover img,
.ad8-brands .ad8-brand-item:focus-within img {
  filter: grayscale(0%);
  opacity: 1;
}

/* ---- Bento Hero ---- */
.ad8-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 280px;
  gap: 12px;
  padding: 12px;
}

.ad8-bento-cell {
  position: relative;
  overflow: hidden;
  background: #dee2e6;
}

.ad8-bento-cell[data-span="2x1"] { grid-column: span 2; }
.ad8-bento-cell[data-span="1x2"] { grid-row: span 2; }
.ad8-bento-cell[data-span="2x2"] { grid-column: span 2; grid-row: span 2; }

.ad8-bento-bg {
  position: absolute;
  inset: 0;
  background-color: var(--bento-bg, #dee2e6);
  background-image: var(--bento-img, none);
  background-size: cover;
  background-position: center;
}

.ad8-bento-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.05) 60%);
}

.ad8-bento-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.4rem 1.5rem;
}

.ad8-bento-title {
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .3rem;
}

.ad8-bento-subtitle {
  font-size: .85rem;
  opacity: .8;
  margin: 0 0 .8rem;
}

.ad8-bento-btn {
  text-transform: uppercase;
  padding: 1rem;
  border-radius: 0 !important;
  letter-spacing: .04em;
}

@media (max-width: 991px) {
  .ad8-bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 240px;
  }
}

@media (max-width: 575px) {
  .ad8-bento {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
  .ad8-bento-cell[data-span] {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
  #_desktop_top_menu #top-menu {
    flex-direction: column;
    gap: 0;
  }

  #_desktop_top_menu #top-menu > .top-level > a {
    border-radius: 0;
    border-bottom: 1px solid var(--bs-border-color);
  }
}
