:root {
  --home-bg: #FAFAF9;
  --home-surface: #ffffff;
  --home-text: #1C1917;
  --home-muted: #78716C;
  --home-line: #F0EEEC;
  --home-soft: #FAFAF9;
  --home-orange: #F37A1F;
  --home-orange-dark: #D9660F;
  --home-orange-deep: #B45309;  /* orange en tant que texte : 5.02:1 */
  --home-blue: #0B46D8;
  --home-green: #059669;
  --home-red: #dc2626;
  --home-shadow: 0 18px 42px rgba(28, 25, 23, .08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--home-bg);
  color: var(--home-text);
}

.home-page {
  width: min(1240px, 100%);
  margin: 0 auto 56px;
  padding: 0 4px;
}

.home-ads {
  margin: 8px 0 14px;
}

.ad-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 6px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.ad-rail::-webkit-scrollbar {
  display: none;
}

.ad-card {
  position: relative;
  flex: 0 0 min(390px, calc(100vw - 32px));
  width: min(390px, calc(100vw - 32px));
  height: clamp(104px, 31vw, 118px);
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(135deg, var(--banner-primary, #F37A1F) 0%, var(--banner-primary, #F37A1F) 54%, var(--banner-accent, #FB923C) 100%);
  box-shadow: 0 8px 16px rgba(28, 25, 23, .075);
  scroll-snap-align: start;
}

.ad-card.is-fallback {
  background:
    linear-gradient(135deg, var(--home-surface) 0%, #FFF4EA 54%, var(--banner-accent, #FB923C) 100%);
}

.ad-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 12px 16px;
  color: #fff;
  text-decoration: none;
}

.ad-link.is-static {
  cursor: default;
}

.ad-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.ad-bg::before,
.ad-bg::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
}

.ad-bg::before {
  width: 104px;
  height: 104px;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
}

.ad-bg::after {
  width: 18px;
  height: 18px;
  right: 86px;
  top: 18px;
  background: rgba(255, 255, 255, .12);
}

.ad-card.is-fallback .ad-bg::before {
  background: rgba(255, 255, 255, .34);
}

.ad-card.is-fallback .ad-bg::after {
  background: rgba(255, 255, 255, .24);
}

.ad-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(28, 25, 23, .18), rgba(28, 25, 23, .03) 58%, rgba(15, 23, 42, 0) 100%);
}

.ad-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 6px;
}

.ad-pill {
  display: grid;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
}

.ad-card.is-fallback .ad-pill {
  background: rgba(255, 255, 255, .72);
}

.ad-pill span {
  color: #fff;
  font-size: 9.5px;
  font-weight: 900;
  white-space: nowrap;
}

.ad-card.is-fallback .ad-pill span {
  color: var(--banner-primary, var(--home-orange));
}

.ad-title {
  margin: 0;
  color: #fff;
  font-size: 17px;
  line-height: 20px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-card.is-fallback .ad-title {
  color: var(--home-text);
}

.ad-sub {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  line-height: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-card.is-fallback .ad-sub {
  color: #44403C;
}

.ad-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  margin-top: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  font-size: 12px;
  font-weight: 800;
}

.ad-card.is-fallback .ad-cta {
  color: var(--banner-primary, var(--home-orange));
  background: transparent;
  padding: 0;
}

.ad-visual {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: clamp(98px, 35%, 136px);
  height: calc(100% - 14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .22);
}

.ad-visual.is-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
}

.ad-card.is-fallback .ad-visual.is-icon {
  background: rgba(243, 122, 31, .20);
}

.ad-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.ad-card[data-link-type="boutique"] .ad-img {
  object-fit: cover;
}

.ad-icon {
  color: rgba(255, 255, 255, .94);
  font-size: 27px;
}

.ad-card.is-fallback .ad-icon {
  color: var(--banner-primary, var(--home-orange));
}

.ad-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 2px;
}

.ad-dot {
  width: 5px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #E7E5E4;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: width .18s ease, background-color .18s ease;
}

.ad-dot.is-active {
  width: 16px;
  background: var(--home-orange);
}

.home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 16px;
  padding: 0 2px;
}

.home-kicker {
  display: inline-flex;
  color: var(--home-orange-deep);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-section-head h1,
.home-section-head h2 {
  margin: 2px 0 0;
  color: var(--home-text);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.08;
}

.home-section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--home-line);
  border-radius: 999px;
  color: var(--home-orange-dark);
  background: var(--home-surface);
  font-size: .85rem;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(28, 25, 23, .05);
}

