/* Variables */
:root {
  --sl-primary: #FF7A00;
  --sl-primary-dark: #E56D00;
  --sl-primary-soft: #FFF3E6;
  --sl-dark: #1C1C1C;
  --sl-light: #F5F6F8;
  --sl-text: #1d1d1f;
  --sl-muted: #6e6e73;
  --sl-border: #e6e9ef;
  --sl-radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 127px;
}

body {
  font-family: 'Noto Kufi Arabic', system-ui, -apple-system, sans-serif;
  background-color: #fff;
  color: var(--sl-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Pas d'ombres */
.form-control:focus,
.form-select:focus,
.btn:focus,
.btn:active,
.btn-check:focus + .btn,
.accordion-button:focus {
  box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--sl-primary);
}

/*
* Utilitaires
*/
.text-brand { color: var(--sl-primary) !important; }
.bg-brand { background-color: var(--sl-primary) !important; }
.bg-brand-soft { background-color: var(--sl-primary-soft) !important; }
.bg-dark-brand { background-color: var(--sl-dark) !important; }
.bg-light-brand { background-color: var(--sl-light) !important; }

.clamp-1,
.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }

.fs-7 { font-size: .8125rem; }
.fs-8 { font-size: .75rem; }

/*
* Boutons
*/
.btn { border-radius: 50px; }

