/*
 * AFARD Commodity Market — public site styles (on top of Bootstrap 5.2).
 * Brand from afard.net: green #3ABA41, yellow #FFD012, ink #0D0D0D. Deeper greens carry
 * white text. Yellow is reserved for the main action on a page (calling someone).
 * Kept deliberately plain: flat surfaces, thin borders, one radius, no decorative effects.
 */

:root {
    --af-green: #3ABA41;
    --af-green-700: #23862B;
    --af-green-800: #1B6E22;
    --af-green-900: #134F19;
    --af-green-50: #F0F8F0;
    --af-yellow: #FFD012;
    --af-yellow-hover: #F0C200;
    --af-ink: #111;
    --af-text: #2B2F33;
    --af-muted: #5F656B;
    --af-line: #E2E5E2;
    --af-bg: #F7F8F6;
    --af-amber-bg: #FFF6D6;
    --af-amber-ink: #6B4E00;
    --af-radius: 8px;
    --af-font-head: "Libre Franklin", "Franklin Gothic Medium", Arial, sans-serif;
    --af-font-body: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

    --bs-body-font-family: var(--af-font-body);
    --bs-body-color: var(--af-text);
    --bs-link-color: var(--af-green-700);
    --bs-link-hover-color: var(--af-green-900);
}

body.af { background: var(--af-bg); color: var(--af-text); font-size: 16px; line-height: 1.5; }
.af h1, .af h2, .af h3, .af h4 { font-family: var(--af-font-head); font-weight: 700; color: var(--af-ink); letter-spacing: -.01em; }
.af a { text-decoration: none; }
.af a:hover { text-decoration: underline; }
.af :focus-visible { outline: 3px solid var(--af-yellow); outline-offset: 2px; }
.af .text-muted-af { color: var(--af-muted); }

.af-skip { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--af-yellow); color: var(--af-ink); padding: .5rem 1rem; border-radius: var(--af-radius); font-weight: 600; }
.af-skip:focus { left: 8px; }

