/*
 * AnNoor homepage sections (Homepage Builder).
 *
 * Extends annoor.css section 10 with the pieces the admin-built sections need: banners, product and
 * store rails, subcategory chips, collections, newsletter, FAQ, lazy placeholders. Tokens come from
 * annoor.css; logical properties throughout so RTL mirrors.
 */

/* ------------------------------ section heading ------------------------------ */
.an-section__titles { min-width: 0; }
.an-section__sub { margin: 2px 0 0; color: var(--text-2); font-size: 12px; }

/* ------------------------------ optional banner ------------------------------ */
.an-banner { display: block; margin-bottom: 12px; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); }
.an-banner img { display: block; width: 100%; height: auto; }

/* ------------------------------ rails (product + store carousels) ------------------------------ */
.an-rail-wrap { position: relative; }
.an-rail-wrap .an-rail-arrow { position: absolute; top: calc(50% - 16px); z-index: 2; }
.an-rail-arrow--prev { inset-inline-start: -14px; }
.an-rail-arrow--next { inset-inline-end: -14px; }
@media (max-width: 991.98px) { .an-rail-wrap .an-rail-arrow { display: none; } }

/* ------------------------------ stores ------------------------------ */
.an-deals-row--solo { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) {
  .an-stores--wide { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); }
  .an-stores--rail { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 3px; margin: -3px; }
  .an-stores--rail::-webkit-scrollbar { display: none; }
  .an-stores--rail .an-store { flex: 0 0 calc((100% - 44px) / 5); scroll-snap-align: start; }
}

/* ------------------------------ subcategory chips ------------------------------ */
.an-hsubs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.an-hsub { display: inline-flex; flex-direction: column; justify-content: center; min-height: 40px; padding: 5px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); line-height: 1.2; }
.an-hsub:hover { color: var(--teal-dark); border-color: var(--teal); }
.an-hsub strong { font-size: 12.5px; font-weight: 700; }
.an-hsub small { font-size: 10.5px; color: var(--text-2); }
@media (max-width: 991.98px) {
  .an-hsubs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -12px; padding-inline: 12px; }
  .an-hsubs::-webkit-scrollbar { display: none; }
  .an-hsub { flex: 0 0 auto; white-space: nowrap; }
}

/* ------------------------------ vendor collections ------------------------------ */
.an-collections { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.an-collection { display: flex; align-items: center; gap: 12px; padding: 10px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-card); color: var(--ink); min-width: 0; }
.an-collection:hover { color: var(--ink); box-shadow: 0 6px 16px rgba(15, 42, 67, 0.14); }
.an-collection__art { flex: 0 0 64px; width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; border-radius: var(--r); background: var(--teal-soft); color: var(--teal-dark); font-size: 22px; font-weight: 800; }
.an-collection__art img { width: 100%; height: 100%; object-fit: cover; }
.an-collection__body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.an-collection__body strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-collection__body small { color: var(--text-2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-collection__body em { font-style: normal; color: var(--teal-dark); font-size: 11px; font-weight: 700; }
@media (max-width: 1199.98px) { .an-collections { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991.98px) {
  .an-collections { display: flex; overflow-x: auto; gap: 10px; scrollbar-width: none; scroll-snap-type: x proximity; margin-inline: -12px; padding: 3px 12px; scroll-padding-inline: 12px; }
  .an-collections::-webkit-scrollbar { display: none; }
  .an-collection { flex: 0 0 76%; scroll-snap-align: start; }
}

/* ------------------------------ bands: icon, newsletter ------------------------------ */
.an-band__icon { flex-shrink: 0; color: var(--teal); }
.an-band--news { background: #eaf4f4; }
.an-news { display: flex; align-items: center; gap: 8px; flex: 0 1 420px; }
.an-news__input { flex: 1; min-width: 0; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; color: var(--ink); }
.an-news__input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
@media (max-width: 991.98px) {
  .an-band--news { flex-direction: column; align-items: stretch; }
  .an-news { flex-basis: auto; }
}

/* ------------------------------ help & support ------------------------------ */
.an-help { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.an-help__links { display: flex; flex-wrap: wrap; gap: 8px; }
.an-faq + .an-help__links { flex-direction: column; }
.an-faq { display: flex; flex-direction: column; gap: 8px; }
.an-faq__item { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.an-faq__item summary { cursor: pointer; padding: 10px 14px; font-weight: 700; color: var(--ink); }
.an-faq__item p { margin: 0; padding: 0 14px 12px; color: var(--text); }
@media (max-width: 991.98px) {
  .an-help { grid-template-columns: minmax(0, 1fr); }
  .an-faq + .an-help__links { flex-direction: row; }
}

/* ------------------------------ lazy placeholders + discover ------------------------------ */
.an-lazy { margin-top: 28px; min-height: 220px; }
.an-lazy__title { width: 180px; height: 22px; margin-bottom: 14px; }
.an-lazy__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 20px; }
.an-lazy__row .an-skel { height: 180px; }
@media (max-width: 1199.98px) { .an-lazy__row { grid-template-columns: repeat(4, minmax(0, 1fr)); } .an-lazy__row .an-skel:nth-child(5) { display: none; } }
@media (max-width: 991.98px) {
  .an-lazy { margin-top: 20px; }
  .an-lazy__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .an-lazy__row .an-skel:nth-child(n + 3) { display: none; }
}
.an-discover.htmx-request { opacity: 0.5; transition: opacity 0.2s; }

/* ------------------------------ admin preview ------------------------------ */
.an-preview-bar { position: sticky; top: 0; z-index: 5; padding: 6px 12px; background: var(--gold); color: var(--ink); text-align: center; font-size: 12px; font-weight: 700; }
.an-preview-flag { display: inline-block; margin-top: 20px; padding: 1px 10px; border-radius: 999px; background: #fde6e7; color: #c8323f; font-size: 11px; font-weight: 700; }