.btn-brand {
  background-color: var(--sl-primary);
  border: 1px solid var(--sl-primary);
  color: #fff;
}
.btn-brand:hover { background-color: var(--sl-primary-dark); color: #fff; }

.btn-outline-brand {
  border: 1px solid var(--sl-border);
  color: var(--sl-text);
  background-color: #fff;
}
.btn-outline-brand:hover {
  border-color: var(--sl-primary);
  color: var(--sl-primary);
}
.btn-outline-brand.is-active {
  border-color: var(--sl-primary);
  background-color: var(--sl-primary-soft);
  color: var(--sl-primary);
}

.nav-pills .nav-link.active {
  background-color: var(--sl-primary);
}

/*
* En-tête
*/
.topbar {
  background-color: var(--sl-light);
  color: var(--sl-muted);
  font-size: .8125rem;
  border-bottom: 1px solid var(--sl-border);
}
.topbar a:hover { color: var(--sl-primary); }

.site-header {
  background-color: #fff;
  border-bottom: 1px solid var(--sl-border);
}

.search-box {
  border: 2px solid var(--sl-primary);
  border-radius: 50px;
  overflow: hidden;
  background-color: #fff;
}
.search-box .form-select,
.search-box .form-control {
  border: 0;
  border-radius: 0;
  padding-block: .625rem;
}
.search-box .form-select {
  width: auto;
  max-width: 210px;
  background-color: var(--sl-light);
  font-size: .875rem;
}
.search-box .btn {
  border-radius: 0;
  padding-inline: 1.25rem;
}

.header-action {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border-radius: 50px;
  color: var(--sl-text);
  white-space: nowrap;
}
.header-action:hover { background-color: var(--sl-light); }
.header-action i { font-size: 1.35rem; }
.count-badge {
  position: absolute;
  top: -2px;
  right: -6px;
  background-color: var(--sl-primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  line-height: 1;
  padding: .2rem .35rem;
  border-radius: 50px;
}
@media (max-width: 767.98px) {
  .header-logo {
    height: 36px;
  }
}

/*
* Navigation catégories
*/
/* Bordure en haut : .site-header porte déjà la bordure du bas */
.category-nav {
  background-color: #fff;
  border-top: 1px solid var(--sl-border);
}
.category-nav .nav-link {
  color: var(--sl-text);
  font-size: .875rem;
  padding: .75rem .875rem;
  white-space: nowrap;
}
.category-nav .nav-link:hover { color: var(--sl-primary); }

.cats-btn {
  background-color: transparent;
  color: var(--sl-text);
  font-weight: 600;
  border: 0;
  border-radius: 0;
}
.cats-btn:hover,
.mega:hover .cats-btn { background-color: var(--sl-light); color: var(--sl-primary); }

/*
* Méga-menu catégories
* Le panneau se positionne sur le .container pour en occuper toute la largeur.
*/
.category-nav .container { position: relative; }

/* Pleine hauteur de la barre : sinon un écart sous le bouton coupe le survol */
.mega {
  align-self: stretch;
  display: flex;
  align-items: center;
}

.mega-panel {
  position: absolute;
  top: 100%;
  left: calc(var(--bs-gutter-x) * .5);
  right: calc(var(--bs-gutter-x) * .5);
  min-height: 424px;
  display: none;
  background-color: #fff;
  border: 1px solid var(--sl-border);
  border-radius: 0 0 var(--sl-radius) var(--sl-radius);
  z-index: 1040;
}
.mega:hover .mega-panel { display: block; }

/* Aucun padding horizontal : les lignes touchent le panneau, sans zone morte au survol */
.mega-list {
  width: 260px;
  min-height: 424px;
  padding: .5rem 0;
  margin: 0;
  list-style: none;
  border-right: 1px solid var(--sl-border);
}
.mega-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  font-size: .8125rem;
  color: var(--sl-text);
}

/* Panneau de droite : remplit l'espace restant et chevauche la bordure
   de 1px pour que le curseur ne traverse jamais de vide. */
.mega-sub {
  position: absolute;
  top: 0;
  left: 259px;
  right: 0;
  bottom: 0;
  display: none;
  padding: 1.5rem;
  overflow-y: auto;
}
.mega-sub h6 {
  font-size: .8125rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.mega-sub a {
  display: block;
  font-size: .8125rem;
  color: var(--sl-muted);
  padding: .2rem 0;
}
.mega-sub a:hover { color: var(--sl-primary); }
/* Le bouton ne doit pas hériter du display:block des liens ci-dessus */
.mega-sub .btn {
  display: inline-flex;
  align-items: center;
  color: var(--sl-text);
}
.mega-sub .btn:hover { color: var(--sl-primary); }

/* Première catégorie ouverte par défaut, puis le survol prend le relais.
   Les règles de survol gardent la même spécificité (0,5,0) et passent en dernier. */
.mega-list .mega-item:first-child .mega-sub { display: block; }
.mega-list .mega-item:first-child .mega-link {
  background-color: var(--sl-light);
  color: var(--sl-primary);
}
.mega-list:hover .mega-item:first-child .mega-sub { display: none; }
.mega-list:hover .mega-item:first-child .mega-link {
  background-color: transparent;
  color: var(--sl-text);
}
.mega-list .mega-item .mega-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.mega-list:hover .mega-item:hover .mega-sub { display: block; }
.mega-list:hover .mega-item:hover .mega-link {
  background-color: var(--sl-light);
  color: var(--sl-primary);
}

.mega-list:hover .mega-item:hover .mega-link svg[fill="none"],
.mega-list:hover .mega-item:hover .mega-link svg[fill="none"] * {
  stroke: var(--sl-primary);
}

.dropdown-menu {
  border-radius: var(--sl-radius);
  border: 1px solid var(--sl-border);
  padding: .5rem;
  z-index: 9999;
}
.dropdown-item {
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .875rem;
}
.dropdown-item:active { background-color: var(--sl-light); color: var(--sl-text); }

/*
* Sections
*/
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}
.tile {
  border: 1px solid var(--sl-border);
  border-radius: var(--sl-radius);
  background-color: #fff;
  overflow: hidden;
}
@media (max-width: 768px) {
  .section-title {
    font-size: 1rem;
  }
}

/*
* Hero
*/
.hero-slide {
  height: 380px;
  object-fit: cover;
  width: 100%;
}
/* Les deux bannières empilées égalent la hauteur du carrousel (182 + 16 + 182) */
.hero-side { height: 182px; }

.carousel-indicators [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
}
.carousel-control-next, .carousel-control-prev {
  width: 5%;
}
@media (max-width: 991.98px) {
  .hero-slide { height: 240px; }
  .hero-side { height: 150px; }
}

/*
* Rangées défilantes
*/
.scroll-row {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: .25rem;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 190px;
}

/*
* Catégories
*/
.category-tile {
  display: block;
  text-align: center;
  width: 104px;
}
.category-tile .icon {
  width: 76px;
  height: 76px;
  margin: 0 auto .5rem;
  border-radius: 50%;
  background-color: var(--sl-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--sl-primary);
  transition: background-color .2s, color .2s;
}
.category-tile:hover .icon {
  background-color: var(--sl-primary);
  color: #fff;
}
.category-tile span {
  font-size: .75rem;
  color: var(--sl-muted);
  display: block;
  line-height: 1.3;
}
.category-tile svg {
  width: 36px;
  height: 36px;
}

/*
* Carte produit
*/
.product-card {
  border: 1px solid var(--sl-border);
  border-radius: var(--sl-radius);
  background-color: #fff;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: border-color .2s;
}
.product-card:hover { border-color: var(--sl-primary); }

.product-media {
  position: relative;
  overflow: hidden;
  background-color: var(--sl-light);
}
.product-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform .35s;
}
.product-card:hover .product-media img { transform: scale(1.05); }

