.marketplace-section {
    background-color: #f6f9fc;
    padding-top: 100px;
    padding-bottom: 100px;
    text-align: center;
}

.marketplace-section h2 {
    font-size: 28px;
    font-weight: 500;
    color: #2b044d;
    margin-bottom: 0;
    font-family: 'Poppins', sans-serif;
    text-align: left;
}

.marketplace-section .row.mb-4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.category-title {
    font-size: 24px;
    color: #2b044d;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    margin-bottom: 20px;
    text-align: left;
}

.marketplace-section h4 {
    position: relative;
    font-size: 24px;
    color: #2b044d;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 10px;
}

.marketplace-section h4::after {
    content: '';
    display: block;
    width: 80px;
    height: 2px;
    background-color: #8f1bdc;
    margin: 10px auto 20px auto;
}

.search-form .input-group {
    position: relative;
    width: 100%;
}

.search-input {
    border-radius: 0;
    border: 1px solid #8f1bdc;
    padding: 10px 20px;
    background-color: #f6f9fc;
    color: #6a56a6;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
    width: 100%;
    padding-right: 45px;
}

.search-input::placeholder {
    color: #8f1bdc;
    opacity: 0.7;
}

.search-input:focus {
    border-color: #8f1bdc;
    box-shadow: none;
}

.input-group-append .search-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background-color: transparent;
    border: none;
    padding: 0;
    font-size: 20px;
    color: #8f1bdc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.input-group-append .search-btn:hover {
    color: #f9218d;
}

.input-group-append .search-btn i {
    font-size: 20px;
}

.marketplace-section .list-inline {
    padding-left: 0;
    list-style: none;
    margin-bottom: 30px;
    text-align: center;
}

.marketplace-section .list-inline-item {
    margin: 5px 15px;
    display: inline-block;
}

.marketplace-section .btn-category {
    color: #2b044d;
    border-radius: 30px;
    padding: 8px 20px;
    font-size: 16px;
    font-weight: 400;
    text-transform: capitalize;
    transition: all 0.3s ease;
    text-decoration: none;
    background-color: transparent;
}

.marketplace-section .btn-category:hover {
    background-color: #8f1bdc;
    color: white;
    border-color: #8f1bdc;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.marketplace-section .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.marketplace-section .col-md-4 {
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
    display: flex; /* Ensure that col-md-4 is a flex container */
    flex-direction: column; /* Keeps the product card properly aligned */
}

.marketplace-section .card-img-top {
    max-height: 200px;
    width: 100%;
    object-fit: contain;
    padding: 10px;
    background-color: #f6f9fc;
}

.marketplace-section .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.marketplace-section .card-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.marketplace-section .card-text {
    font-size: 16px;
    margin-bottom: 20px;
}

.marketplace-section .card-body .btn-primary,
.marketplace-section .card-body .btn-outline-secondary {
    font-size: 16px;
    padding: 10px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.marketplace-section .card-body .btn-primary:hover {
    background-color: #f9218d;
    transform: scale(1.1);
    border-color: #f9218d;
}

.marketplace-section .card-body .btn-outline-secondary:hover {
    background-color: #f9218d;
    color: white;
    transform: scale(1.1);
    border-color: #f9218d;
}

/* Adjustments for search-active section to maintain grid structure */
.marketplace-section.search-active .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-left: -15px;
    margin-right: -15px;
}

.marketplace-section.search-active .card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 15px 0;
    padding: 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%; /* Preserve full width for the grid container */
    box-sizing: border-box;
}

.marketplace-section.search-active .col-md-4 {
    display: block; /* Ensure grid column container is displayed properly */
}

@media (max-width: 992px) {
    .marketplace-section.search-active .card {
        flex: 1 1 calc(50% - 30px);
        max-width: calc(50% - 30px);
    }
}

@media (max-width: 768px) {
    .marketplace-section.search-active .card {
        flex: 1 1 calc(100% - 30px);
        max-width: calc(100% - 30px);
    }

    .marketplace-section .search-form {
        width: 100%;
        justify-content: center;
        margin-bottom: 20px;
    }

    .marketplace-section .search-form .search-input {
        padding: 10px 15px;
        font-size: 14px;
        max-width: 90%;
        border-radius: 0;
    }

    .marketplace-section .search-form .search-btn {
        right: 40px;
        font-size: 18px;
    }

    .marketplace-section h2 {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .marketplace-section .list-inline-item {
        display: block;
        margin: 5px 0;
    }

    .marketplace-section .btn-category {
        font-size: 12px;
        padding: 6px 15px;
        width: 100%;
    }
}