/* ── RESET & BASE ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --green:       #2D7A3A;
    --green-light: #E8F5EB;
    --red:         #E53935;
    --text:        #1A1A1A;
    --text-2:      #666;
    --text-3:      #999;
    --border:      #EBEBEB;
    --bg:          #F7F7F7;
    --white:       #FFFFFF;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

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

/* ── NAVBAR ── */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
    flex-shrink: 0;
}
.search-wrap {
    flex: 1;
    display: flex;
    position: relative;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: visible;
    transition: border-color .2s;
    background: var(--white);
}
.search-wrap:focus-within { border-color: var(--green); }
.search-wrap input {
    flex: 1;
    padding: 0 14px;
    height: 36px;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: transparent;
}
.search-wrap input::placeholder { color: var(--text-3); }
.search-wrap button {
    padding: 0 18px;
    background: var(--green);
    color: white;
    border: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.search-wrap button:hover { background: #235f2d; }
.search-wrap .search-clear {
    width: 32px;
    padding: 0;
    background: transparent;
    color: var(--text-3);
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
}
.search-wrap .search-clear:hover {
    background: transparent;
    color: var(--text);
}
.search-suggestions {
    position: absolute;
    left: -1.5px;
    right: -1.5px;
    top: calc(100% + 6px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,.12);
    overflow: hidden;
    z-index: 250;
}
.search-suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}
.search-suggestion-item:last-child { border-bottom: none; }
.search-suggestion-item:hover,
.search-suggestion-item.active { background: var(--green-light); }
.search-suggestion-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.search-suggestion-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: var(--text);
}
.search-suggestion-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    color: var(--text-2);
}
.search-suggestion-price {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
}
.search-suggestion-empty {
    padding: 12px;
    color: var(--text-2);
    font-size: 13px;
}
.search-suggestion-all {
    display: block;
    padding: 11px 12px;
    background: #f8faf8;
    border-top: 1px solid var(--border);
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}
.search-suggestion-all:hover { background: var(--green-light); }
.nav-login {
    padding: 8px 18px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .2s;
    display: inline-block;
}
.nav-login:hover { border-color: var(--green); color: var(--green); }

/* ── NAVBAR AUTH ── */
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.nav-desktop-only {
    display: flex;
    align-items: center;
}
.nav-post-btn {
    padding: 7px 14px;
    background: var(--green);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .2s;
}
.nav-post-btn:hover { background: #235f2d; }
.nav-user {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.nav-user-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.nav-avatar-initial {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.nav-blog-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
}
.nav-blog-link:hover { color: var(--green); }
.nav-admin-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
}
.nav-admin-link:hover { color: var(--green); }
.nav-logout {
    padding: 7px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.nav-logout:hover { border-color: var(--red); color: var(--red); }

/* Mobile dropdown */
.nav-mobile-menu {
    display: none;
    position: relative;
}
.nav-avatar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}
.nav-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 210px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    z-index: 200;
}
.nav-dropdown.open { display: block; }
.nav-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.nav-dropdown-header strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}
.nav-dropdown-header span {
    font-size: 12px;
    color: var(--text-2);
}
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text);
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.nav-dropdown-item:hover { background: var(--bg); }
.nav-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.nav-dropdown-logout { color: var(--red); }

/* ── CATEGORY BAR ── */
.cat-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
}
.cat-bar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.cat-bar-inner::-webkit-scrollbar { display: none; }
.cat-btn {
    padding: 10px 16px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all .15s;
    display: inline-block;
}
.cat-btn:hover { color: var(--green); }
.cat-btn.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

/* ── MAIN WRAPPER ── */
.main {
    max-width: 960px;
    margin: 24px auto;
    padding: 0 20px;
}

/* ── TOOLBAR ── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.toolbar-left { font-size: 13px; color: var(--text-2); }
.toolbar-left strong { color: var(--text); }
.sort-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    background: white;
    color: var(--text);
}

/* ── PRODUCT GRID ── */
.prod-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

/* ── PRODUCT CARD ── */
.prod-card {
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .2s, transform .2s;
}
.prod-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.09);
    transform: translateY(-3px);
}
.prod-img-link { display: block; }
.prod-img {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    overflow: hidden;
}
.prod-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.prod-card:hover .prod-img img,
.prod-card:hover .prod-img-emoji { transform: scale(1.08); }
.prod-img-emoji { display: inline-block; transition: transform .3s; }

.prod-info { padding: 10px 12px 12px; }

/* ── BLOG CARDS ── */
.blog-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f0f4ed;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border-radius: 10px 10px 0 0;
}
.blog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.blog-card:hover .blog-thumb img { transform: scale(1.05); }