.product-badges {
  position: absolute;
  top: .5rem;
  left: .5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  align-items: flex-start;
}
.product-badge {
  font-size: .6875rem;
  font-weight: 600;
  padding: .2rem .45rem;
  border-radius: 6px;
  line-height: 1.4;
}

.wish-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--sl-border);
  background-color: #fff;
  color: var(--sl-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-decoration: none;
}
.wish-btn:hover { color: var(--sl-primary); border-color: var(--sl-primary); }
.wish-btn.is-active { color: var(--sl-primary); border-color: var(--sl-primary); }
.wish-btn:disabled { opacity: .6; }

.quick-add {
  position: absolute;
  left: .5rem;
  right: .5rem;
  bottom: .5rem;
  transform: translateY(150%);
  transition: transform .25s;
  font-size: .8125rem;
  padding: .375rem;
}
.product-card:hover .quick-add { transform: translateY(0); }
@media (max-width: 767.98px) {
  .quick-add { display: none; }
}

.product-body {
  padding: .625rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
}
.product-title {
  font-size: .8125rem;
  line-height: 1.4;
  min-height: 2.3em;
  color: var(--sl-text);
}
.product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sl-primary);
  white-space: nowrap;
}
.product-old-price {
  font-size: .8125rem;
  color: var(--sl-muted);
  text-decoration: line-through;
  white-space: nowrap;
}
.stars { color: var(--sl-primary); font-size: .6875rem; letter-spacing: -1px; }

/* Sélecteur de note : les étoiles sont posées de 5 à 1 puis retournées. */
.rating-input { display: inline-flex; flex-direction: row-reverse; gap: .25rem; }
.rating-input label { cursor: pointer; font-size: 2rem; line-height: 1; color: var(--sl-border); transition: color .15s, transform .15s; }
.rating-input input:checked ~ label { color: var(--sl-primary); }
.rating-input:hover input ~ label { color: var(--sl-border); }
.rating-input input + label:hover,
.rating-input input + label:hover ~ label { color: var(--sl-primary); }
.rating-input input + label:hover { transform: scale(1.12); }
.rating-input input:focus-visible + label { outline: 2px solid var(--sl-primary); outline-offset: 2px; border-radius: 4px; }

.stock-bar {
  height: 5px;
  border-radius: 50px;
  background-color: var(--sl-light);
  overflow: hidden;
}
.stock-bar span {
  display: block;
  height: 100%;
  background-color: var(--sl-primary);
}

