/* Marketplace Section - Two Column Layout */
.marketplace-section {
    background: linear-gradient(135deg, #fefaf5 0%, #fff6ed 100%);
    position: relative;
    padding: 0;
}

.marketplace-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* LEFT COLUMN - Sticky (stays in place while scrolling) */
.marketplace-left {
    width: 35%;
    position: sticky;
    top: 108px; /* Height of fixed header (top-bar + navbar) */
    height: calc(100vh - 108px);
    display: flex;
    align-items: center;
}

.marketplace-sticky-header {
    background: linear-gradient(135deg, #1e3a2f 0%, #2a4a3c 100%);
    border-radius: 24px;
    padding: 40px 32px;
    width: 100%;
    height: 90vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.marketplace-header-content {
    text-align: left;
}

.marketplace-main-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
}

.marketplace-main-title span {
    color: #f7c35c;
}

.marketplace-tagline {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 32px;
    line-height: 1.5;
}

.marketplace-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-btn {
    padding: 12px 24px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    text-align: left;
    width: 100%;
}

.category-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateX(8px);
}

.category-btn.active {
    background: #c57f1e;
    color: white;
    box-shadow: 0 4px 15px rgba(197, 127, 30, 0.4);
}

/* RIGHT COLUMN - Products (scrolls with main page) */
.marketplace-right {
    width: 65%;
    padding: 40px 30px 60px 40px;
    /* No overflow or max-height - scrolls naturally with page */
}

.marketplace-products-wrapper {
    width: 100%;
}

.marketplace-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0e3d6;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px rgba(0,0,0,0.12);
}

.product-img {
    background: linear-gradient(135deg, #eae1d3 0%, #f5ede3 100%);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #4a6a3b;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1e3a2f;
}

.product-desc {
    font-size: 0.85rem;
    color: #6b6b64;
    margin: 8px 0;
    line-height: 1.4;
}

.price {
    font-size: 1.4rem;
    font-weight: 800;
    color: #c57f1e;
    margin: 12px 0;
}

.add-to-cart {
    width: 100%;
    background: #1e3a2f;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.add-to-cart:hover {
    background: #c57f1e;
    transform: translateY(-2px);
}

/* View Details Button */
.product-actions {
    margin: 8px 0;
}

.view-details-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #c57f1e;
    color: #c57f1e;
    padding: 8px 12px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.view-details-btn:hover {
    background: #c57f1e;
    color: white;
    transform: translateY(-2px);
}

.view-details-btn i {
    font-size: 0.9rem;
}

/* Quantity Selector Styles */
.quantity-selector {
    margin: 12px 0;
    padding: 12px 0;
    border-top: 1px solid #f0e3d6;
    border-bottom: 1px solid #f0e3d6;
}

.quantity-label {
    font-size: 0.8rem;
    color: #6b6b64;
    margin-bottom: 8px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-minus, .qty-plus {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0e3d6;
    border: none;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #1e3a2f;
}

.qty-minus:hover, .qty-plus:hover {
    background: #c57f1e;
    color: white;
}

.qty-input {
    width: 60px;
    text-align: center;
    padding: 6px;
    border: 1px solid #f0e3d6;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.price-breakdown {
    margin: 12px 0;
}

.price-per-unit {
    margin-bottom: 4px;
}

.total-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e3a2f;
}

.discount-info {
    font-size: 0.8rem;
    color: #059669;
    margin-top: 8px;
    padding: 6px;
    border-radius: 8px;
    background: #ecfdf5;
}

/* Product Modal Styles */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.product-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease-out;
}

.product-modal-content {
    background: white;
    border-radius: 28px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.product-modal-header {
    background: linear-gradient(135deg, #1e3a2f 0%, #2a4a3c 100%);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.product-modal-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.product-modal-header h2 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    flex: 1;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.product-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.modal-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.modal-detail-item {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 12px;
}

.modal-detail-item.full-width {
    grid-column: span 2;
}

.modal-detail-item strong {
    display: block;
    color: #1e3a2f;
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-detail-item span,
.modal-detail-item p {
    color: #2d3748;
    font-size: 1rem;
    margin: 0;
}

.modal-description {
    line-height: 1.6;
    color: #4a5568;
}

/* Bulk Tiers Styles */
.bulk-tiers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.bulk-tier-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 8px;
}

.bulk-tier-range {
    font-weight: 600;
    color: #2d3748;
}

.bulk-tier-price {
    color: #1e3a2f;
    font-weight: 600;
}

.bulk-tier-discount {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400e;
}

.product-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
}

.btn-secondary-modal {
    padding: 12px 24px;
    background: #e2e8f0;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #4a5568;
}

.btn-secondary-modal:hover {
    background: #cbd5e0;
}

.btn-primary-modal {
    padding: 12px 28px;
    background: linear-gradient(135deg, #1e3a2f 0%, #2a4a3c 100%);
    color: white;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 47, 0.3);
}

/* Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation */
.product-card {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes discountPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading State */
.loading-spinner {
    text-align: center;
    padding: 60px;
    color: #c57f1e;
    font-size: 1.1rem;
}

.loading-spinner::before {
    content: "🐇";
    display: inline-block;
    animation: bounce 1s infinite;
    margin-right: 8px;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.no-products {
    text-align: center;
    padding: 60px;
    color: #6b6b64;
    font-size: 1.1rem;
}

/* Responsive Modal */
@media (max-width: 640px) {
    .product-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .product-modal-header {
        padding: 20px;
    }
    
    .product-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .product-modal-icon {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
    
    .product-modal-body {
        padding: 20px;
    }
    
    .modal-details-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modal-detail-item.full-width {
        grid-column: span 1;
    }
    
    .product-modal-footer {
        padding: 16px 20px;
        flex-direction: column;
    }
    
    .btn-secondary-modal,
    .btn-primary-modal {
        width: 100%;
        text-align: center;
    }
    
    .bulk-tier-item {
        flex-direction: column;
        text-align: center;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .marketplace-layout {
        flex-direction: column;
    }
    
    .marketplace-left {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        padding: 20px;
    }
    
    .marketplace-sticky-header {
        padding: 32px;
        height: auto;
    }
    
    .marketplace-categories {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .category-btn {
        width: auto;
        text-align: center;
    }
    
    .category-btn:hover {
        transform: translateY(-2px);
        transform: translateX(0);
    }
    
    .marketplace-right {
        width: 100%;
        padding: 30px 24px 60px;
    }
}

@media (max-width: 768px) {
    .marketplace-main-title {
        font-size: 1.8rem;
    }
    
    .marketplace-tagline {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }
    
    .category-btn {
        padding: 8px 18px;
        font-size: 0.85rem;
    }
    
    .marketplace-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-img {
        height: 160px;
        font-size: 3rem;
    }
}