:root {
  --home-bg: #f6f8fb;
  --home-surface: #ffffff;
  --home-text: #111827;
  --home-muted: #667085;
  --home-line: #e5e7eb;
  --home-soft: #f3f6fb;
  --home-orange: #ff6a00;
  --home-orange-dark: #d85a00;
  --home-blue: #2563eb;
  --home-green: #16a34a;
  --home-red: #dc2626;
  --home-shadow: 0 14px 34px rgba(17, 24, 39, .08);
}

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

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

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

.home-ads {
  margin: 0 0 18px;
}

.ad-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 58%);
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
}

.ad-card {
  position: relative;
  height: 210px;
  overflow: hidden;
  border-radius: 8px;
  background: #111827;
  box-shadow: var(--home-shadow);
  scroll-snap-align: start;
}

.ad-card a {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  color: #fff;
  text-decoration: none;
}

.ad-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ad-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 13, 23, .78), rgba(8, 13, 23, .18) 66%),
    linear-gradient(0deg, rgba(8, 13, 23, .38), transparent 58%);
}

.ad-content {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 4px;
  max-width: 70%;
}

.ad-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.15;
}

.ad-sub {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  opacity: .95;
}

.ad-cta {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--home-orange);
  box-shadow: 0 10px 18px rgba(255, 106, 0, .28);
  font-size: .82rem;
  font-weight: 900;
}

.home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--home-line);
}

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

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

.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: 8px;
  box-shadow: 0 8px 18px rgba(17, 24, 39, .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(255, 106, 0, .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: rgba(22, 163, 74, .96);
  font-size: .73rem;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(17, 24, 39, .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(229, 231, 235, .92);
  border-radius: 50%;
  color: #475467;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 16px rgba(17, 24, 39, .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: #f8fafc;
  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: #98a2b3;
  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(255, 106, 0, .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 #e5e7eb;
  border-radius: 8px;
  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 #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--home-muted);
  text-align: center;
  font-weight: 750;
}

.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(255, 106, 0, .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: #fed7aa;
    box-shadow: 0 16px 34px rgba(17, 24, 39, .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-rail {
    grid-auto-columns: minmax(400px, calc(50% - 7px));
  }

  .ad-card {
    height: 230px;
  }

  .ad-title {
    font-size: 1.25rem;
  }

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

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

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

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

  .ad-rail {
    grid-auto-columns: 88%;
  }

  .ad-card {
    height: 178px;
  }

  .ad-title {
    font-size: 1rem;
  }

  .ad-content {
    max-width: 78%;
  }

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

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

  .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;
  }

  .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;
  }
}
