/* ========== MARKETPLACE STYLES (Amazon-like mobile grid) ========== */
.marketplace-featured-section {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border-radius: 24px;
    padding: 20px 15px;
    margin: 25px 0;
    box-shadow: 0 4px 15px rgba(251, 146, 60, 0.15);
}
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: #c2410c;
    border-bottom: 3px solid #f97316;
    display: inline-block;
    padding-bottom: 5px;
}

/* ========== PRODUCT GRID – Amazon style ========== */
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 20px 0;
}
.product-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
    border-color: #f97316;
}
.product-thumb-link {
    display: block;
    overflow: hidden;
    background: #fef3c7;
}
.product-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s;
}
.product-card:hover .product-thumb {
    transform: scale(1.05);
}
.product-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 12px 12px 5px;
    color: #1e293b;
    line-height: 1.3;
}
.product-title a {
    color: #1e293b;
    text-decoration: none;
}
.product-title a:hover {
    color: #d35400;
}
.product-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: #d35400;
    margin: 0 12px 8px;
}
.product-excerpt {
    font-size: 0.75rem;
    color: #475569;
    margin: 0 12px 12px;
    line-height: 1.4;
    flex-grow: 1;
}
.product-details-btn, .view-all-btn {
    display: inline-block;
    background: #ffedd5;
    color: #c2410c;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 40px;
    text-align: center;
    margin: 0 12px 18px;
    transition: 0.2s;
    border: 1px solid #fdba74;
    text-decoration: none;
}
.product-details-btn:hover, .view-all-btn:hover {
    background: #f97316;
    color: #fff;
    border-color: #f97316;
}
.marketplace-view-all {
    text-align: center;
    margin-top: 15px;
}
.view-all-btn {
    background: #f97316;
    color: white;
    border: none;
    padding: 10px 28px;
    font-size: 1rem;
}
.view-all-btn:hover {
    background: #c2410c;
}

/* ========== TOP BAR & FILTER ========== */
.marketplace-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0 25px;
    flex-wrap: wrap;
}
.top-bar-left, .top-bar-center, .top-bar-right {
    flex: 1;
    min-width: 0;
}
.top-bar-left { text-align: left; }
.top-bar-center { text-align: center; }
.top-bar-right { text-align: right; }
.category-select, .sort-select {
    width: 100%;
    max-width: 200px;
    padding: 10px 14px;
    border-radius: 40px;
    border: 1px solid #fed7aa;
    background: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
}
.filter-popup-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filter-popup-btn svg { width: 16px; height: 16px; }
.filter-popup-btn:hover {
    background: #f97316;
    border-color: #f97316;
    color: white;
}

