/* marketplace.css - Farmers Marketplace Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: #1e2a2f;
    background: linear-gradient(135deg, #fef9e6 0%, #f5f7f0 100%);
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo-font {
    font-family: 'Playfair Display', serif;
}

/* Navigation */
.navbar {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2b6e3c !important;
    font-family: 'Playfair Display', serif;
}

.nav-link {
    font-weight: 500;
    color: #2c4b35 !important;
    margin: 0 0.5rem;
    transition: 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: #4c9f38 !important;
}

.btn-outline-success-custom {
    border: 2px solid #2b6e3c;
    background: transparent;
    color: #2b6e3c;
    border-radius: 40px;
    padding: 0.4rem 1.4rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-outline-success-custom:hover {
    background: #2b6e3c;
    color: white;
}

.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    margin-left: 0.3rem;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 0 0.3rem;
    font-size: 0.7rem;
    font-weight: bold;
    line-height: 1;
    vertical-align: middle;
}

/* Hero Section */
.marketplace-hero {
    background: linear-gradient(135deg, #2b6e3c 0%, #1f5329 100%);
    padding: 4rem 0;
    color: white;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Filter Section */
.filter-section {
    margin-top: -2rem;
    margin-bottom: 3rem;
}

.filter-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c7a6a;
}

.search-box input {
    padding-left: 40px;
    border-radius: 50px;
    border: 1px solid #e0e6d9;
}

.form-select {
    border-radius: 50px;
    border: 1px solid #e0e6d9;
    background-color: white;
}

/* Products Grid */
.products-section {
    padding-bottom: 4rem;
}

.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    cursor: pointer;
    animation: fadeInUp 0.5s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 1.25rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3a2f;
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.product-description {
    font-size: 0.85rem;
    color: #6c7a6a;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2b6e3c;
    margin-bottom: 0.5rem;
}

.product-farmer {
    font-size: 0.8rem;
    color: #8b9a8a;
    margin-bottom: 1rem;
}

.product-farmer i {
    margin-right: 4px;
}

.product-stock {
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.btn-add-cart {
    background: #2b6e3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
}

.btn-add-cart:hover {
    background: #1f5329;
    transform: translateY(-2px);
}

.btn-view-details {
    background: transparent;
    color: #2b6e3c;
    border: 1px solid #2b6e3c;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-view-details:hover {
    background: #2b6e3c;
    color: white;
}

/* Cart Modal */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e9ebdd;
    animation: slideIn 0.3s ease;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 700;
    color: #1e3a2f;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: #2b6e3c;
    font-weight: 600;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    background: #f0f2e9;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: bold;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #2b6e3c;
    color: white;
}

.btn-remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.cart-summary {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ebdd;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.summary-row.total {
    font-weight: 700;
    font-size: 1.2rem;
    color: #1e3a2f;
    border-top: 1px solid #e9ebdd;
    margin-top: 0.5rem;
    padding-top: 1rem;
}

/* Order History */
.order-card {
    background: #fefef9;
    border: 1px solid #e9ebdd;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.order-card:hover {
    transform: translateX(5px);
    border-color: #c8e6c9;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ebdd;
}

.order-id {
    font-weight: 700;
    color: #2b6e3c;
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #cce5ff;
    color: #004085;
}

.order-items {
    margin: 0.75rem 0;
}

.order-item-small {
    font-size: 0.85rem;
    padding: 0.25rem 0;
}

.order-total {
    font-weight: 700;
    color: #2b6e3c;
    margin-top: 0.5rem;
    text-align: right;
}

/* Product Detail Modal */
.product-detail-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.product-detail-info {
    padding: 1rem;
}

.detail-label {
    font-weight: 600;
    color: #1e3a2f;
    margin-top: 0.5rem;
}

.farmer-card {
    background: #f8f9f2;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

/* Toast */
.toast-farm {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    min-width: 280px;
    background: #1e3a2f;
    color: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c7a6a;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal Styles */
.modal-content-farm {
    border-radius: 28px;
    border: none;
    overflow: hidden;
}

.modal-header-farm {
    background: linear-gradient(135deg, #2b6e3c 0%, #1f5329 100%);
    color: white;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.modal-header-farm .modal-title {
    font-family: 'Playfair Display', serif;
}

.modal-header-farm .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body .form-control {
    border-radius: 12px;
    border: 1px solid #e0e6d9;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .filter-card {
        padding: 1rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-item-image {
        width: 100%;
        height: 150px;
    }
}

/* Loading State */
.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.loading-spinner i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-favorite {
    width: 100%;
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid #2b733d;
    border-radius: 8px;
    background: #fff;
    color: #236534;
    font-weight: 600;
    transition: .2s ease;
}

.btn-favorite:hover,
.btn-favorite.is-favorite {
    background: #e5f2e5;
    color: #17602e;
}