/*
* Ventes flash
*/
.flash-header {
  background-color: var(--sl-primary-soft);
  border: 1px solid #ffd9b0;
  border-radius: var(--sl-radius);
}

/*
* Bannières
*/
.banner {
  position: relative;
  border-radius: var(--sl-radius);
  overflow: hidden;
  display: block;
}
/* Absolue pour que l'image ne dicte jamais la hauteur de la bannière */
.banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.banner:hover img { transform: scale(1.04); }
.banner-overlay {
  position: absolute;
  inset: 0;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(90deg, rgba(20, 20, 20, .78) 0%, rgba(20, 20, 20, .1) 100%);
  color: #fff;
}

/*
* Garanties
*/
.trust-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
}
.trust-item i {
  font-size: 1.5rem;
  color: var(--sl-primary);
}

/* Séparateurs responsives entre cellules */
.divider-grid > [class*="col"] {
  border-right: 1px solid var(--sl-border);
  border-bottom: 1px solid var(--sl-border);
}
.divider-grid > [class*="col"]:nth-child(2n) { border-right: 0; }
.divider-grid > [class*="col"]:nth-last-child(-n+2) { border-bottom: 0; }
@media (min-width: 768px) {
  .divider-grid > [class*="col"] {
    border-bottom: 0;
    border-right: 1px solid var(--sl-border);
  }
  .divider-grid > [class*="col"]:last-child { border-right: 0; }
}

/*
* Marques
*/
.brand-tile {
  border: 1px solid var(--sl-border);
  border-radius: var(--sl-radius);
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--sl-muted);
  background-color: #fff;
  transition: color .2s, border-color .2s;
}
.brand-tile:hover { color: var(--sl-primary); border-color: var(--sl-primary); }

/* Plan des catégories : l'en-tête collant ne doit pas masquer l'ancre visée */
.sitemap-block { scroll-margin-top: 90px; }

.brand-card { transition: border-color .2s, box-shadow .2s; }
.brand-card:hover { border-color: var(--sl-primary); box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.brand-card-logo {
  height: 48px;
  width: 100%;
  max-width: 120px;
  object-fit: contain;
}

/*
* Boutiques
*/
.store-cover {
  height: 88px;
  object-fit: cover;
  width: 100%;
}
.store-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  margin-top: -32px;
  background-color: #fff;
}

/* Logo en tête de la page boutique : posé dans le bandeau, sans chevauchement */
.store-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--sl-border);
  object-fit: cover;
  background-color: #fff;
}

/*
* Newsletter
*/
.newsletter {
  background-color: var(--sl-primary);
  border-radius: var(--sl-radius);
  color: #fff;
}

/*
* Pied de page
*/
.site-footer {
  background-color: var(--sl-light);
  border-top: 1px solid var(--sl-border);
}
.site-footer h6 {
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: .875rem;
}
.site-footer a {
  color: var(--sl-muted);
  font-size: .8125rem;
  display: block;
  padding: .25rem 0;
}
.site-footer a:hover { color: var(--sl-primary); }

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--sl-border);
  background-color: #fff;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--sl-dark);
  font-size: 20px !important;
}
.social-btn:hover { background-color: var(--sl-primary); color: #fff; border-color: var(--sl-primary); }
.social-btn:hover i { color: #fff; }

.pay-chip {
  border: 1px solid var(--sl-border);
  background-color: #fff;
  border-radius: 6px;
  padding: .3rem .5rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--sl-muted);
  line-height: 1.2;
}

/*
* Retour en haut
*/
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--sl-border);
  background-color: #fff;
  color: var(--sl-primary);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1030;
}
.back-to-top.show { display: flex; }
@media (max-width: 768px) {
  .back-to-top {
    bottom: 5rem;
  }
}

/*
* Pages catégorie / rubrique / produit
* Tout ce qui suit complète le thème : le reste des pages réutilise .tile,
* .product-card, .btn-brand, .stars, .stock-bar, etc.
*/
.hover-brand:hover,
.breadcrumb a:hover { color: var(--sl-primary); }