/* ========== FILTER POPUP ========== */
.marketplace-filter-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.filter-popup-content {
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: 24px;
    padding: 24px 20px;
    position: relative;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.filter-close-btn {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}
.filter-close-btn:hover { color: #000; }
.filter-popup-title {
    font-size: 1.2rem;
    margin-bottom: 18px;
    color: #c2410c;
    text-align: center;
}
.filter-form { display: flex; flex-direction: column; gap: 16px; }
.filter-group { display: flex; flex-direction: column; }
.filter-group label {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: #7c2d12;
}
.filter-group input {
    padding: 10px 14px;
    border-radius: 30px;
    border: 1px solid #fed7aa;
    background: #fff;
    font-size: 0.9rem;
}
.filter-group.buttons {
    flex-direction: row;
    gap: 12px;
    margin-top: 10px;
}
.apply-filters-btn, .clear-filters {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.apply-filters-btn {
    background: #f97316;
    color: white;
    border: none;
}
.apply-filters-btn:hover { background: #c2410c; }
.clear-filters {
    background: #e2e8f0;
    color: #1e293b;
    border: none;
}
.clear-filters:hover { background: #cbd5e1; }

/* ========== SINGLE PRODUCT PAGE ========== */
.single-product-container {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin: 20px auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.product-detail-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.product-detail-gallery {
    background: #f8fafc;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
}
.main-product-image img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.product-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}
.product-thumb-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: 0.2s;
}
.product-thumb-img:hover {
    border-color: #f97316;
}
.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.product-detail-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.product-detail-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: #d35400;
    background: #ffedd5;
    display: inline-block;
    padding: 6px 18px;
    border-radius: 40px;
    width: fit-content;
}
.vendor-card {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 20px;
    padding: 18px;
    margin: 10px 0;
    border: 1px solid #bae6fd;
}
.vendor-card-title {
    font-weight: 700;
    font-size: 1rem;
    color: #0369a1;
    margin-bottom: 8px;
}
.vendor-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.vendor-contact-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.vendor-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.2s;
}
.call-btn {
    background: #0284c7;
    color: white;
}
.call-btn:hover {
    background: #0369a1;
    transform: scale(1.02);
}
.whatsapp-btn {
    background: #25D366;
    color: white;
}
.whatsapp-btn:hover {
    background: #128C7E;
    transform: scale(1.02);
}
.vendor-note {
    font-size: 0.75rem;
    color: #475569;
    margin-top: 12px;
}
.product-highlights {
    background: #f1f5f9;
    border-radius: 16px;
    padding: 15px;
}
.product-highlights h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #0f172a;
}
.product-highlights ul {
    padding-left: 20px;
    margin: 0;
}
.product-highlights li {
    margin-bottom: 6px;
    font-size: 0.85rem;
}
.product-detail-description {
    grid-column: span 2;
    background: #fefce8;
    border-radius: 20px;
    padding: 20px;
    margin-top: 10px;
}
.product-detail-description h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #854d0e;
}
.back-to-marketplace {
    grid-column: span 2;
    text-align: center;
    margin-top: 20px;
}
.back-btn {
    display: inline-block;
    background: #f1f5f9;
    color: #1e293b;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
}
.back-btn:hover {
    background: #f97316;
    color: white;
}

/* ========== RATING STARS ========== */
.product-rating {
    margin: 10px 0;
}
.star-filled {
    color: #fbbf24;
    font-size: 1.2rem;
}
.star-empty {
    color: #cbd5e1;
    font-size: 1.2rem;
}
.rating-text {
    font-size: 0.8rem;
    color: #475569;
    margin-left: 5px;
}

/* ========== STOCK STATUS ========== */
.stock-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 10px 0;
}
.stock-status.in_stock {
    background: #dcfce7;
    color: #166534;
}
.stock-status.limited {
    background: #fed7aa;
    color: #9a3412;
}
.stock-status.out_of_stock {
    background: #fee2e2;
    color: #991b1b;
}

/* ========== RELATED PRODUCTS ========== */
.related-products {
    grid-column: span 2;
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 24px;
}
.related-products h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #0f172a;
}
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}
.related-product-card {
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
}
.related-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.related-product-img img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
}
.related-product-card h4 {
    font-size: 0.85rem;
    margin: 8px 0 4px;
}
.related-product-card h4 a {
    color: #1e293b;
    text-decoration: none;
}
.related-price {
    font-weight: 700;
    color: #d35400;
    font-size: 0.9rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .marketplace-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .product-thumb {
        height: 140px;
    }
    .product-title {
        font-size: 0.85rem;
        margin: 8px 8px 4px;
    }
    .product-price {
        font-size: 0.9rem;
        margin: 0 8px 6px;
    }
    .product-excerpt {
        font-size: 0.7rem;
        margin: 0 8px 10px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .product-details-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
        margin: 0 8px 12px;
    }
    .marketplace-top-bar {
        gap: 8px;
    }
    .category-select, .sort-select {
        max-width: 100%;
        font-size: 0.7rem;
        padding: 6px 8px;
    }
    .filter-popup-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    .product-detail-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .product-detail-description,
    .back-to-marketplace,
    .related-products {
        grid-column: span 1;
    }
    .product-detail-title {
        font-size: 1.3rem;
    }
    .product-detail-price {
        font-size: 1.4rem;
    }
    .vendor-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .related-product-img img {
        height: 100px;
    }
    .related-product-card h4 {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .marketplace-grid {
        gap: 10px;
    }
    .product-thumb {
        height: 120px;
    }
    .product-title {
        font-size: 0.75rem;
    }
    .product-price {
        font-size: 0.85rem;
    }
    .product-excerpt {
        font-size: 0.65rem;
        -webkit-line-clamp: 1;
    }
}