/* ==========================================================
   FAIDAMALL DESIGN SYSTEM
   Glassmorphism over an agro-topography motif. Alibaba-style
   density and RFQ-first commerce patterns.
   ========================================================== */

:root {
    /* Palette */
    --fm-milk: #F7F8F4;
    --fm-milk-deep: #EFF2EA;
    --fm-forest: #14532D;
    --fm-forest-deep: #0D3B20;
    --fm-green: #1E7C3F;
    --fm-green-bright: #2FA157;
    --fm-lime: #8BC34A;
    --fm-ink: #1C1F1B;
    --fm-ink-soft: #4B5147;
    --fm-line: rgba(28, 31, 27, 0.10);
    --fm-glass: rgba(255, 255, 255, 0.55);
    --fm-glass-strong: rgba(255, 255, 255, 0.78);
    --fm-glass-dark: rgba(13, 59, 32, 0.55);
    --fm-amber: #C88A1F;
    --fm-wa: #25D366;

    /* Type */
    --fm-font-display: 'Space Grotesk', 'DM Sans', sans-serif;
    --fm-font-body: 'DM Sans', sans-serif;

    /* Radius / shadow */
    --fm-radius: 18px;
    --fm-radius-sm: 12px;
    --fm-shadow-soft: 0 8px 30px rgba(20, 83, 45, 0.08);
    --fm-shadow-lift: 0 20px 45px rgba(20, 83, 45, 0.14);
}

* { box-sizing: border-box; }

body.fm-body {
    background-color: var(--fm-milk);
    color: var(--fm-ink);
    font-family: var(--fm-font-body);
    position: relative;
}

/* Ambient topography backdrop - the signature element: farmland contour
   lines rendered as ultra-faint SVG, fixed behind all glass panels. */
.fm-topo-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(30, 124, 63, 0.06) 0, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(139, 195, 74, 0.07) 0, transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(20, 83, 45, 0.05) 0, transparent 50%);
}

.fm-container { position: relative; z-index: 1; }

h1, h2, h3, h4, .fm-display {
    font-family: var(--fm-font-display);
    letter-spacing: -0.01em;
    color: var(--fm-ink);
}

a { color: inherit; text-decoration: none; }

/* ---------- Glass primitives ---------- */

.fm-glass {
    background: var(--fm-glass);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--fm-shadow-soft);
}

.fm-glass-strong {
    background: var(--fm-glass-strong);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.fm-glass-dark {
    background: linear-gradient(135deg, rgba(13, 59, 32, 0.82), rgba(20, 83, 45, 0.68));
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---------- Header ---------- */

.fm-header {
    background: var(--fm-glass-strong);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid var(--fm-line);
}

.fm-topbar {
    background: var(--fm-milk-deep);
    border-bottom: 1px solid var(--fm-line);
    color: var(--fm-ink-soft);
}

.fm-logo-mark {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--fm-forest), var(--fm-green-bright));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-family: var(--fm-font-display);
    font-size: 1.3rem;
    box-shadow: 0 6px 16px rgba(20, 83, 45, 0.25);
}

.fm-search-bar {
    border: 2px solid var(--fm-forest);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
}

.fm-search-bar select, .fm-search-bar input {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--fm-font-body);
}

.fm-btn-primary {
    background: var(--fm-forest);
    color: #fff;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.15s ease;
}
.fm-btn-primary:hover { background: var(--fm-forest-deep); transform: translateY(-1px); }

.fm-btn-ghost {
    border: 1.5px solid var(--fm-forest);
    color: var(--fm-forest);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}
