/* Market Header */
.market-header {
    padding: 10rem 0 4rem;
    background: linear-gradient(135deg, var(--off-white) 0%, var(--white) 100%);
    text-align: center;
}

.market-header-content {
    max-width: 700px;
    margin: 0 auto;
}

.market-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.market-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Market Filters */
.market-filters {
    padding: 1.5rem 0;
    background: var(--white);
    border-bottom: 1px solid var(--border-gray);
    position: sticky;
    top: 70px;
    z-index: 100;
}

.filter-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-cat-btn {
    background: var(--white);
    border: 1px solid var(--border-gray);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.filter-cat-btn:hover {
    border-color: var(--magenta);
    color: var(--magenta);
}

.filter-cat-btn.active {
    background: var(--magenta);
    border-color: var(--magenta);
    color: var(--white);
}

.filter-sort select {
    background: var(--white);
    border: 1px solid var(--border-gray);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

.filter-sort select:focus {
    border-color: var(--magenta);
}

/* Products Section */
.products-section {
    padding: 4rem 0;
    background: var(--off-white);
    min-height: 60vh;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Product Card - Sharp Box Design */
.product-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-gray);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(233, 30, 140, 0.2);
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--magenta);
    color: var(--white);
    padding: 0.35rem 0.875rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Product Image */
.product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--light-gray);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Product Actions Overlay */
.product-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    color: var(--text-primary);
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.action-btn:hover {
    background: var(--magenta);
    color: var(--white);
    transform: scale(1.1);
}

.action-btn.wishlist-btn:hover {
    background: #ef4444;
}

/* Product Info */
.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.75rem;
    color: var(--magenta);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-name {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

/* Product Footer */
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-gray);
    gap: 1rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.product-price .unit {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Add to Cart Button */
.add-to-cart-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--magenta);
    color: var(--white);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.add-to-cart-btn svg {
    width: 16px;
    height: 16px;
}

.add-to-cart-btn:hover {
    background: var(--magenta-dark);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(233, 30, 140, 0.3);
}

.add-to-cart-btn.added {
    background: #10b981;
}

.add-to-cart-btn.added::after {
    content: '✓';
    margin-left: 0.25rem;
}

/* Load More Button */
.load-more-wrapper {
    text-align: center;
    margin-top: 4rem;
}

.load-more-wrapper .btn-secondary {
    padding: 1rem 2.5rem;
    border: 2px solid var(--magenta);
    color: var(--magenta);
    background: transparent;
}

.load-more-wrapper .btn-secondary:hover {
    background: var(--magenta);
    color: var(--white);
}

/* Quick View Modal */
.quick-view-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(5px);
}

.quick-view-modal.active {
    display: flex;
}

.quick-view-content {
    background: var(--white);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.quick-view-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-gray);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.quick-view-close svg {
    width: 20px;
    height: 20px;
}

.quick-view-close:hover {
    background: var(--magenta);
    color: var(--white);
}

.quick-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.quick-view-image {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 24px 0 0 24px;
}

.quick-view-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-view-details {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.quick-view-category {
    font-size: 0.8rem;
    color: var(--magenta);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quick-view-name {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.quick-view-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--magenta);
    margin-bottom: 1rem;
}

.quick-view-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.quick-view-options {
    margin-bottom: 1.5rem;
}

.size-selector,
.quantity-selector {
    margin-bottom: 1rem;
}

.size-selector label,
.quantity-selector label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.size-options {
    display: flex;
    gap: 0.5rem;
}

.size-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-gray);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: var(--text-secondary);
}

.size-btn:hover {
    border-color: var(--magenta);
    color: var(--magenta);
}

.size-btn.active {
    background: var(--magenta);
    border-color: var(--magenta);
    color: var(--white);
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn-modal {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-gray);
    background: var(--white);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-btn-modal:hover {
    background: var(--magenta);
    color: var(--white);
    border-color: var(--magenta);
}

.qty-control input {
    width: 50px;
    height: 36px;
    text-align: center;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.quick-view-add-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--magenta);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
}

.quick-view-add-cart svg {
    width: 20px;
    height: 20px;
}

.quick-view-add-cart:hover {
    background: var(--magenta-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(233, 30, 140, 0.4);
}

/* Empty State */
.products-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.products-empty svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    stroke: var(--magenta);
    opacity: 0.5;
}

.products-empty h3 {
    font-family: var(--font-serif);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .market-header {
        padding: 8rem 0 3rem;
    }
    
    .market-filters {
        position: static;
        padding: 1rem 0;
    }
    
    .filter-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-categories {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-cat-btn {
        white-space: nowrap;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .quick-view-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-view-image {
        border-radius: 24px 24px 0 0;
        aspect-ratio: 4/3;
    }
    
    .quick-view-details {
        padding: 1.5rem;
    }
    
    .quick-view-name {
        font-size: 1.5rem;
    }
    
    .product-actions {
        opacity: 1;
        transform: none;
    }
}

@media screen and (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .add-to-cart-btn {
        justify-content: center;
    }
    
    .quick-view-modal {
        padding: 1rem;
    }
    
    .quick-view-content {
        max-height: 95vh;
    }
}