/* ==========================================================================
   Marketplace — public front-end (templates/marketplace.php)
   Loaded only on that template — see enqueue.php's conditional load.
   Follows the same .container / .section-heading conventions used by
   template-parts/home/latest-posts.php and diseases.php.
   ========================================================================== */

.marketplace-page {
    padding: 30px 0 60px;
}

/* ---- Filter bar ---- */
.mp-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 20px 0 30px;
    padding: 16px;
    background: #f4f6f9;
    border-radius: 10px;
}
.mp-filter-bar select,
.mp-filter-bar input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #d7dde3;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}
.mp-filter-bar input[type="text"] {
    flex: 1 1 200px;
    min-width: 160px;
}
.mp-filter-bar button {
    background: #2e7d32;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.mp-filter-bar button:hover {
    filter: brightness(0.95);
}
.mp-clear-filters {
    font-size: 13px;
    color: #c62828;
    text-decoration: none;
    white-space: nowrap;
}

/* ---- Grid ---- */
.mp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.mp-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.mp-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #eef1f4;
    overflow: hidden;
}
.mp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mp-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa4ae;
    font-size: 13px;
}
.mp-card-category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(46,125,50,0.92);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
}
.mp-card-content {
    padding: 14px 16px 16px;
}
.mp-card-title {
    margin: 0 0 4px;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.3;
    color: #1c2b1e;
}
.mp-card-subcategory {
    font-size: 12px;
    color: #7a8a80;
    margin-bottom: 8px;
}
.mp-card-price {
    font-size: 17px;
    font-weight: 800;
    color: #2e7d32;
}
.mp-price-unit {
    font-size: 12px;
    font-weight: 500;
    color: #7a8a80;
    margin-left: 4px;
}
.mp-card-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #8a9490;
}

.mp-empty {
    text-align: center;
    color: #7a8a80;
    padding: 40px 0;
    font-size: 15px;
}

/* ---- Pagination ---- */
.mp-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 34px;
    flex-wrap: wrap;
}
.mp-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: #f4f6f9;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.mp-page-link.mp-page-active {
    background: #2e7d32;
    color: #fff;
}

/* ---- Single listing ---- */
.mp-back-link {
    display: inline-block;
    margin: 20px 0 14px;
    font-size: 13.5px;
    color: #2e7d32;
    text-decoration: none;
    font-weight: 600;
}
.mp-single {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 34px;
    align-items: start;
}
@media (max-width: 780px) {
    .mp-single { grid-template-columns: 1fr; }
}

.mp-single-main-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: #eef1f4;
}
.mp-single-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mp-single-main-image.mp-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa4ae;
    font-size: 14px;
}
.mp-thumb-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.mp-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}
.mp-thumb:hover {
    border-color: #2e7d32;
}

.mp-single-category {
    font-size: 12.5px;
    color: #7a8a80;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    margin-bottom: 8px;
}
.mp-single-title {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 800;
    color: #1c2b1e;
    line-height: 1.25;
}
.mp-single-price {
    font-size: 24px;
    font-weight: 800;
    color: #2e7d32;
    margin-bottom: 14px;
}
.mp-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13.5px;
    color: #5a6a60;
    margin-bottom: 18px;
}
.mp-single-description {
    font-size: 14.5px;
    line-height: 1.65;
    color: #3a4640;
    margin-bottom: 22px;
}

.mp-contact-buttons h3 {
    font-size: 15px;
    margin: 0 0 10px;
}
.mp-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    margin: 0 8px 8px 0;
}
.mp-contact-phone    { background: #2e7d32; }
.mp-contact-email    { background: #1565c0; }
.mp-contact-whatsapp { background: #25d366; }
.mp-contact-btn:hover { filter: brightness(0.95); }

.mp-no-contact {
    color: #7a8a80;
    font-size: 13.5px;
    font-style: italic;
}

.mp-not-found {
    text-align: center;
    padding: 60px 0;
}
.mp-not-found h1 {
    color: #c62828;
    font-size: 22px;
}

/* ---- Inquiry status banner ---- */
.mp-inquiry-banner {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0;
}
.mp-inquiry-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}
.mp-inquiry-error {
    background: #fdecea;
    color: #c62828;
    border: 1px solid #f5c6cb;
}

/* ---- Inquiry form ---- */
.mp-inquiry-form-wrap {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #e5e9ec;
}
.mp-inquiry-form-wrap h3 {
    font-size: 16px;
    margin: 0 0 12px;
}
.mp-inquiry-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 10px 0 4px;
    color: #3a4640;
}
.mp-inquiry-form label small {
    font-weight: 400;
    color: #8a9490;
}
.mp-inquiry-form input[type="text"],
.mp-inquiry-form input[type="email"],
.mp-inquiry-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d7dde3;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}
.mp-inquiry-form input[readonly] {
    background: #f4f6f9;
    color: #5a6a60;
}
.mp-inquiry-submit {
    margin-top: 14px;
    background: #2e7d32;
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.mp-inquiry-submit:hover {
    filter: brightness(0.95);
}

/* Honeypot — invisible to real visitors, present for bots that fill every field. */
.mp-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 0;
    width: 0;
    overflow: hidden;
}

.mp-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 26px;
    align-items: start;
    margin-top: 10px;
}
@media (max-width: 780px) {
    .mp-layout {
        grid-template-columns: 1fr;
    }
}

.mp-sidebar {
    background: #f4f6f9;
    border-radius: 10px;
    padding: 18px 16px;
    position: sticky;
    top: 20px;
}
.mp-sidebar-heading {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: #1c2b1e;
}
.mp-sidebar-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mp-sidebar-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #5a6a60;
    margin-top: 10px;
}
.mp-sidebar-form select {
    padding: 8px 10px;
    border: 1px solid #d7dde3;
    border-radius: 6px;
    font-size: 13.5px;
    background: #fff;
    width: 100%;
}
.mp-clear-location {
    display: inline-block;
    margin-top: 14px;
    font-size: 12.5px;
}

.mp-results {
    min-width: 0;
}

.mp-seller-info {
    margin: 18px 0;
    padding: 14px 16px;
    background: #f4f6f9;
    border-radius: 10px;
}
.mp-seller-info h3 {
    font-size: 14px;
    margin: 0 0 6px;
}
.mp-contact-map {
    background: #4285F4;
}