.disc-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: var(--red);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}
.cert-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: var(--green);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}
.prod-body { padding: 12px; }
.prod-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}
.prod-name:hover { color: var(--green); }
.prod-price-row {
    margin-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.prod-price { font-size: 15px; font-weight: 700; color: var(--green); }
.prod-price-ori { font-size: 11px; color: var(--text-3); text-decoration: line-through; }
.prod-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
.prod-rating { font-size: 11px; color: var(--text-3); }
.star { color: #FFB300; }
.prod-location { font-size: 11px; color: var(--text-3); }

/* ── PAGINATION ── */
.pagination-wrap { margin-top: 32px; padding-bottom: 40px; }
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
}
.page-btn {
    width: 34px; height: 34px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.page-btn:hover { border-color: var(--green); color: var(--green); }
.page-btn.active { background: var(--green); color: white; border-color: var(--green); cursor: default; }
.page-btn.disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.page-btn.dots { cursor: default; border-color: transparent; }

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-2);
}
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ── BUTTONS ── */
.btn-green {
    padding: 10px 22px;
    background: var(--green);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
}
.btn-green:hover { background: #235f2d; color: white; }

/* ── BREADCRUMB ── */
.breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 20px;
}
.breadcrumb a:hover { color: var(--green); }

/* ── PRODUCT DETAIL ── */
.detail-wrap {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 40px;
    align-items: start;
}
.detail-img {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-img-placeholder { font-size: 120px; }
.detail-name { font-size: 22px; font-weight: 700; line-height: 1.3; margin: 10px 0 12px; }
.detail-meta { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); margin-bottom: 16px; }
.text-muted { color: var(--text-3); }
.detail-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-price { font-size: 26px; font-weight: 700; color: var(--green); }
.detail-desc { font-size: 14px; line-height: 1.7; color: var(--text-2); margin-bottom: 16px; }
.detail-farmer { font-size: 13px; color: var(--text-2); }
.section-title { font-size: 18px; font-weight: 700; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .prod-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-wrap { grid-template-columns: 1fr; }
    .detail-img { max-width: 100%; }
    .navbar-inner { gap: 10px; }
    .nav-desktop-only { display: none !important; }
    .nav-mobile-menu { display: block; }
}
@media (max-width: 640px) {
    .navbar-inner {
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        padding: 10px 14px;
    }
    .search-wrap {
        order: 3;
        flex-basis: 100%;
    }
    .search-wrap input { height: 40px; }
    .search-wrap button[type="submit"] { padding: 0 16px; }
    .search-suggestions { top: calc(100% + 8px); }
    .search-suggestion-item {
        align-items: flex-start;
        min-height: 54px;
    }
    .search-suggestion-price { padding-top: 2px; }
}
@media (max-width: 480px) {
    .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* Commodity landing page */
.landing-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}
.landing-eyebrow {
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.landing-hero h1 {
    font-size: 26px;
    line-height: 1.25;
    margin-bottom: 10px;
}
.landing-subtitle {
    color: var(--text-2);
    line-height: 1.6;
    max-width: 680px;
}
.landing-stats {
    min-width: 120px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
}
.landing-stats strong {
    display: block;
    color: var(--green);
    font-size: 24px;
}
.landing-stats span { color: var(--text-2); font-size: 12px; }
.landing-content {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 24px;
    margin-bottom: 18px;
    color: var(--text-2);
    line-height: 1.75;
}
.landing-content h2,
.landing-content h3 {
    color: var(--text);
    margin: 18px 0 8px;
}
.landing-content p { margin-bottom: 12px; }
.landing-content ul,
.landing-content ol { padding-left: 20px; margin-bottom: 12px; }
.landing-type-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.landing-type-links a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 700;
}
.landing-type-links a:hover { border-color: var(--green); color: var(--green); }
.landing-type-links span {
    color: var(--green);
    font-size: 12px;
}
.landing-faq {
    margin-top: 32px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 24px;
}
.landing-faq h2 { font-size: 20px; margin-bottom: 14px; }
.landing-faq details {
    border-top: 1px solid var(--border);
    padding: 12px 0;
}
.landing-faq details:first-of-type { border-top: none; }
.landing-faq summary {
    cursor: pointer;
    font-weight: 700;
}
.landing-faq p {
    color: var(--text-2);
    line-height: 1.65;
    margin-top: 8px;
}

@media (max-width: 640px) {
    .landing-hero {
        flex-direction: column;
        padding: 18px;
    }
    .landing-hero h1 { font-size: 22px; }
    .landing-stats {
        width: 100%;
        text-align: left;
    }
    .landing-type-links { grid-template-columns: 1fr; }
    .landing-content,
    .landing-faq { padding: 18px; }
}
