/* ================================
   Buyer Search Page
================================ */

.buyer-search-page {
    min-height: 100vh;
    padding: 80px 0 100px;
    background: #f5f7fa;
}


/* ================================
   Header
================================ */

.buyer-search-header {
    max-width: 760px;
    margin: 0 auto 40px;
    text-align: center;
}

.search-label,
.results-label {
    display: inline-block;
    margin-bottom: 12px;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.buyer-search-header h1 {
    margin-bottom: 12px;
    color: #111827;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
}

.buyer-search-header p {
    margin: 0;
    color: #6b7280;
    font-size: 1rem;
}


/* ================================
   Filter Bar
================================ */

.buyer-filter-bar {
    max-width: 1100px;
    margin: 0 auto 45px;
    padding: 18px 20px;

    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 15px;

    box-shadow:
        0 8px 25px rgba(15, 23, 42, 0.05);
}

.buyer-filter-row {
    display: grid;

    grid-template-columns:
        minmax(260px, 1.8fr)
        minmax(170px, 1fr)
        minmax(150px, 0.9fr)
        minmax(180px, 1.1fr)
        auto;

    /* align-items: end; */
    gap: 14px;
}


/* ================================
   Filter Items
================================ */

.filter-item {
    min-width: 0;
}

.filter-products {
    min-width: 0;
}

.search-form-label {
    display: block;
    margin-bottom: 7px;

    color: #374151;
    font-size: 0.78rem;
    font-weight: 600;
}

.search-form-label span {
    color: #9ca3af;
    font-size: 0.7rem;
    font-weight: 400;
}


/* ================================
   Inputs
================================ */

.buyer-filter-bar .form-control,
.buyer-filter-bar .form-select {
    min-height: 46px;

    padding: 9px 12px;

    color: #1f2937;
    background: #fff;

    border: 1px solid #dfe3e8;
    border-radius: 9px;

    box-shadow: none;

    font-size: 0.82rem;

    transition: all 0.2s ease;
}

.buyer-filter-bar .form-control:focus,
.buyer-filter-bar .form-select:focus {
    border-color: #60a5fa;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.08);
}


/* ================================
   Products
================================ */

#buyer-product-fields {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.product-input-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.product-input-row .form-control {
    flex: 1;
}

.remove-product {
    width: 36px;
    height: 36px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #e5e7eb;
    border-radius: 8px;

    background: #fff;
    color: #9ca3af;

    cursor: pointer;
}

.remove-product:hover {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}


/* ================================
   Add Product
================================ */

.add-product-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    margin-top: 6px;
    padding: 0;

    border: 0;
    background: transparent;

    color: #2563eb;

    font-size: 0.72rem;
    font-weight: 600;

    cursor: pointer;
}

.add-product-btn:hover {
    color: #1d4ed8;
}


/* ================================
   Shipping
================================ */

.shipping-options {
    display: flex;
    gap: 6px;
}

.shipping-option {
    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 0 12px;

    border: 1px solid #dfe3e8;
    border-radius: 9px;

    background: #fff;
    color: #374151;

    font-size: 0.8rem;

    cursor: pointer;
}

.shipping-option:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.shipping-option input {
    accent-color: #2563eb;
}


/* ================================
   Search Button
================================ */

.buyer-search-btn {
    min-height: 46px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 0 18px;

    border: 0;
    border-radius: 9px;

    background: #2563eb;
    color: #fff;

    font-size: 0.8rem;
    font-weight: 600;

    cursor: pointer;

    white-space: nowrap;

    transition: all 0.2s ease;
}

.buyer-search-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}


/* ================================
   Results
================================ */

.buyer-results-section {
    max-width: 1000px;
    margin: 0 auto;
}

.buyer-results-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 22px;
}

.buyer-results-header h2 {
    margin: 0;

    color: #111827;
    font-size: 1.45rem;
    font-weight: 700;
}

.results-label {
    margin-bottom: 7px;
}

.results-count {
    padding: 7px 12px;

    border-radius: 20px;

    background: #eff6ff;
    color: #2563eb;

    font-size: 0.78rem;
    font-weight: 600;

    white-space: nowrap;
}


/* ================================
   Result Card
================================ */

.buyer-result-card {
    display: flex;
    gap: 18px;

    margin-bottom: 14px;
    padding: 24px;

    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 16px;

    box-shadow:
        0 8px 25px rgba(15, 23, 42, 0.04);

    transition: all 0.25s ease;
}