.fm-btn-ghost:hover { background: var(--fm-forest); color: #fff; }

.fm-btn-wa {
    background: var(--fm-wa);
    color: #fff;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.15s ease;
}
.fm-btn-wa:hover { background: #1DA851; transform: translateY(-1px); }

/* ---------- Nav ---------- */

.fm-nav a { color: var(--fm-ink-soft); font-weight: 500; }
.fm-nav a:hover { color: var(--fm-green); }
.fm-nav .fm-nav-hot {
    background: rgba(200, 60, 40, 0.1);
    color: #B23A24;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
}

/* ---------- Sidebar rail ---------- */

.fm-rail {
    border-radius: var(--fm-radius);
    overflow: hidden;
}
.fm-rail-title {
    background: var(--fm-forest);
    color: #fff;
    font-weight: 700;
    font-family: var(--fm-font-display);
}
.fm-rail li {
    border-bottom: 1px solid var(--fm-line);
    transition: background 0.15s ease;
}
.fm-rail li:hover { background: rgba(30, 124, 63, 0.08); }
.fm-rail li:last-child { border-bottom: none; }

/* ---------- Hero slider ---------- */

.fm-hero {
    border-radius: var(--fm-radius);
    overflow: hidden;
    position: relative;
}
.fm-hero-slide {
    transition: opacity 0.8s ease;
}
.fm-hero-tag {
    background: rgba(139, 195, 74, 0.9);
    color: #0D3B20;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ---------- Trust strip ---------- */

.fm-trust-item .fm-trust-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(30, 124, 63, 0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--fm-forest);
}

/* ---------- Category cards ---------- */

.fm-cat-card {
    border-radius: var(--fm-radius-sm);
    overflow: hidden;
    position: relative;
    height: 11rem;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.fm-cat-card:hover { transform: translateY(-3px); box-shadow: var(--fm-shadow-lift); }
.fm-cat-card img { transition: transform 0.5s ease; }
.fm-cat-card:hover img { transform: scale(1.08); }

/* ---------- Product cards ---------- */

.fm-product-card {
    border-radius: var(--fm-radius-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex; flex-direction: column; height: 100%;
}
.fm-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--fm-shadow-lift);
}
.fm-product-badge {
    background: rgba(200, 60, 40, 0.12);
    color: #B23A24;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.fm-product-cat {
    color: var(--fm-green);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.fm-product-price { color: var(--fm-forest); font-family: var(--fm-font-display); }

/* ---------- Stats / dark section ---------- */

.fm-stats-section {
    background: linear-gradient(135deg, var(--fm-forest), var(--fm-forest-deep));
    color: #fff;
    position: relative;
    overflow: hidden;
}
.fm-stats-number { font-family: var(--fm-font-display); color: var(--fm-lime); }

/* ---------- How it works ---------- */

.fm-step-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--fm-glass-strong);
    border: 2px solid var(--fm-lime);
    display: flex; align-items: center; justify-content: center;
    color: var(--fm-forest);
    box-shadow: var(--fm-shadow-soft);
}

/* ---------- Testimonials ---------- */

.fm-testimonial-card {
    border-radius: var(--fm-radius);
}

/* ---------- Footer ---------- */

.fm-footer {
    background: #0F1410;
    color: #B7BFB2;
}
.fm-footer h4 { color: #fff; }
.fm-footer a:hover { color: var(--fm-lime); }
.fm-footer-line {
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---------- Modal (Request Quote) ---------- */

.fm-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(13, 59, 32, 0.35);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center; justify-content: center;
    padding: 1rem;
}
.fm-modal-backdrop.active { display: flex; }
.fm-modal {
    background: var(--fm-glass-strong);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: var(--fm-radius);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(13, 59, 32, 0.3);
}
.fm-input {
    border: 1.5px solid var(--fm-line);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    background: rgba(255,255,255,0.7);
    width: 100%;
    font-family: var(--fm-font-body);
    transition: border-color 0.15s ease;
}
.fm-input:focus { outline: none; border-color: var(--fm-green); }

/* ---------- Utility: leaf vector decorations ---------- */
.fm-vector-leaf {
    position: absolute;
    opacity: 0.08;
    pointer-events: none;
    color: #fff;
}

/* ---------- Random Nigerian line strip ---------- */
.fm-proverb-strip {
    border-top: 1px solid var(--fm-line);
    border-bottom: 1px solid var(--fm-line);
    background: rgba(139, 195, 74, 0.08);
    color: var(--fm-forest);
    font-style: italic;
}

/* ==========================================================
   SHOP PAGE — filter sidebar, price slider, chips
   ========================================================== */

.fm-rail-title-plain {
    font-family: var(--fm-font-display);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--fm-ink);
}

/* ---------- Checklist rows (categories / stock) ---------- */

.fm-filter-checklist li {
    border-bottom: 1px solid var(--fm-line);
}
.fm-filter-checklist li:last-child { border-bottom: none; }

.fm-filter-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--fm-green);
    background: rgba(30, 124, 63, 0.1);
    border-radius: 999px;
    padding: 2px 8px;
    flex-shrink: 0;
}

/* Custom checkbox, styled consistently across browsers */
input.fm-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    border: 1.5px solid var(--fm-line);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
input.fm-checkbox:checked {
    background: var(--fm-forest);
    border-color: var(--fm-forest);
}
input.fm-checkbox:checked::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

/* ---------- Dual-handle price range slider ---------- */

.fm-price-slider {
    height: 4px;
    padding: 0 2px;
}
.fm-price-track {
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 4px;
    border-radius: 999px;
    background: var(--fm-line);
}
.fm-price-fill {
    position: absolute;
    top: 0;
    height: 4px;
    border-radius: 999px;
    background: var(--fm-green);
}
.fm-price-range {
    position: absolute;
    left: 0; right: 0; top: -8px;
    width: 100%;
    height: 20px;
    margin: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: none;
}
.fm-price-range::-webkit-slider-runnable-track { background: transparent; height: 20px; }
.fm-price-range::-moz-range-track { background: transparent; height: 20px; }
.fm-price-range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    pointer-events: auto;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--fm-forest);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(20, 83, 45, 0.4);
    cursor: pointer;
    margin-top: 0;
}
.fm-price-range::-moz-range-thumb {
    pointer-events: auto;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--fm-forest);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(20, 83, 45, 0.4);
    cursor: pointer;
}

