/* Shared grower-facing listing card + age filter — used on the homepage and search results. */

.hp-grid {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

/* ── Age filter ───────────────────────────────────────────────────── */
.age-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.age-filter-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.age-filter-inputs {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: #fff;
    overflow: hidden;
}

.age-filter-input {
    border: none;
    background: transparent;
    padding: 0.3rem 0.5rem;
    font-size: 0.83rem;
    width: 4.5rem;
    color: var(--text-main);
    outline: none;
    -moz-appearance: textfield;
}

.age-filter-input::-webkit-outer-spin-button,
.age-filter-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.age-filter-sep {
    color: var(--text-muted);
    padding: 0.3rem 0.4rem;
    font-size: 0.85rem;
    user-select: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    line-height: 1;
}

.age-filter-unit {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding-right: 0.55rem;
    user-select: none;
    white-space: nowrap;
}

.age-filter-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Listing card ─────────────────────────────────────────────────── */
.hp-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hp-card:hover {
    border-color: #c7d3c3;
    box-shadow: 0 10px 24px rgba(26, 47, 32, 0.08);
    transform: translateY(-2px);
}

.hp-card-img {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #eef1ec;
}

.hp-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hp-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 4px 9px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.hp-badge-stock { background: #fff; color: #2d5c33; }
.hp-badge-trending { background: #c62828; color: #fff; }

.hp-fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
}

.hp-fav-btn.active,
.hp-fav-btn:hover {
    color: #c62828;
}

.hp-card-body {
    padding: 0.95rem 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.hp-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.hp-card-title {
    font-family: var(--serif-font);
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.hp-card-price {
    flex-shrink: 0;
    font-weight: 700;
    color: #2d5c33;
    font-size: 0.98rem;
    white-space: nowrap;
}

.hp-card-crop {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--secondary-green);
    letter-spacing: 0.2px;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-card-meta {
    margin-top: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.hp-card-meta span i { width: 14px; text-align: center; margin-right: 3px; }

.hp-card-meta-primary,
.hp-card-meta-secondary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-card-meta-dot {
    margin: 0 0.3rem;
}

.hp-card-foot {
    margin-top: auto;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.hp-card-qty {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.hp-card-age {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #2d5c33;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 20px;
    padding: 0.1rem 0.45rem;
    white-space: nowrap;
}

.hp-card-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--primary-green);
    text-decoration: none;
}

.hp-card-cta i { font-size: 0.68rem; }

/* ── Dense mobile layout: 2-up grid instead of 1-per-row ─────────── */
@media (max-width: 575.98px) {
    .hp-grid {
        --bs-gutter-x: 0.6rem;
        --bs-gutter-y: 0.6rem;
    }

    .hp-card {
        border-radius: 10px;
    }

    .hp-card-img {
        aspect-ratio: 1 / 1;
    }

    .hp-badge {
        top: 6px;
        left: 6px;
        padding: 3px 7px;
        font-size: 0.6rem;
        gap: 3px;
    }

    .hp-badge-trending .hp-badge-text {
        display: none;
    }

    .hp-fav-btn {
        top: 6px;
        right: 6px;
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .hp-card-body {
        padding: 0.55rem 0.6rem 0.6rem;
    }

    .hp-card-top {
        gap: 0.3rem;
    }

    .hp-card-title {
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .hp-card-price {
        font-size: 0.8rem;
    }

    .hp-card-crop {
        font-size: 0.68rem;
        margin-top: 0.1rem;
    }

    .hp-card-meta {
        margin-top: 0.3rem;
        font-size: 0.66rem;
        gap: 0.05rem;
    }

    .hp-card-meta-secondary {
        display: none;
    }

    .hp-card-meta span i {
        width: 11px;
        margin-right: 2px;
        font-size: 0.62rem;
    }

    .hp-card-foot {
        margin-top: 0.4rem;
        padding-top: 0.4rem;
        flex-wrap: wrap;
    }

    .hp-card-qty {
        font-size: 0.64rem;
        gap: 0.2rem;
    }

    .hp-card-age {
        font-size: 0.58rem;
        padding: 0.05rem 0.35rem;
    }

    .hp-card-cta {
        font-size: 0.62rem;
    }

    .hp-card-cta-text {
        display: none;
    }

    .age-filter-bar {
        width: 100%;
    }

    .age-filter-inputs {
        flex: 1;
    }

    .age-filter-input {
        flex: 1;
        width: auto;
        min-height: 38px;
    }
}