.buyer-result-card:hover {
    border-color: #bfdbfe;

    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.07);

    transform: translateY(-2px);
}

.buyer-result-select {
    padding-top: 3px;
}

.buyer-checkbox {
    width: 18px;
    height: 18px;

    accent-color: #2563eb;

    cursor: pointer;
}

.buyer-result-content {
    flex: 1;
}


/* ================================
   Result Top
================================ */

.buyer-result-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.buyer-result-top h3 {
    margin: 0 0 5px;

    color: #111827;
    font-size: 1.08rem;
    font-weight: 700;
}

.buyer-location {
    margin: 0;

    color: #6b7280;
    font-size: 0.82rem;
}

.buyer-location i {
    margin-right: 5px;
    color: #2563eb;
}

.buyer-type {
    padding: 6px 10px;

    border-radius: 8px;

    background: #f3f4f6;
    color: #4b5563;

    font-size: 0.72rem;
    font-weight: 600;

    white-space: nowrap;
}


/* ================================
   Interested Products
================================ */

.interested-products {
    margin-top: 18px;
    padding-top: 16px;

    border-top: 1px solid #f0f1f3;
}

.interested-label {
    display: block;
    margin-bottom: 9px;

    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
}

.interested-product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.interested-product {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 6px 9px;

    border-radius: 7px;

    background: #f0fdf4;
    color: #166534;

    font-size: 0.76rem;
    font-weight: 500;
}

.interested-product i {
    font-size: 0.65rem;
}


/* ================================
   Bottom
================================ */

.buyer-result-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 18px;
}

.buyer-match {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: #15803d;
    font-size: 0.78rem;
    font-weight: 600;
}

.buyer-match i {
    font-size: 0.72rem;
}


/* ================================
   Send Inquiry
================================ */

.send-inquiry-wrapper {
    position: sticky;
    bottom: 20px;
    z-index: 9;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 30px;
    padding: 17px 20px;

    background: rgba(17, 24, 39, 0.96);

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;

    box-shadow:
        0 15px 40px rgba(15, 23, 42, 0.18);

    backdrop-filter: blur(12px);
}

.selected-buyer-info {
    display: flex;
    align-items: center;
    gap: 9px;

    color: #d1d5db;
    font-size: 0.78rem;
}

.selected-buyer-info i {
    color: #60a5fa;
}

.send-inquiry-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    padding: 11px 19px;

    border: 0;
    border-radius: 9px;

    background: #2563eb;
    color: #fff;

    font-size: 0.82rem;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.25s ease;
}

.send-inquiry-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}


/* ================================
   Tablet
================================ */

@media (min-width: 768px) and (max-width: 1199px) {

    .buyer-filter-row {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .filter-products {
        grid-column: 1 / -1;
    }

    .filter-search {
        grid-column: 1 / -1;
    }

    .buyer-search-btn {
        width: 100%;
    }

}


/* ================================
   Mobile
================================ */

@media (max-width: 767px) {

    .buyer-search-page {
        padding: 55px 0 70px;
    }

    .buyer-search-header {
        margin-bottom: 30px;
    }

    .buyer-filter-bar {
        margin-bottom: 35px;
        padding: 18px;

        border-radius: 14px;
    }

    .buyer-filter-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .filter-item,
    .filter-products,
    .filter-shipping,
    .filter-search {
        width: 100%;
    }

    .shipping-options {
        width: 100%;
    }

    .shipping-option {
        flex: 1;
    }

    .buyer-search-btn {
        width: 100%;
        min-height: 48px;
    }

    .buyer-results-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .buyer-result-card {
        padding: 18px;
    }

    .buyer-result-top {
        flex-direction: column;
        gap: 10px;
    }

    .buyer-result-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .send-inquiry-wrapper {
        align-items: stretch;
        flex-direction: column;
    }

    .send-inquiry-btn {
        justify-content: center;
    }

}


/* ================================
   Small Mobile
================================ */

@media (max-width: 480px) {

    .buyer-filter-bar {
        padding: 15px;
    }

    .buyer-filter-row {
        gap: 15px;
    }

    .buyer-filter-bar .form-control,
    .buyer-filter-bar .form-select {
        min-height: 48px;
    }

    .shipping-option {
        min-height: 45px;
        padding: 0 10px;
    }

}