/* ---------- Top bar: link back to the AFARD website ---------- */
.af-topbar { background: var(--af-ink); color: #D9DCD9; font-size: 14px; }
.af-topbar a { color: #fff; }
.af-topbar .af-back { font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }
.af-topbar-links { gap: 1.25rem; }
.af-topbar-links a { color: #D9DCD9; }
.af-topbar-links a:hover, .af-topbar a:hover { color: var(--af-yellow); text-decoration: none; }

/* ---------- Header ---------- */
.af-header { background: #fff; border-bottom: 1px solid var(--af-line); position: sticky; top: 0; z-index: 1030; }
.af-header::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--af-green) 0 78%, var(--af-yellow) 78% 100%); } /* AFARD green + gold brand stripe (hard split) */
.af-brand { display: flex; align-items: center; gap: .75rem; color: var(--af-ink); }
.af-brand:hover { text-decoration: none; }
.af-brand img { height: 48px; width: auto; }
.af-brand-text { border-left: 1px solid var(--af-line); padding-left: .75rem; line-height: 1.2; }
.af-brand-text strong { display: block; font-family: var(--af-font-head); font-size: 1.05rem; }
.af-brand-text span { font-size: 13px; color: var(--af-muted); }

.af-search { position: relative; flex: 1 1 auto; max-width: 520px; }
.af-search .form-control { height: 44px; border-radius: var(--af-radius); padding-left: 2.5rem; padding-right: 5.75rem; border: 1px solid #C9CEC9; }
.af-search .form-control:focus { border-color: var(--af-green-700); box-shadow: 0 0 0 3px rgba(35, 134, 43, .15); }
.af-search .bi-search { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--af-muted); }
.af-search .btn { position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 1rem; }

.af-nav { display: flex; gap: .25rem; }
.af-nav a { color: var(--af-ink); font-weight: 500; padding: .5rem .75rem; border-radius: var(--af-radius); border-bottom: 3px solid transparent; }
.af-nav a:hover { background: var(--af-green-50); text-decoration: none; }
.af-nav a.active { color: var(--af-green-800); border-bottom-color: var(--af-yellow); border-radius: var(--af-radius) var(--af-radius) 0 0; }

/* ---------- Buttons (one radius, no pills) ---------- */
.af .btn { border-radius: var(--af-radius); font-weight: 600; }
.btn-af { --bs-btn-bg: var(--af-green-700); --bs-btn-border-color: var(--af-green-700); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--af-green-800); --bs-btn-hover-border-color: var(--af-green-800); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--af-green-900); --bs-btn-active-border-color: var(--af-green-900); }
.btn-af-call { --bs-btn-bg: var(--af-yellow); --bs-btn-border-color: var(--af-yellow); --bs-btn-color: var(--af-ink); --bs-btn-hover-bg: var(--af-yellow-hover); --bs-btn-hover-border-color: var(--af-yellow-hover); --bs-btn-hover-color: var(--af-ink); --bs-btn-active-bg: var(--af-yellow-hover); --bs-btn-active-border-color: var(--af-yellow-hover); }
.btn-af-outline { --bs-btn-color: var(--af-green-800); --bs-btn-border-color: #BFD8C1; --bs-btn-bg: #fff; --bs-btn-hover-bg: var(--af-green-50); --bs-btn-hover-border-color: var(--af-green-700); --bs-btn-hover-color: var(--af-green-900); }

/* ---------- Category strip with arrow buttons ---------- */
.af-cats { background: #fff; border-bottom: 1px solid var(--af-line); }
.af-cats-wrap { position: relative; display: flex; align-items: center; gap: .5rem; }
.af-cats-track { display: flex; gap: .5rem; overflow-x: auto; padding: .75rem 0; scroll-behavior: smooth; scrollbar-width: none; flex: 1; }
.af-cats-track::-webkit-scrollbar { display: none; }
.af-cats-arrow {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid #C9CEC9; background: #fff; color: var(--af-ink);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.af-cats-arrow:hover { border-color: var(--af-green-700); color: var(--af-green-800); }
.af-cats-arrow[disabled] { opacity: .35; cursor: default; }
.af-chip {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: .5rem;
    padding: .3rem .75rem .3rem .3rem; border-radius: var(--af-radius);
    background: #fff; border: 1px solid var(--af-line); color: var(--af-ink); font-size: 15px; white-space: nowrap;
}
.af-chip:hover { border-color: var(--af-green-700); text-decoration: none; }
.af-chip img, .af-chip .af-chip-icon { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; background: var(--af-green-50); display: inline-flex; align-items: center; justify-content: center; color: var(--af-green-700); }
.af-chip.active { background: var(--af-green-800); border-color: var(--af-green-800); color: #fff; box-shadow: inset 0 -3px 0 var(--af-yellow); }
.af-chip.active .af-chip-icon { background: rgba(255, 255, 255, .15); color: #fff; }

/* ---------- Page headers ---------- */
.af-hero, .af-banner { background: var(--af-green-900); color: #fff; }
.af-hero { padding: 2.25rem 0 2rem; }
.af-banner { padding: 1.5rem 0; }
.af-hero h1, .af-banner h1 { color: #fff; margin: 0 0 .4rem; }
.af-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.af-banner h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.af-hero p, .af-banner p { color: #DCE9DD; margin: 0; max-width: 640px; font-size: 1.05rem; }
.af-banner .breadcrumb { --bs-breadcrumb-divider-color: #9DBB9F; margin-bottom: .5rem; font-size: 14px; }
.af-banner .breadcrumb a { color: var(--af-yellow); text-decoration: underline; }
.af-banner .breadcrumb-item.active { color: #DCE9DD; }

.af-facts-row { display: flex; flex-wrap: wrap; gap: 0; margin-top: 1.5rem; border-top: 1px solid rgba(255, 208, 18, .45); padding-top: 1rem; }
.af-facts-row div { padding-right: 1.75rem; margin-right: 1.75rem; border-right: 1px solid rgba(255, 255, 255, .2); }
.af-facts-row div:last-child { border-right: 0; }
.af-facts-row strong { display: block; font-family: var(--af-font-head); font-size: 1.35rem; color: #fff; }
.af-facts-row span { font-size: 14px; color: #DCE9DD; }

/* ---------- How it works ---------- */
.af-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.af-step { display: flex; gap: .85rem; align-items: flex-start; }
.af-step-num { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--af-yellow); color: var(--af-ink); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.af-step strong { display: block; color: var(--af-ink); }
.af-step span { font-size: 15px; color: var(--af-muted); }
@media (max-width: 767.98px) { .af-steps { grid-template-columns: 1fr; } }

/* ---------- Surfaces ---------- */
.af-panel { background: #fff; border: 1px solid var(--af-line); border-radius: var(--af-radius); }
.af-notice { background: var(--af-amber-bg); color: var(--af-amber-ink); border: 1px solid #F2DE96; border-radius: var(--af-radius); padding: .75rem 1rem; display: flex; gap: .6rem; align-items: flex-start; }
.af-section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.af-section-title h2 { font-size: 1.35rem; margin: 0; }

.af-filters .af-filter-title { font-weight: 700; font-size: 15px; color: var(--af-ink); margin-bottom: .5rem; display: block; }
.af-filters .list-group-item { border: 0; border-radius: 6px !important; padding: .45rem .6rem; display: flex; justify-content: space-between; color: var(--af-text); }
.af-filters .list-group-item:hover { background: var(--af-green-50); text-decoration: none; }
.af-filters .list-group-item.active { background: var(--af-green-50); color: var(--af-green-900); font-weight: 600; box-shadow: inset 3px 0 0 var(--af-yellow); }
.af-filters .list-group-item .af-n { color: var(--af-muted); font-size: 14px; }
.af .form-select, .af .form-control { border-color: #C9CEC9; border-radius: var(--af-radius); }

.af-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.af-active-filter { display: inline-flex; align-items: center; gap: .3rem; background: #fff; border: 1px solid var(--af-line); color: var(--af-ink); border-radius: var(--af-radius); padding: .15rem .6rem; font-size: 14px; }

/* ---------- Product card ---------- */
.af-product { background: #fff; border: 1px solid var(--af-line); border-radius: var(--af-radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; position: relative; }
.af-product:hover { border-color: #A9C7AB; }
.af-product-media { aspect-ratio: 4 / 3; background: var(--af-green-50); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.af-product-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.af-noimg { font-size: 2.5rem; color: var(--af-green-700); opacity: .5; }
.af-product-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.af-product-cat { font-size: 14px; color: var(--af-muted); }
.af-product-title { font-size: 1.1rem; margin: 0 0 .35rem; }
.af-product-title a { color: var(--af-ink); }
.af-product-title a::after { content: ""; position: absolute; inset: 0; } /* whole card is the link */
.af-price-label { font-size: 14px; color: var(--af-muted); }
.af-price { font-family: var(--af-font-head); font-size: 1.35rem; font-weight: 700; color: var(--af-green-800); line-height: 1.2; }
.af-price small { font-family: var(--af-font-body); font-size: .9rem; font-weight: 400; color: var(--af-muted); }
.af-product-meta { margin-top: auto; padding-top: .6rem; font-size: 14px; color: var(--af-muted); }
.af-old { color: var(--af-amber-ink); }

/* ---------- Product page ---------- */
.af-gallery-main { aspect-ratio: 1 / 1; background: var(--af-green-50); border: 1px solid var(--af-line); border-radius: var(--af-radius); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.af-gallery-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.af-thumbs { display: flex; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.af-thumbs button { width: 60px; height: 60px; border-radius: 6px; border: 2px solid var(--af-line); background: #fff; padding: 0; overflow: hidden; }
.af-thumbs button.active { border-color: var(--af-green-700); }
.af-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.af-buybox { padding: 1.25rem; }
.af-three { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--af-line); border-radius: var(--af-radius); margin: .75rem 0 1rem; }
.af-three div { padding: .75rem 1rem; border-right: 1px solid var(--af-line); }
.af-three div:last-child { border-right: 0; }
.af-three span { display: block; font-size: 14px; color: var(--af-muted); }
.af-three strong { font-family: var(--af-font-head); font-size: 1.2rem; color: var(--af-ink); }
.af-three .is-main { background: #FFFBEA; box-shadow: inset 0 3px 0 var(--af-yellow); }
.af-three .is-main strong { color: var(--af-green-800); font-size: 1.45rem; }

.af-units { display: flex; flex-wrap: wrap; gap: .4rem; }
.af-units a { border: 1px solid #C9CEC9; border-radius: var(--af-radius); padding: .35rem .8rem; color: var(--af-ink); background: #fff; font-size: 15px; }
.af-units a:hover { border-color: var(--af-green-700); text-decoration: none; }
.af-units a.active { background: var(--af-ink); border-color: var(--af-ink); color: #fff; box-shadow: inset 0 -3px 0 var(--af-yellow); }

/* Buyer rows */
.af-row { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: .9rem 1rem; border-bottom: 1px solid var(--af-line); }
.af-row:last-child { border-bottom: 0; }
.af-row-title { font-weight: 600; color: var(--af-ink); }
.af-row-meta { font-size: 14px; color: var(--af-muted); }
.af-row-price { text-align: right; }
.af-row-price strong { font-family: var(--af-font-head); font-size: 1.2rem; color: var(--af-green-800); }
.af-tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 0 .45rem; border-radius: 4px; background: var(--af-yellow); color: var(--af-ink); margin-left: .35rem; vertical-align: 1px; }
@media (max-width: 575.98px) {
    .af-row { grid-template-columns: 1fr auto; }
    .af-row-cta { grid-column: 1 / -1; }
    .af-row-cta .btn { width: 100%; }
}

/* ---------- Markets ---------- */
.af-market-card { display: flex; flex-direction: column; height: 100%; padding: 1rem; position: relative; }
.af-market-card:hover { border-color: #A9C7AB; }
.af-market-card h3 { font-size: 1.1rem; margin: 0 0 .15rem; }
.af-market-card h3 a { color: var(--af-ink); }
.af-market-card h3 a::after { content: ""; position: absolute; inset: 0; }
.af-previews { display: flex; gap: .3rem; margin-top: .75rem; }
.af-previews img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--af-green-50); }

/* ---------- Offers ---------- */
.af-deal { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.af-deal-media { aspect-ratio: 16 / 10; background: var(--af-green-50); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.af-deal-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.af-deal-body { padding: 1rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }

/* ---------- Empty states ---------- */
.af-empty { text-align: center; padding: 2.5rem 1.25rem; }
.af-empty .bi { font-size: 2rem; color: var(--af-green-700); }
.af-empty h3 { font-size: 1.2rem; margin: .75rem 0 .35rem; }
.af-empty p { color: var(--af-muted); max-width: 460px; margin: 0 auto 1rem; }

.af .pagination { --bs-pagination-color: var(--af-green-800); --bs-pagination-active-bg: var(--af-green-800); --bs-pagination-active-border-color: var(--af-green-800); }

/* ---------- Footer ---------- */
.af-footer { background: var(--af-green-900); color: #DCE9DD; margin-top: 4rem; font-size: 15px; border-top: 4px solid var(--af-yellow); }
.af-footer h4 { color: #fff; font-size: 1rem; margin-bottom: .9rem; }
.af-footer h4::after { content: ""; display: block; width: 28px; height: 3px; background: var(--af-yellow); border-radius: 2px; margin-top: .4rem; }
.af-footer a { color: #fff; }
.af-footer a:hover { color: var(--af-yellow); }
.af-footer ul { list-style: none; padding: 0; margin: 0; }
.af-footer li { margin-bottom: .45rem; }
.af-footer-logo { background: #fff; border-radius: var(--af-radius); padding: .5rem .75rem; display: inline-block; }
.af-footer-logo img { height: 60px; }
.af-socials { display: flex; gap: .5rem; }
.af-socials a { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, .35); }
.af-socials a:hover { border-color: var(--af-yellow); text-decoration: none; }
.af-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); padding: 1rem 0; font-size: 14px; }

/* ---------- Mobile menu ---------- */
.af-offcanvas .af-menu-group { font-weight: 700; font-size: 14px; color: var(--af-muted); margin: 1.25rem 0 .4rem; }
.af-offcanvas .list-group-item { border: 0; padding: .7rem .25rem; color: var(--af-ink); display: flex; align-items: center; gap: .6rem; font-size: 16px; }
.af-offcanvas .list-group-item.active { background: var(--af-green-50); color: var(--af-green-900); border-radius: 6px; padding-left: .6rem; }

/* ---------- Phones ---------- */
@media (max-width: 575.98px) {
    .af-product-body { padding: .65rem .7rem .75rem; }
    .af-product-title { font-size: 1rem; }
    .af-price { font-size: 1.15rem; }
    .af-product-meta, .af-product-cat, .af-price-label { font-size: 13px; }
    .af-facts-row div { padding-right: 1rem; margin-right: 1rem; }
    .af-three div { padding: .6rem .7rem; }
    .af-three .is-main strong { font-size: 1.2rem; }
}

/* ---------- AFARD gold highlights ---------- */
.af-hero h1::after, .af-banner h1::after { content: "."; color: var(--af-yellow); }
.af-section-title h2::after { content: ""; display: block; width: 40px; height: 3px; background: var(--af-yellow); border-radius: 2px; margin-top: .4rem; }
.af-media-tag { position: absolute; left: .6rem; bottom: .6rem; background: var(--af-yellow); color: var(--af-ink); font-size: 12.5px; font-weight: 700; padding: .15rem .5rem; border-radius: 4px; }
.af-facts-row strong { color: #fff; }
.af-facts-row div:first-child strong { color: var(--af-yellow); }

/* ---------- Interactive cards ----------
 * Hover / keyboard focus: card lifts, gold edge grows across the top, photo zooms slightly,
 * title turns green and the arrow slides. Touch: a short press effect instead of hover. */
.af-interactive { position: relative; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.af-interactive::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 2;
    background: var(--af-yellow); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.af-interactive img { transition: transform .35s ease; }
.af-interactive .af-product-title a, .af-interactive h3 a { transition: color .15s ease; }
.af-card-foot { margin-top: auto; padding-top: .65rem; border-top: 1px solid var(--af-line); display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: 14px; color: var(--af-muted); }
.af-card-cta { color: var(--af-green-700); font-weight: 600; white-space: nowrap; }
.af-card-cta .bi { display: inline-block; transition: transform .18s ease; }
.af-product-body .af-card-foot { margin-top: auto; }
.af-product-body { gap: .15rem; }
.af-product-cat + .af-card-foot, .af-price + .af-card-foot { margin-top: auto; }

@media (hover: hover) {
    .af-interactive:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(17, 17, 17, .12); border-color: #F2DE96; }
    .af-interactive:hover::before { transform: scaleX(1); }
    .af-interactive:hover img { transform: scale(1.06); }
    .af-interactive:hover .af-product-title a, .af-interactive:hover h3 a { color: var(--af-green-800); }
    .af-interactive:hover .af-card-cta .bi { transform: translateX(4px); }
}
.af-interactive:focus-within { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--af-yellow), 0 12px 28px rgba(17, 17, 17, .12); }
.af-interactive:focus-within::before { transform: scaleX(1); }
.af-interactive :focus-visible { outline: none; } /* the whole card shows focus instead */
.af-interactive:active { transform: scale(.985); box-shadow: 0 4px 12px rgba(17, 17, 17, .1); }

@media (max-width: 575.98px) {
    .af-card-foot { font-size: 12.5px; }
    .af-card-cta span, .af-card-cta { font-size: 0; }
    .af-card-cta .bi { font-size: 16px; }
    .af-media-tag { font-size: 11px; left: .4rem; bottom: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
    .af-interactive, .af-interactive::before, .af-interactive img, .af-card-cta .bi { transition: none; }
    .af-interactive:hover, .af-interactive:focus-within, .af-interactive:active { transform: none; }
    .af-interactive:hover img { transform: none; }
}
