/* Page-specific styles for category pages */

.page-header {
    padding: 120px 0 60px;
    background: var(--gradient-1);
    color: white;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.page-header i {
    font-size: 2.5rem;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* ==================== Marketplace Section ==================== */
.marketplace-section {
    padding: 60px 0;
    background: var(--light-color);
}

.category-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.tab-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn:hover, .tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.marketplace-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* ==================== Filter Sidebar ==================== */
.filter-sidebar {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-section h3 {
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-section h3 i {
    color: var(--primary-color);
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.price-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.price-range input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-filter {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-filter:hover {
    background: var(--secondary-color);
}

.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    color: var(--text-color);
}

.checkbox-label input, .radio-label input {
    cursor: pointer;
}

.btn-reset {
    width: 100%;
    padding: 10px;
    background: var(--light-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reset:hover {
    background: var(--border-color);
}

/* ==================== Product Listing ==================== */
.product-listing {
    background: white;
    padding: 2rem;
    border-radius: 12px;
}

.listing-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.result-count {
    font-size: 1rem;
    color: var(--text-color);
}

.result-count span {
    font-weight: 700;
    color: var(--primary-color);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-options label {
    font-weight: 600;
    color: var(--text-color);
}

.sort-options select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
}

/* ==================== Products Grid ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-color);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 10;
}

.product-badge.new {
    background: var(--success-color);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.product-info {
    padding: 1.25rem;
}

.product-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    min-height: 3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.location {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.product-rating i {
    color: #fbbf24;
    font-size: 0.875rem;
}

.product-rating span {
    margin-left: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.product-price .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-price .unit {
    font-size: 0.875rem;
    color: #6b7280;
}

.product-stock {
    font-size: 0.875rem;
    color: #10b981;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.product-stock i {
    margin-right: 0.375rem;
}

.product-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    min-height: 2.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-detail {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--gradient-1);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
}

.btn-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 10px 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== CTA Section ==================== */
.cta-section {
    padding: 80px 0;
    background: var(--gradient-1);
    color: white;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
    .marketplace-content {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: static;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
        flex-direction: column;
    }

    .page-header i {
        font-size: 2rem;
    }

    .category-tabs {
        flex-wrap: nowrap;
    }

    .listing-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-card img {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .filter-sidebar {
        padding: 1.5rem;
    }

    .product-listing {
        padding: 1.5rem;
    }
}
