/* Homepage (resources/views/home/index.blade.php). Scoped under .hm so it can't leak into other pages. */
.hm {
    --hm-accent: #ffc800;
    --hm-accent-dark: #e6b400;
    --hm-ink: #1c1c1e;
    --hm-muted: #6b6b73;
    --hm-line: #ececf0;
    --hm-radius: 12px;
    --hm-gap: 16px;
    font-family: "Poppins", "Noto Sans Tamil", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--hm-ink);
}
.hm a { text-decoration: none; color: inherit; }
.hm :focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }

/* ---------- Hero ---------- */
.hm-hero { padding: 16px 0 8px; }
.hm-hero-swiper { border-radius: var(--hm-radius); overflow: hidden; position: relative; }
.hm-banner { position: relative; aspect-ratio: 16 / 6; background: #f3f3f6; }
.hm-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-banner-link { position: absolute; inset: 0; z-index: 2; }
.hm-banner-text { position: absolute; z-index: 1; left: clamp(16px, 4vw, 56px); top: 50%; transform: translateY(-50%); max-width: 46%; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.hm-banner-text h2 { font-size: clamp(18px, 3vw, 38px); line-height: 1.25; margin: 0 0 8px; color: inherit; }
.hm-banner-text p { margin: 0 0 14px; font-size: clamp(13px, 1.4vw, 18px); }
.hm-hero-swiper .wrap-pagination { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 3; }
@media (max-width: 767px) {
    .hm-banner { aspect-ratio: 4 / 3; }
    .hm-banner-text { max-width: 80%; }
}

/* ---------- Promo tiles ---------- */
.hm-promos { padding: 8px 0; }
.hm-promo-grid { display: grid; gap: var(--hm-gap); grid-template-columns: repeat(2, 1fr); }
.hm-promo-1 { grid-template-columns: 1fr; }
.hm-promo-3 { grid-template-columns: repeat(3, 1fr); }
.hm-promo { position: relative; display: block; border-radius: var(--hm-radius); overflow: hidden; aspect-ratio: 16 / 7; background: #f3f3f6; transition: transform .2s, box-shadow .2s; }
.hm-promo:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.hm-promo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-promo-text { position: absolute; left: 16px; bottom: 14px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); display: grid; }
@media (max-width: 767px) {
    .hm-promo-grid, .hm-promo-3 { grid-template-columns: 1fr; }
}

/* ---------- Section header ---------- */
.hm-section { padding: 22px 0 6px; }
.hm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hm-title { font-size: clamp(18px, 2.2vw, 24px); font-weight: 700; margin: 0; line-height: 1.3; }
.hm-viewall { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--hm-ink); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--hm-line); transition: background .15s, border-color .15s; white-space: nowrap; }
.hm-viewall:hover { background: var(--hm-accent); border-color: var(--hm-accent); }
.hm-viewall .icon { font-size: 10px; }
.hm-empty { text-align: center; color: var(--hm-muted); padding: 40px 0; }

/* ---------- Horizontal product row ---------- */
.hm-row-wrap { position: relative; }
.hm-row {
    --cols: 5.3;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--cols) - 1) * var(--hm-gap)) / var(--cols));
    gap: var(--hm-gap);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 2px 2px 10px;
}
.hm-row::-webkit-scrollbar { display: none; }
.hm-row { cursor: grab; }
.hm-row.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.hm-row.is-dragging a, .hm-row.is-dragging img { pointer-events: none; }
@media (max-width: 1199px) { .hm-row { --cols: 4.2; } }
@media (max-width: 991px)  { .hm-row { --cols: 3.2; } }
@media (max-width: 767px)  { .hm-row { --cols: 2.2; --hm-gap: 12px; } }
.hm-nav { position: absolute; top: 38%; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s; }
.hm-nav[hidden] { display: none; }
.hm-nav:hover { background: var(--hm-accent); }
.hm-nav.is-prev { left: -10px; }
.hm-nav.is-next { right: -10px; }
.hm-nav .icon { font-size: 12px; }
@media (max-width: 767px) {
    .hm-nav { width: 32px; height: 32px; top: 30%; }
    .hm-nav.is-prev { left: 4px; }
    .hm-nav.is-next { right: 4px; }
    .hm-name { font-size: 15px; }
    .hm-price-now { font-size: 16px; }
    .hm-price-old { font-size: 13px; }
}
.hm-progress { height: 4px; border-radius: 4px; background: var(--hm-line); margin: 6px 2px 0; overflow: hidden; }
.hm-progress-thumb { display: block; height: 100%; width: 30%; border-radius: 4px; background: var(--hm-accent-dark); transform: translateX(0); }
.hm-progress[hidden] { display: none; }