.home-page .articles-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-page .article-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--home-surface);
  border: 1px solid var(--home-line);
  border-radius: 24px;
  box-shadow: 0 8px 18px rgba(28, 25, 23, .045);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.home-page .article-card.is-out .slide img {
  filter: grayscale(.28);
}

.home-page .article-card:focus-within {
  outline: 2px solid rgba(243, 122, 31, .32);
  outline-offset: 2px;
}

.home-page .images-slider {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--home-soft);
}

.home-page .slides-container {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .7s ease-in-out;
  will-change: transform;
  touch-action: pan-y;
}

.home-page .slide {
  min-width: 100%;
  height: 100%;
}

.home-page .slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.home-page .clickable-image {
  cursor: zoom-in;
}

.home-page .card-badge,
.home-page .card-like-btn {
  position: absolute;
  z-index: 3;
}

.home-page .card-badge {
  top: 10px;
  left: 10px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: #047857;
  font-size: .73rem;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(28, 25, 23, .12);
}

.home-page .card-badge.danger {
  background: rgba(220, 38, 38, .96);
}

.home-page .card-like-btn {
  top: 9px;
  right: 9px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(243, 235, 217, .92);
  border-radius: 50%;
  color: #475467;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 16px rgba(28, 25, 23, .12);
  cursor: pointer;
  transition: transform .16s ease, color .16s ease, border-color .16s ease, background .16s ease;
}

.home-page .card-like-btn.is-liked {
  color: var(--home-red);
  border-color: rgba(220, 38, 38, .16);
  background: #fff1f2;
}

.home-page .card-like-btn:disabled {
  cursor: wait;
  opacity: .75;
}

.home-page .article-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px 9px;
  padding: 10px;
  background: #fff;
}

.home-page .nom_article {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 2.35em;
  overflow: hidden;
  color: var(--home-text);
  font-size: .98rem;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: break-word;
  word-break: normal;
}