.fm-price-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1.5px solid var(--fm-line);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.7);
    flex: 1;
    min-width: 0;
}
.fm-price-input-wrap span { color: var(--fm-ink-soft); font-size: 0.8rem; }
.fm-input-sm {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    min-width: 0;
    font-family: var(--fm-font-body);
    font-size: 0.85rem;
}

/* ---------- Active filter chips ---------- */

.fm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fm-forest);
    background: rgba(30, 124, 63, 0.1);
    border: 1px solid rgba(30, 124, 63, 0.2);
    border-radius: 999px;
    padding: 6px 12px;
    transition: background 0.15s ease;
}
.fm-chip:hover { background: rgba(30, 124, 63, 0.18); }
.fm-chip i { font-size: 10px; }
.fm-chip-clear {
    color: #B23A24;
    background: rgba(200, 60, 40, 0.08);
    border-color: rgba(200, 60, 40, 0.2);
}
.fm-chip-clear:hover { background: rgba(200, 60, 40, 0.15); }

/* ---------- Mobile filter drawer ---------- */

@media (max-width: 1023px) {
    .fm-filter-sidebar-collapsed { display: none; }
}

/* ==========================================================
   WATI WHATSAPP WIDGET — floating chat launcher, bottom-right
   ========================================================== */

.fm-wati-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 200;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--fm-wa);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.45);
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fm-wati-launcher:hover { transform: scale(1.06); box-shadow: 0 14px 36px rgba(37, 211, 102, 0.55); }

.fm-wati-launcher::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
    animation: fm-wati-pulse 2.4s infinite;
}
@keyframes fm-wati-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45); }
    70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.fm-wati-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #B23A24;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.fm-wati-panel {
    position: fixed;
    right: 22px;
    bottom: 94px;
    z-index: 200;
    width: 320px;
    max-width: calc(100vw - 44px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(13, 59, 32, 0.28);
    background: #fff;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.6);
}
.fm-wati-panel.active { display: flex; }

.fm-wati-panel-header {
    background: var(--fm-forest);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.fm-wati-panel-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}
.fm-wati-panel-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fm-wati-panel-close {
    margin-left: auto;
    background: none; border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 16px;
}
.fm-wati-panel-close:hover { color: #fff; }

.fm-wati-panel-body {
    padding: 16px 18px;
    background: #F0F4EF;
}
.fm-wati-bubble {
    background: #fff;
    border-radius: 12px;
    border-top-left-radius: 2px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--fm-ink);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.fm-wati-panel-footer {
    padding: 14px 18px 18px;
    background: #fff;
}
.fm-wati-start-btn {
    background: var(--fm-wa);
    color: #fff;
    font-weight: 600;
    font-size: 13.5px;
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
}
.fm-wati-start-btn:hover { background: #1DA851; }

@media (max-width: 480px) {
    .fm-wati-launcher { right: 16px; bottom: 16px; width: 54px; height: 54px; font-size: 25px; }
    .fm-wati-panel { right: 12px; bottom: 84px; width: calc(100vw - 24px); }
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 767px) {
    .fm-hero { height: 300px; }
    h2.fm-section-heading { font-size: 1.4rem; }
}

/* Accessible focus ring, always visible */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--fm-green);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ==========================================================
   UTILITY SAFETY NET
   tailwind.build.css is a static file generated by scanning
   existing markup (see tailwind.config.js + package.json's
   "build:css" script). It is NOT rebuilt automatically when new
   PHP/JS is added, so any brand-new utility combinations used on
   the /shop page are defined by hand here to guarantee they work
   even before the next `npm run build:css`. Safe to keep even
   after a rebuild — identical rules just get defined twice.
   ========================================================== */

.min-w-0 { min-width: 0px; }
.w-72 { width: 18rem; }
.p-3 { padding: 0.75rem; }
.p-6 { padding: 1.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disabled\:opacity-40:disabled { opacity: 0.4; }

@media (min-width: 768px) {
    .md\:p-4 { padding: 1rem; }
    .md\:p-8 { padding: 2rem; }
}

@media (min-width: 1024px) {
    .lg\:w-72 { width: 18rem; }
    .lg\:flex-row { flex-direction: row; }
    .lg\:hidden { display: none; }
    .lg\:block { display: block; }
    .lg\:gap-5 { gap: 1.25rem; }
}

/* ---------- Shop page: filters left (20%), products right (80%) ---------- */
.fm-shop-layout {
    display: flex;
    flex-direction: column;
}
@media (min-width: 1024px) {
    .fm-shop-layout { flex-direction: row; align-items: flex-start; }
    .fm-shop-sidebar { width: 20%; max-width: 20%; flex: 0 0 20%; }
    .fm-shop-main { width: 80%; flex: 1 1 80%; }
}

/* Single, consistent, fully-covering sidebar background (one card, no
   gaps between sections) rather than several separately-blurred panels. */
.fm-sidebar-card {
    background: var(--fm-glass-strong);
}
.fm-shop-sidebar { display: flex; flex-direction: column; }

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
