/* ===================================
   NexMart - Products & Cart CSS
   Products listing, details, cart, checkout
   =================================== */

/* ===================================
   1. PRODUCTS PAGE
   =================================== */
.products-page {
    padding: 40px 0;
    background: #f8f9fa;
}

/* Breadcrumb */
.breadcrumb {
    padding: 20px 0;
    margin-bottom: 30px;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    flex-wrap: wrap;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666;
    font-size: 14px;
}

.breadcrumb-list li a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-list li a:hover {
    color: #5568d3;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '/';
    color: #ccc;
}

/* Products Header */
.products-header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.products-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.products-title {
    font-size: 32px;
    color: #333;
    font-weight: 700;
}

.results-count {
    color: #666;
    font-size: 14px;
}

/* Filters & Sort */
.filters-sort-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #5568d3;
}

.sort-dropdown {
    padding: 10px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

.sort-dropdown:focus {
    outline: none;
    border-color: #667eea;
}

.view-toggle {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* Products Layout */
.products-layout {
    display: flex;
    gap: 30px;
}

/* Sidebar Filters */
.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.filter-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.filter-card h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.filter-option:hover {
    background: #f8f9fa;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.filter-option label {
    cursor: pointer;
    flex: 1;
    font-size: 14px;
    color: #666;
}

.filter-count {
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Price Range */
.price-range {
    margin: 20px 0;
}

.price-inputs {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.price-input {
    flex: 1;
}

.price-input input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.price-slider {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    position: relative;
}

.price-slider-track {
    height: 100%;
    background: #667eea;
    border-radius: 3px;
}

/* Products Grid */
.products-content {
    flex: 1;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

/* List View Product Card */
.product-card.list-view {
    display: flex;
    gap: 25px;
}

.product-card.list-view .product-image {
    width: 250px;
    height: 250px;
    flex-shrink: 0;
}

.product-card.list-view .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card.list-view .product-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card.list-view .add-to-cart-btn {
    width: auto;
    align-self: flex-start;
    margin-top: auto;
}

/* ===================================
   2. PRODUCT DETAIL PAGE
   =================================== */
.product-detail-page {
    padding: 40px 0;
    background: #f8f9fa;
}

.product-detail-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

/* Image Gallery */
.product-gallery {
    position: sticky;
    top: 120px;
}

.main-image {
    width: 100%;
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    background: #f8f9fa;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-zoom {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.image-zoom:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.thumbnail-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.thumbnail {
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #667eea;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info */
.product-detail-info {
    position: relative;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.product-brand {
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-sku {
    font-size: 13px;
    color: #999;
}

.product-detail-title {
    font-size: 36px;
    color: #333;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
}

.product-rating-detail {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 25px;
}

.rating-stars {
    display: flex;
    gap: 5px;
}

.star {
    font-size: 20px;
    color: #ffd43b;
}

.rating-text {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.reviews-count {
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
}

.reviews-count:hover {
    text-decoration: underline;
}

.product-price-detail {
    padding: 25px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 25px;
}

.current-price-detail {
    font-size: 42px;
    color: #667eea;
    font-weight: 700;
    margin-bottom: 10px;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.original-price-detail {
    font-size: 24px;
    color: #999;
    text-decoration: line-through;
}

.discount-detail {
    background: #2ecc71;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.savings {
    color: #2ecc71;
    font-size: 15px;
    font-weight: 600;
    margin-top: 8px;
}

/* Stock Status */
.stock-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    margin-bottom: 25px;
}

.stock-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.stock-indicator.in-stock {
    background: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

.stock-indicator.low-stock {
    background: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
}

.stock-indicator.out-stock {
    background: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.stock-text {
    font-weight: 600;
    font-size: 15px;
}

.stock-text.in-stock { color: #2ecc71; }
.stock-text.low-stock { color: #f39c12; }
.stock-text.out-stock { color: #e74c3c; }

/* Quantity Selector */
.quantity-selector {
    margin-bottom: 25px;
}

.quantity-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: block;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    width: fit-content;
}

.qty-btn {
    width: 45px;
    height: 45px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.qty-input {
    width: 70px;
    height: 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

/* Action Buttons */
.product-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-add-cart {
    flex: 1;
    padding: 18px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-add-cart:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-wishlist {
    width: 60px;
    height: 60px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 24px;
    color: #666;
    transition: all 0.3s ease;
}

.btn-wishlist:hover {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
}

.btn-wishlist.active {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
}

/* Product Features */
.product-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 25px 0;
    border-top: 1px solid #e0e0e0;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-icon {
    width: 45px;
    height: 45px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 20px;
}

.feature-text {
    font-size: 14px;
    color: #666;
}

/* Product Description Tabs */
.product-tabs {
    margin-top: 50px;
}

.tab-headers {
    display: flex;
    gap: 30px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
}

.tab-header {
    padding: 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-header.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.description-content {
    color: #666;
    line-height: 1.8;
    font-size: 15px;
}

.description-content h3 {
    color: #333;
    margin: 25px 0 15px;
}

.description-content ul {
    list-style: none;
    padding: 0;
}

.description-content ul li {
    padding: 8px 0 8px 25px;
    position: relative;
}

.description-content ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2ecc71;
    font-weight: bold;
}

/* ===================================
   3. CART PAGE
   =================================== */
.cart-page {
    padding: 40px 0;
    background: #f8f9fa;
}

.cart-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

/* Cart Items */
.cart-items-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 25px;
}

.cart-title {
    font-size: 28px;
    color: #333;
    font-weight: 700;
}

.cart-count {
    font-size: 16px;
    color: #666;
}

.cart-item {
    display: flex;
    gap: 20px;
    padding: 25px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-image {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-size: 18px;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.cart-item-name:hover {
    color: #667eea;
}

.cart-item-category {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.cart-item-price {
    font-size: 22px;
    color: #667eea;
    font-weight: 700;
    margin-bottom: 15px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-qty-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cart-qty-btn:hover {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.cart-qty-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.cart-remove-btn {
    color: #e74c3c;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.cart-remove-btn:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Cart Summary */
.cart-summary {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: sticky;
    top: 120px;
    height: fit-content;
}

.summary-title {
    font-size: 24px;
    color: #333;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 15px;
}

.summary-label {
    color: #666;
}

.summary-value {
    color: #333;
    font-weight: 600;
}

.summary-total {
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    margin-top: 20px;
}

.summary-total .summary-label {
    font-size: 18px;
    color: #333;
    font-weight: 700;
}

.summary-total .summary-value {
    font-size: 28px;
    color: #667eea;
    font-weight: 700;
}

.checkout-btn {
    width: 100%;
    padding: 18px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.checkout-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.continue-shopping {
    width: 100%;
    padding: 15px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.continue-shopping:hover {
    background: #667eea;
    color: white;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 80px 20px;
}

.empty-cart-icon {
    font-size: 100px;
    color: #ddd;
    margin-bottom: 25px;
}

.empty-cart h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
}

.empty-cart p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* ===================================
   4. RESPONSIVE
   =================================== */
@media (max-width: 1024px) {
    .products-layout {
        flex-direction: column;
    }
    
    .filters-sidebar {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .product-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .product-gallery {
        position: static;
    }
    
    .cart-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .product-detail-title {
        font-size: 28px;
    }
    
    .current-price-detail {
        font-size: 32px;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .btn-wishlist {
        width: 100%;
    }
    
    .cart-item {
        flex-direction: column;
    }
    
    .cart-item-image {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .thumbnail-images {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-features {
        grid-template-columns: 1fr;
    }
}
