/*
 * AFARD Commodity Market — "market feel" layer, loaded after storefront.css.
 * Stalls (catalogue), price tags, sidebar widgets.
 */

/* ---------- Catalogue: market stalls grouped by section ---------- */
.af-cats { background: #fff; }
.af-cats-wrap { gap: .75rem; }
.af-cats-track { position: relative; gap: 1rem; padding: .9rem 0 1rem; align-items: stretch; scroll-snap-type: x proximity; }
.af-cats-arrow { width: 46px; height: 46px; font-size: 1.25rem; box-shadow: 0 2px 6px rgba(17, 17, 17, .08); align-self: center; }
.af-cats-arrow:not([disabled]):hover { background: var(--af-yellow); border-color: var(--af-yellow); color: var(--af-ink); }

.af-aisle { flex: 0 0 auto; display: flex; flex-direction: column; gap: .45rem; padding: .5rem .6rem .6rem; border-radius: 14px; background: var(--stall-tint, #F1F2EE); scroll-snap-align: start; }
.af-aisle--all { --stall-tint: #FFF8DB; --stall-ink: #5C4600; }
.af-aisle-label { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--stall-ink, var(--af-ink)); display: inline-flex; align-items: center; gap: .35rem; padding-left: .2rem; white-space: nowrap; }
.af-aisle-items { display: flex; gap: .5rem; }

.af-stall {
    width: 104px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem;
    padding: .5rem .35rem .55rem; border-radius: 12px; background: #fff; color: var(--af-ink);
    border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.af-stall:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 8px 18px rgba(17, 17, 17, .1); }
.af-stall-img {
    width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: var(--stall-tint, var(--af-green-50));
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--stall-ink, var(--af-green-800));
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--af-line); transition: box-shadow .15s ease;
}
.af-stall-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.af-stall:hover .af-stall-img img { transform: scale(1.08); }
.af-stall-name { font-size: 14px; font-weight: 600; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; }
.af-stall-count { font-size: 12px; color: var(--af-muted); }
.af-stall.active { border-color: var(--af-yellow); box-shadow: 0 6px 16px rgba(255, 208, 18, .35); }
.af-stall.active .af-stall-img { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--af-yellow); }
.af-stall:active { transform: scale(.97); }
@media (max-width: 575.98px) {
    .af-stall { width: 88px; }
    .af-stall-img { width: 60px; height: 60px; }
    .af-stall-name { font-size: 13px; }
}

/* ---------- Price tag + trend badges ---------- */
.af-pricetag { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.af-pricetag .af-price { background: #FFF8D6; padding: .15rem .6rem .15rem .95rem; border-radius: 6px 10px 10px 6px; position: relative; box-shadow: inset 3px 0 0 var(--af-yellow); }
.af-pricetag .af-price::before { /* the hole in the price tag */
    content: ""; position: absolute; left: .38rem; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #E8D27A; }
.af-trend { display: inline-flex; align-items: center; gap: .1rem; font-size: 13px; font-weight: 700; border-radius: 999px; padding: .05rem .45rem; white-space: nowrap; }
.af-trend.up { background: #E3F5E4; color: #1B6E22; }
.af-trend.down { background: #FCE7E3; color: #A4321F; }

/* ---------- Sidebar widgets ---------- */
.af-widget { background: #fff; border: 1px solid var(--af-line); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
.af-widget-title { font-size: 1rem; display: flex; align-items: center; gap: .45rem; margin-bottom: .75rem; }
.af-widget-title .bi { color: var(--af-green-700); background: #FFF6CC; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.af-widget-note { font-size: 12.5px; color: var(--af-muted); margin: .6rem 0 0; }

.af-signposts { display: flex; flex-wrap: wrap; gap: .4rem; }
.af-signpost {
    display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .5rem .35rem .75rem;
    background: var(--af-bg); border: 1px solid var(--af-line); color: var(--af-ink); font-weight: 500; font-size: 14.5px;
    border-radius: 6px 14px 14px 6px; transition: background .15s ease, transform .15s ease;
}
.af-signpost span { font-size: 12px; font-weight: 700; background: #fff; border-radius: 999px; padding: 0 .45rem; color: var(--af-muted); }
.af-signpost:hover { background: #FFF6CC; text-decoration: none; transform: translateX(2px); }
.af-signpost.active { background: var(--af-green-800); border-color: var(--af-green-800); color: #fff; box-shadow: inset 0 -3px 0 var(--af-yellow); }
.af-signpost.active span { background: var(--af-yellow); color: var(--af-ink); }

.af-moves, .af-busy { list-style: none; margin: 0; padding: 0; }
.af-moves li + li, .af-busy li + li { border-top: 1px dashed var(--af-line); }
.af-moves a { display: flex; align-items: center; gap: .6rem; padding: .5rem .25rem; color: var(--af-ink); border-radius: 8px; transition: background .15s ease; }
.af-moves a:hover { background: var(--af-green-50); text-decoration: none; }
.af-moves img, .af-moves-noimg { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--af-green-50); display: inline-flex; align-items: center; justify-content: center; }
.af-moves-name { flex: 1; font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.af-moves-name small { display: block; font-weight: 400; font-size: 12.5px; color: var(--af-muted); margin-top: .1rem; }

.af-busy a { display: grid; grid-template-columns: 1fr auto; gap: .1rem .5rem; padding: .5rem .25rem; color: var(--af-ink); border-radius: 8px; }
.af-busy a:hover { background: var(--af-green-50); text-decoration: none; }
.af-busy-name { font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.af-busy-name small { display: block; font-weight: 400; font-size: 12.5px; color: var(--af-muted); }
.af-busy-n { font-family: var(--af-font-head); font-weight: 700; color: var(--af-green-800); align-self: center; }
.af-busy-bar { grid-column: 1 / -1; height: 6px; background: var(--af-bg); border-radius: 99px; overflow: hidden; }
.af-busy-bar span { display: block; height: 100%; background: var(--af-green); border-radius: 99px; box-shadow: inset -6px 0 0 var(--af-yellow); }

.af-tips { background: #FFF6CC; border-color: #F2DE96; }
.af-tips .af-widget-title .bi { background: #fff; color: #7A5A00; }
.af-tip strong { display: block; color: var(--af-ink); margin-bottom: .2rem; }
.af-tip p { margin: 0; color: #4A3D10; font-size: 14.5px; }
.af-tip.is-on { animation: af-tip-in .35s ease; }
@keyframes af-tip-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.af-tips-nav { display: flex; align-items: center; gap: .35rem; margin-top: .75rem; }
.af-tips-count { flex: 1; font-size: 13px; color: #6B5A1A; }
.af-tips-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #E8D27A; background: #fff; color: var(--af-ink); display: inline-flex; align-items: center; justify-content: center; }
.af-tips-btn:hover { background: var(--af-yellow); border-color: var(--af-yellow); }

.af-help { display: flex; gap: .75rem; align-items: flex-start; background: var(--af-green-900); border-color: var(--af-green-900); color: #DCE9DD; }
.af-help > .bi { font-size: 1.6rem; color: var(--af-yellow); }
.af-help strong { color: #fff; display: block; }
.af-help p { margin: 0 0 .5rem; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
    .af-stall, .af-stall-img img, .af-signpost { transition: none; }
    .af-tip.is-on { animation: none; }
    .af-stall:hover, .af-signpost:hover { transform: none; }
}
