/* ========================================
   MARKETPLACE CATEGORY & OFFERING PAGES
   Styling for category detail and offering list pages
   ======================================== */

/* Category Header Section */
.category-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.category-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.category-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-banner:hover {
    transform: scale(1.05);
}

.category-info {
    padding: 1.5rem;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.category-description {
    color: #666;
    line-height: 1.6;
}

/* Offerings Header Section */
.offerings-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1.5rem;
}

.offerings-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: #333;
}

.offerings-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 0.8rem;
    border-top: 1px solid #eee;
}

.results-count {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
}

.count-info {
    font-size: 1rem;
    color: #333;
}

.count-detail {
    font-size: 0.9rem;
    color: #666;
}

.sort-controls {
    display: flex;
    align-items: center;
}

.sort-form {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background-color: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.sort-form label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
}

.sort-form select {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.sort-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.sort-button:hover {
    background-color: #0069d9;
}

/* Products/Offerings Section */
.products-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.product-count {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.8rem;
    margin-bottom: 2rem;
}

.product-card {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 2rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #adb5bd;
}

.empty-message {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.no-results {
    color: #6c757d;
    font-style: italic;
}

/* Category-specific price display overrides - smaller and cleaner for grid view */
.product-card .product-price {
    padding: 0 !important;
    margin-bottom: 10px !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.product-card .price-display {
    margin-bottom: 8px !important;
    background: none !important;
    padding: 0 !important;
    border-left: none !important;
}

.product-card .price-label {
    display: none; /* Hide "Prix:" label in category view */
}

.product-card .price {
    font-size: 1.1em !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 3px !important;
    color: #d4af37 !important; /* Gold color for price */
}

.product-card .price small {
    font-size: 0.8em !important;
    color: #666 !important;
    font-weight: normal !important;
}

.product-card .availability {
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
    margin-top: 5px !important;
    display: inline-flex !important;
    border-radius: 4px !important;
}

.product-card .price-per-kg {
    display: none; /* Hide price per kg in category view to save space */
}

/* Product card inner structure */
.product-card .product-content {
    padding: 1rem !important;
}

.product-card .product-title {
    font-weight: 500 !important;
    margin-bottom: 10px !important;
    line-height: 1.3 !important;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card .product-price {
    display: flex !important;
    flex-direction: column !important;
}

.product-card .product-image {
    height: 180px !important;
}

/* Add to cart button styling */
.product-card .add-to-cart-btn {
    font-size: 0.85rem !important;
    padding: 0.5rem !important;
    background-color: #007bff !important;
    transition: background-color 0.3s ease, transform 0.2s ease !important;
}

.product-card .add-to-cart-btn:hover {
    background-color: #0069d9 !important;
    transform: translateY(-2px) !important;
}

/* Enhance product card structure */
.product-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .offerings-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .sort-controls {
        width: 100%;
    }

    .sort-form {
        width: 100%;
        justify-content: space-between;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.2rem;
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (min-width: 1600px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}