@supports (-webkit-line-clamp: 2) {
  .home-page .nom_article {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

.home-page .store-chip {
  grid-column: 1 / -1;
  min-width: 0;
}

.home-page .store-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.home-page .store-avatar {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--home-line);
  border-radius: 50%;
  background: #fff;
}

.home-page .store-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.home-page .store-initial {
  width: 100%;
  height: 100%;
  display: inline-grid;
  place-items: center;
  color: var(--home-blue);
  font-size: .8rem;
  font-weight: 900;
}

.home-page .store-name {
  min-width: 0;
  overflow: hidden;
  color: var(--home-muted);
  font-size: .84rem;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-page .article-card-stats {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.home-page .stat-pill {
  min-width: 0;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 5px;
  overflow: hidden;
  border: 1px solid #edf0f5;
  border-radius: 999px;
  color: var(--home-muted);
  background: #FAFAF9;
  font-size: .72rem;
  font-weight: 850;
  line-height: 1;
}

.home-page .stat-pill i {
  flex: 0 0 auto;
  font-size: .75rem;
}

.home-page .stat-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-page .stat-like.is-liked {
  color: var(--home-red);
  border-color: #fecdd3;
  background: #fff1f2;
}

.home-page .stat-contact {
  color: #128c7e;
}

.home-page .article-price-stack {
  grid-column: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.home-page .price {
  min-width: 0;
  overflow: hidden;
  color: var(--home-orange-dark);
  font-size: .94rem;
  font-weight: 950;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-page .old-price {
  min-width: 0;
  min-height: 1em;
  overflow: hidden;
  color: #A8A29E;
  font-size: .78rem;
  white-space: nowrap;
  text-decoration: line-through;
  text-overflow: ellipsis;
}

.home-page .acheter-btn {
  grid-column: 2;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  border-radius: 50%;
  color: #fff !important;
  background: var(--home-orange);
  box-shadow: 0 9px 18px rgba(243, 122, 31, .24);
  text-decoration: none !important;
  transition: transform .16s ease, background .16s ease;
}

.home-page .acheter-btn i,
.home-page .fab.fa-whatsapp {
  color: inherit;
}

.home-page .article-card a,
.home-page .article-card a:visited,
.home-page .article-card a:hover,
.home-page .article-card a:active {
  color: inherit !important;
  text-decoration: none !important;
}

.message-interceptor {
  position: fixed;
  top: 16px;
  right: 12px;
  left: 12px;
  z-index: 1000;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.message-interceptor .alert {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 420px;
  margin-left: auto;
  padding: 12px 14px;
  border: 1px solid var(--home-line);
  border-left: 4px solid #F0EEEC;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--home-shadow);
}

.message-interceptor .alert-success {
  border-left-color: var(--home-green);
}

.message-interceptor .alert-error {
  border-left-color: var(--home-red);
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-alert {
  padding: 0 0 0 8px;
  border: 0;
  background: transparent;
  color: var(--home-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.home-page .no-articles {
  grid-column: 1 / -1;
  margin: 0;
  padding: 36px 16px;
  border: 1px dashed #E7E5E4;
  border-radius: 24px;
  background: #fff;
  color: var(--home-muted);
  text-align: center;
  font-weight: 750;
}

.home-boutiques-section {
  margin-top: 28px;
}

.home-boutiques-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.home-boutique-card {
  overflow: hidden;
  border: 1px solid var(--home-line);
  border-radius: 24px;
  background: var(--home-surface);
  box-shadow: var(--home-shadow);
}

.home-boutique-cover {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(180deg, #eef3ff 0%, #FAFAF9 100%);
}

.home-boutique-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.home-boutique-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.home-boutique-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-boutique-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 18px;
  background: #FFF4EA;
  box-shadow: 0 0 0 1px var(--home-line);
  color: var(--home-orange-dark);
  font-size: 1rem;
  font-weight: 900;
  text-decoration: none;
  margin-top: -28px;
}

.home-boutique-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.home-boutique-copy {
  min-width: 0;
}

.home-boutique-copy h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.15;
}

.home-boutique-copy h3 a {
  color: var(--home-text);
  text-decoration: none;
}

.home-boutique-copy p {
  margin: 0;
  overflow: hidden;
  color: var(--home-muted);
  font-size: .84rem;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-boutique-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--home-line);
}

.home-boutique-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--home-orange-dark);
  background: #FFF4EA;
  font-size: .8rem;
  font-weight: 850;
}

.home-boutique-link {
  color: var(--home-blue);
  font-size: .82rem;
  font-weight: 850;
  text-decoration: none;
}

.create-magasin {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 100;
}

.create-magasin.scrolled {
  transform: translateY(-4px);
}

.create-magasin a {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--home-orange);
  box-shadow: 0 14px 28px rgba(243, 122, 31, .28);
  font-weight: 900;
  text-decoration: none;
}

.create-magasin a:hover {
  color: #fff;
  background: var(--home-orange-dark);
}

@media (hover: hover) {
  .home-page .article-card:hover {
    transform: translateY(-2px);
    border-color: #FCD9B6;
    box-shadow: 0 16px 34px rgba(28, 25, 23, .10);
  }

  .home-page .acheter-btn:hover {
    transform: translateY(-1px);
    background: var(--home-orange-dark);
  }

  .home-page .card-like-btn:hover {
    transform: translateY(-1px);
    color: var(--home-red);
    border-color: #fecdd3;
    background: #fff7f7;
  }
}

@media (min-width: 520px) {
  .home-page .articles-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  .ad-card {
    flex-basis: 390px;
    width: 390px;
    height: 118px;
  }

  .ad-title {
    font-size: 17px;
  }

  .home-section-head h1 {
    font-size: 1.9rem;
  }

  .home-section-head h2 {
    font-size: 1.65rem;
  }

  .home-page .articles-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .home-boutiques-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .home-page .articles-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .home-boutiques-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .home-page {
    margin-bottom: 84px;
  }

  .ad-card {
    flex-basis: calc(100vw - 32px);
    width: calc(100vw - 32px);
  }

  .ad-title {
    font-size: 16px;
  }

  .home-section-head {
    margin-top: 8px;
  }

  .home-section-head h1 {
    font-size: 1.35rem;
  }

  .home-section-head h2 {
    font-size: 1.22rem;
  }

  .home-page .article-footer {
    gap: 7px 8px;
    padding: 9px;
  }

  .home-page .nom_article {
    font-size: .92rem;
  }

  .home-page .store-avatar {
    width: 24px;
    height: 24px;
  }

  .home-page .store-name {
    font-size: .78rem;
  }

  .home-page .price {
    font-size: .88rem;
  }

  .home-page .stat-pill {
    min-height: 26px;
    gap: 4px;
    padding-inline: 4px;
    font-size: .68rem;
  }

  .home-boutiques-grid {
    grid-template-columns: 1fr;
  }

  .home-boutique-card {
    border-radius: 22px;
  }

  .create-magasin {
    right: 18px;
    bottom: calc(env(safe-area-inset-bottom) + var(--bottom-nav-h, 64px) + 14px);
  }

  .create-magasin a {
    width: 52px;
    height: 52px;
    padding: 0;
  }

  .create-magasin span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