.breadcrumb { --bs-breadcrumb-divider-color: var(--sl-muted); }
.breadcrumb-item.active { color: var(--sl-muted); }

/* Pastille d'icône d'une rubrique (en-tête de catégorie, vendeur) */
.rubric-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: #fff;
  color: var(--sl-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rubric-icon svg { width: 28px; height: 28px; }
.rubric-icon-sm {
  width: 40px;
  height: 40px;
  background-color: var(--sl-light);
  font-size: 1.1rem;
}

/* Puces de navigation entre rubriques */
.chip {
  display: inline-flex;
  align-items: center;
  padding: .35rem .75rem;
  border: 1px solid var(--sl-border);
  border-radius: 50px;
  background-color: #fff;
  font-size: .8125rem;
  color: var(--sl-text);
  white-space: nowrap;
}
.chip:hover { border-color: var(--sl-primary); color: var(--sl-primary); }
.chip-active {
  background-color: var(--sl-primary-soft);
  border-color: var(--sl-primary);
  color: var(--sl-primary);
}

/* Filtres */
.filter-group {
  padding: 1rem 0;
  border-top: 1px solid var(--sl-border);
}
.filter-group:first-child { border-top: 0; }
.filter-title {
  font-size: .8125rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.filter-scroll {
  max-height: 220px;
  overflow-y: auto;
}
.form-check-input:checked {
  background-color: var(--sl-primary);
  border-color: var(--sl-primary);
}
.btn-check:checked + .btn-outline-brand {
  border-color: var(--sl-primary);
  background-color: var(--sl-primary-soft);
  color: var(--sl-primary);
}

/* Galerie produit */
.gallery-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: calc(var(--sl-radius) - 4px);
  background-color: var(--sl-light);
}
.gallery-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--sl-border);
  border-radius: 8px;
  background-color: #fff;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--sl-primary); }

/* Sélecteur de quantité */
.qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--sl-border);
  border-radius: 50px;
  overflow: hidden;
}
.qty button {
  width: 32px;
  height: 32px;
  border: 0;
  background-color: #fff;
  color: var(--sl-text);
  font-size: 1rem;
  line-height: 1;
}
.qty button:hover { color: var(--sl-primary); }
.qty input {
  width: 40px;
  border: 0;
  text-align: center;
  font-size: .8125rem;
  font-weight: 600;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Bloc d'achat : suit le défilement sur grand écran */
@media (min-width: 992px) {
  .buy-box { position: sticky; top: 1rem; }
}

/* Suivi : frise et contenu du colis côte à côte dès la tablette, empilés sur mobile */
@media (min-width: 768px) {
  .border-md-bottom-0 { border-bottom: 0 !important; }
  .border-md-start { border-left: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important; }
}

/*
* Barre de navigation mobile
*/
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  border-top: 1px solid var(--sl-border);
  z-index: 9999;
  display: flex;
}
.mobile-nav a {
  flex: 1;
  text-align: center;
  padding: .5rem 0;
  font-size: .6875rem;
  color: var(--sl-muted);
}
.mobile-nav a i { display: block; font-size: 1.25rem; }
.mobile-nav a.active { color: var(--sl-primary); }
@media (min-width: 768px) {
  .mobile-nav { display: none; }
}

/*
* Pages d'erreur
*/
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 3rem 0;
}
.error-code {
  font-size: clamp(4.5rem, 18vw, 8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--sl-primary);
}
.error-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background-color: var(--sl-primary-soft);
  color: var(--sl-primary);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-links a {
  color: var(--sl-muted);
  font-size: .8125rem;
}
.error-links a:hover { color: var(--sl-primary); }

/* Écran autonome : pages 500/503, affichées sans en-tête ni pied de page */
.error-standalone {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--sl-light);
  padding: 1.5rem;
}
