/* ==========================================================================
   Gentora homepage: hero banner slider, single-row categories, smart shelf,
   recently viewed. Brand tokens from gentora-brand.css.
   ========================================================================== */

/* Sections keep the homepage rhythm from gentora-brand.css; the hero sits tight under the header */
.gentora-homepage > section.gj-hero { padding: 16px 0 4px !important; background: transparent !important; }
@media (min-width: 992px) {
    .gentora-homepage > section.gj-hero { padding: 24px 0 8px !important; }
}

/* ---------- Hero: rounded plain-image card, swipeable ---------- */
.gj-hero-viewport { position: relative; border-radius: 16px; overflow: hidden; background: var(--brand-ivory, #FAF6F0); }
.gj-hero-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.gj-hero-track::-webkit-scrollbar { display: none; }
.gj-hero-slide {
    flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; display: block;
    aspect-ratio: 16 / 10; /* mobile */
}
.gj-hero-slide picture, .gj-hero-slide img { display: block; width: 100%; height: 100%; }
.gj-hero-slide img { object-fit: cover; }
@media (min-width: 768px) {
    .gj-hero-slide { aspect-ratio: 18 / 7; } /* ~1440 x 560 */
    .gj-hero-viewport { border-radius: 20px; }
}
.gj-hero-dots {
    position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
    display: flex; gap: 6px; padding: 5px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.75);
}
.gj-hero-dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: rgba(31, 26, 23, 0.3); cursor: pointer; transition: width .2s, background .2s; }
.gj-hero-dot.is-active { width: 18px; background: var(--brand-primary, #6E2433); }
.gj-hero-dot:focus-visible { outline: 2px solid var(--brand-gold, #B08A4E); outline-offset: 2px; }

/* ---------- Shop by Category: one row ---------- */
.gj-cats-row {
    display: grid; grid-auto-flow: column; grid-auto-columns: 26%; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
}
.gj-cats-row::-webkit-scrollbar { display: none; }
.gj-cat { scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none !important; color: var(--brand-ink, #1F1A17); }
.gj-cat-img { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--brand-ivory, #FAF6F0); border: 1px solid var(--brand-border, #E9E2D8); }
.gj-cat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gj-cat:hover .gj-cat-img img { transform: scale(1.05); }
.gj-cat-name { font-size: 12.5px; font-weight: 500; text-align: center; line-height: 1.25; }
@media (min-width: 576px) { .gj-cats-row { grid-auto-columns: 18%; gap: 16px; } }
@media (min-width: 992px) {
    .gj-cats-row { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-columns: auto; gap: 24px; overflow: visible; }
    .gj-cat-name { font-size: 14px; }
}

/* ---------- Smart shelf (Picked for you / Popular right now) ---------- */
.gj-shelf {
    display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
}
.gj-shelf::-webkit-scrollbar { display: none; }
.gj-shelf-item { scroll-snap-align: start; min-width: 0; }
@media (min-width: 768px) { .gj-shelf { grid-auto-columns: 30%; gap: 16px; } }
@media (min-width: 992px) {
    .gj-shelf { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; gap: 20px; }
}

/* ---------- Recently viewed (compact) ---------- */
.gentora-homepage > section.gj-recent { padding-top: 8px !important; padding-bottom: 40px !important; }
.gj-recent-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; color: var(--brand-ink, #1F1A17); }
.gj-recent-row { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.gj-recent-row::-webkit-scrollbar { display: none; }
.gj-recent-item { flex: 0 0 108px; display: flex; flex-direction: column; gap: 4px; text-decoration: none !important; color: var(--brand-ink, #1F1A17); }
.gj-recent-img { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--brand-ivory, #FAF6F0); border: 1px solid var(--brand-border, #E9E2D8); }
.gj-recent-img img { width: 100%; height: 100%; object-fit: cover; }
.gj-recent-name { font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gj-recent-price { font-size: 12.5px; font-weight: 600; }
@media (min-width: 992px) { .gj-recent-item { flex-basis: 132px; } }

/* ------------------------------------------------------------------
   Infinite personalised feed ("Picked for you" / "Popular right now")
   2 columns on phones, 4 on tablets, 5 on desktop; offer cards span the row.
   ------------------------------------------------------------------ */
.gentora-homepage > section.gj-feed { padding-top: 32px !important; padding-bottom: 32px !important; }
.gj-feed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* 4/5 columns don't divide the 6-product offer rhythm: let later cards backfill the row before a full-width offer */
@media (min-width: 768px) { .gj-feed-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; grid-auto-flow: row dense; } }
@media (min-width: 992px) { .gj-feed-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; } }
.gj-feed-item { min-width: 0; }
.gj-feed-in { animation: gjFeedIn .35s ease both; }
@keyframes gjFeedIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Offer cards */
.gj-feed-offer {
    grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 16px;
    border-radius: 12px; background: var(--brand-primary-soft, #F6ECEE); border: 1px solid #EBD5DA;
    color: var(--brand-ink, #1F1A17);
}
.gj-feed-offer--gift { background: var(--brand-gold-soft, #F3EBDD); border-color: #E6D6BC; }
.gj-feed-offer--shipping { background: #EEF7F1; border-color: #CFE8D9; }
.gj-fo-img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #fff; }
.gj-fo-body { flex: 1; min-width: 0; }
.gj-fo-eyebrow { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-primary, #6E2433); }
.gj-feed-offer--gift .gj-fo-eyebrow { color: var(--brand-gold-text, #84632F); }
.gj-feed-offer--shipping .gj-fo-eyebrow { color: var(--brand-success, #1F7A4D); }
.gj-fo-ends { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--brand-muted, #6F655C); }
.gj-fo-title { font-family: var(--brand-font-serif, Georgia, serif); font-size: 19px; font-weight: 600; margin: 4px 0 2px; line-height: 1.25; }
.gj-fo-worth { font-family: var(--brand-font-sans); font-size: 13px; font-weight: 500; color: var(--brand-muted, #6F655C); }
.gj-fo-text { font-size: 13px; color: var(--brand-muted, #6F655C); margin: 0; }
.gj-fo-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.gj-fo-code {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 8px;
    border: 1.5px dashed var(--brand-primary, #6E2433); background: #fff; color: var(--brand-primary, #6E2433);
    font-weight: 700; letter-spacing: .05em; cursor: pointer;
}
.gj-fo-auto { font-size: 12px; font-weight: 700; color: var(--brand-success, #1F7A4D); background: #fff; border-radius: 999px; padding: 6px 10px; }
.gj-fo-link { font-size: 13px; font-weight: 700; color: var(--brand-primary, #6E2433) !important; text-decoration: underline !important; min-height: 24px; }
@media (max-width: 575.98px) {
    .gj-feed-offer { flex-wrap: wrap; }
    .gj-fo-actions { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}

/* Loading skeletons */
.gj-feed-skel { display: flex; flex-direction: column; gap: 8px; }
.gj-skel-img, .gj-skel-line { display: block; border-radius: 8px; background: linear-gradient(90deg, #F2EEE8 0%, #F8F5F0 50%, #F2EEE8 100%); background-size: 200% 100%; animation: gjSkel 1.2s ease-in-out infinite; }
.gj-skel-img { aspect-ratio: 1; }
.gj-skel-line { height: 12px; width: 85%; }
.gj-skel-line.short { width: 50%; }
@keyframes gjSkel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Feed footer: sentinel, "Show more", caught-up line */
.gj-feed-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 24px; }
.gj-feed-sentinel { width: 100%; height: 1px; }
.gj-feed-more {
    display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 200px; padding: 0 28px;
    border-radius: 999px; border: 1.5px solid var(--brand-ink, #1F1A17); background: #fff; color: var(--brand-ink, #1F1A17) !important;
    font-weight: 700; font-size: 15px; text-decoration: none !important; cursor: pointer;
}
.gj-feed-more:hover { background: var(--brand-ink, #1F1A17); color: #fff !important; }
.gj-feed-more:focus-visible { outline: 3px solid var(--brand-gold, #B08A4E); outline-offset: 3px; }
.gj-feed-more[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.gj-feed-more.is-js:not(.is-visible) { display: none; }   /* JS auto-loads first; the button appears after 4 pages */
.gj-feed-done { font-size: 13px; color: var(--brand-muted, #6F655C); margin: 0; }
.gj-feed-done[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
    .gj-feed-in, .gj-skel-img, .gj-skel-line { animation: none; }
}