/* ---------- Card ---------- */
.hm-card { scroll-snap-align: start; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); overflow: hidden; transition: box-shadow .2s, transform .2s; min-width: 0; }
.hm-card:hover { box-shadow: 0 8px 22px rgba(0,0,0,.1); transform: translateY(-2px); }
.hm-media { position: relative; aspect-ratio: 3 / 4; background: #f3f3f6; overflow: hidden; }
.hm-media-link { display: block; width: 100%; height: 100%; }
.hm-img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.hm-img.is-loaded { opacity: 1; }
/* skeleton shimmer while the image is loading */
.hm-media::before, .hm-cat-img::before, .hm-author-img::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(100deg, #f1f1f5 30%, #fafafc 50%, #f1f1f5 70%);
    background-size: 200% 100%;
    animation: hm-shimmer 1.3s linear infinite;
}
.hm-media:has(.is-loaded)::before, .hm-cat-img:has(.is-loaded)::before, .hm-author-img:has(.is-loaded)::before, .hm-cat-img:has(.hm-initial)::before, .hm-author-img:has(.hm-initial)::before { display: none; }
@keyframes hm-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .hm-media::before, .hm-cat-img::before, .hm-author-img::before { animation: none; } .hm-card, .hm-promo { transition: none; } }
.hm-badge { position: absolute; z-index: 2; top: 8px; left: 8px; background: #1c1c1e; color: #fff; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.hm-wish { position: absolute; z-index: 2; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.hm-wish:hover { background: #fff; }
.hm-wish .icon { font-size: 15px; }
.hm-wish .icon-heart-full { display: none; color: #e53935; }
.hm-wish.active .icon-heart { display: none; }
.hm-wish.active .icon-heart-full { display: inline; }
.hm-body { display: flex; flex-direction: column; gap: 6px; padding: 12px; flex: 1; }
.hm-name { font-size: 17px; font-weight: 600; line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.hm-name a:hover { text-decoration: underline; }
.hm-author { font-size: 12.5px; color: var(--hm-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.4em; }
.hm-author:hover { color: var(--hm-ink); text-decoration: underline; }
.hm-price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 4px; }
.hm-price-now { font-size: 18px; font-weight: 700;  color: #db1215; }
.hm-price-old { font-size: 15px; color: var(--hm-muted); text-decoration: line-through; }
.hm-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 8px; background: var(--hm-accent); color: var(--hm-ink); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: background .15s; }
.hm-btn:hover { background: var(--hm-accent-dark); }
.hm-btn.is-out { background: #fff; border: 1px solid #e53935; color: #e53935; cursor: default; }
.hm-btn-inline { display: inline-flex; width: auto; padding: 8px 20px; }

/* ---------- Category cards ---------- */
.hm-cat-grid { display: grid; gap: var(--hm-gap); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hm-cat { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 10px; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); background: #fff; text-align: center; transition: box-shadow .2s, border-color .2s; }
.hm-cat:hover { border-color: var(--hm-accent); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.hm-cat-img { position: relative; width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: #f3f3f6; display: flex; align-items: center; justify-content: center; }
.hm-cat-name { font-size: 14px; font-weight: 600; line-height: 1.4; }
.hm-initial { font-size: 30px; font-weight: 700; color: var(--hm-ink); }
.hm-cat-img:has(.hm-initial), .hm-author-img:has(.hm-initial) { background: var(--hm-accent); }

/* ---------- Authors ---------- */
.hm-authors { display: grid; gap: 20px var(--hm-gap); grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.hm-author-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.hm-author-img { position: relative; width: 110px; height: 110px; border-radius: 50%; overflow: hidden; background: #f3f3f6; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--hm-line); transition: box-shadow .2s; }
.hm-author-card:hover .hm-author-img { box-shadow: 0 0 0 3px var(--hm-accent); }
.hm-author-name { font-size: 14px; font-weight: 600; line-height: 1.4; }

/* ---------- Subscription block ---------- */
.hm-subscribe { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; background: #fff8dc; border-radius: var(--hm-radius); padding: 20px; }
.hm-subscribe img { width: 100%; border-radius: var(--hm-radius); display: block; }
.hm-subscribe h2 { font-size: clamp(20px, 2.4vw, 28px); margin: 6px 0 10px; }
.hm-subscribe p { color: var(--hm-muted); margin-bottom: 16px; }
@media (max-width: 767px) { .hm-subscribe { grid-template-columns: 1fr; } }

.hm { padding-bottom: 24px; }

/* Progress bar is a mobile/tablet cue only; desktop uses the arrows. */
@media (min-width: 992px) { .hm-progress { display: none !important; } }

/* Scroll progress bar removed on all screen sizes. */
.hm-progress { display: none !important; }
