/* ===== assets/css/shop.css ===== */
/* Complete Fixed Version with Delivery Styles */

/* Shop Layout - No header, so top margin removed */
.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin: 30px 0 50px 0;
}

/* Filters Sidebar */
.filters-sidebar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filters-sidebar h3 {
    margin-bottom: 18px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.filter-btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.reset-btn {
    display: block;
    text-align: center;
    margin-top: 12px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    padding: 8px;
}

.reset-btn:hover {
    color: #667eea;
}

/* Delivery Checker */
.delivery-checker {
    margin-top: 25px;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.delivery-checker h4 {
    margin-bottom: 12px;
    font-size: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delivery-checker h4 i {
    color: #667eea;
}

.delivery-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.delivery-input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    min-width: 0;
}

.delivery-input-group button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.delivery-input-group button:hover {
    background: #5a67d8;
}

/* ===== ENHANCED DELIVERY RESULT STYLES ===== */

/* Delivery Success Container */
.delivery-success {
    background: #f0f9f0;
    border-left: 4px solid #28a745;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
}

.delivery-success i {
    font-size: 20px;
    color: #28a745;
    margin-top: 2px;
    flex-shrink: 0;
}

.delivery-success > div {
    flex: 1;
}

.delivery-success strong {
    color: #155724;
    font-size: 14px;
}

/* Delivery Error */
.delivery-error {
    background: #fef5f5;
    border-left: 4px solid #dc3545;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
}

.delivery-error i {
    font-size: 20px;
    color: #dc3545;
    margin-top: 2px;
    flex-shrink: 0;
}

.delivery-error strong {
    color: #721c24;
}

/* Loading State */
.loading {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading i {
    font-size: 16px;
    color: #667eea;
}

/* Free Delivery Badge */
.free-delivery-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin: 5px 0;
    box-shadow: 0 2px 4px rgba(40,167,69,0.2);
}

.free-delivery-badge i {
    color: white;
    font-size: 12px;
}

/* Delivery Charge */
.delivery-charge {
    font-size: 13px;
    color: #555;
    display: inline-block;
    margin: 5px 0;
}

.delivery-charge strong {
    color: #dc3545;
    font-size: 16px;
    font-weight: 700;
}

/* Remaining Amount for Free Delivery */
.remaining-amount {
    color: #f57c00;
    font-weight: 600;
    font-size: 12px;
    margin-top: 4px;
}

.remaining-amount i {
    font-size: 10px;
    margin-right: 4px;
}

/* Delivery Details */
.delivery-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.delivery-details small {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #666;
}

.delivery-details small i {
    font-size: 10px;
    width: 14px;
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Products Section */
.products-section {
    width: 100%;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.products-count {
    color: #666;
    font-size: 14px;
}

.products-count span {
    font-weight: 700;
    color: #667eea;
    font-size: 18px;
}

.sort-select {
    padding: 8px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
}

/* Products Grid - 4 columns on desktop */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* Badges Container */
.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.badge {
    padding: 3px 8px;
    border-radius: 16px;
    font-size: 9px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.badge.discount {
    background: #dc3545;
    color: white;
}

.badge.cashback {
    background: #28a745;
    color: white;
}

.badge.cashback i {
    font-size: 8px;
    margin-right: 2px;
}

/* Category Badge */
.product-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 16px;
    font-size: 9px;
    font-weight: 600;
    z-index: 2;
}

.product-badge.food { background: #28a745; }
.product-badge.accessories { background: #17a2b8; }
.product-badge.medicine { background: #dc3545; }

/* Product Image */
.product-image-container {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.product-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

/* Product Info */
.product-info {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1.3;
    height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-category {
    display: inline-block;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 16px;
    font-size: 9px;
    color: #666;
    margin-bottom: 6px;
    width: fit-content;
}

/* Price Wrapper */
.product-price-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

/* Product Price */
.product-price {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 11px;
}

.discounted-price,
.price {
    font-size: 15px;
    font-weight: 700;
    color: #667eea;
}

/* Inline Cashback */
.inline-cashback {
    font-size: 10px;
    color: #28a745;
    background: #e8f5e9;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.inline-cashback i {
    font-size: 9px;
}

/* Stock Status */
.product-stock {
    font-size: 9px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}

.stock-in { color: #28a745; }
.stock-low { color: #f57c00; }
.stock-out { color: #dc3545; }

/* Product Actions */
.product-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 6px;
}

.add-to-cart {
    flex: 2;
    padding: 6px 8px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.add-to-cart:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.add-to-cart.disabled {
    background: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

.wishlist-btn,
.share-btn {
    flex: 1;
    padding: 6px 8px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-btn i {
    color: #dc3545;
    font-size: 10px;
}

.wishlist-btn:hover {
    background: #dc3545;
}

.wishlist-btn:hover i {
    color: white;
}

.share-btn i {
    color: #667eea;
    font-size: 10px;
}

.share-btn:hover {
    background: #667eea;
}

.share-btn:hover i {
    color: white;
}

/* Empty State */
.no-products {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
}

.no-products i {
    font-size: 60px;
    color: #ddd;
    margin-bottom: 15px;
}

.no-products h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #666;
}

/* ===== Responsive Design ===== */

/* Laptop (1024px - 1200px) - 3 columns */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

/* Tablet (768px - 1024px) - 2 columns */
@media (max-width: 1024px) {
    .shop-layout {
        grid-template-columns: 260px 1fr;
        gap: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .shop-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 0 40px 0;
    }
    
    .filters-sidebar {
        position: static;
        padding: 15px;
    }
    
    .products-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 15px;
    }
    
    .sort-select {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .product-card {
        width: 100% !important;
        min-width: 0 !important;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .product-title {
        font-size: 12px;
        height: 30px;
    }
    
    .product-price-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .inline-cashback {
        font-size: 8px;
        padding: 2px 6px;
        white-space: normal;
    }
    
    .discounted-price,
    .price {
        font-size: 13px;
    }
    
    .add-to-cart,
    .wishlist-btn,
    .share-btn {
        padding: 6px 5px;
        font-size: 9px;
    }
    
    .delivery-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .delivery-input-group button {
        width: 100%;
        padding: 8px;
    }
    
    /* Delivery Result Mobile */
    .delivery-success,
    .delivery-error {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .delivery-success i,
    .delivery-error i {
        font-size: 16px;
    }
    
    .delivery-charge strong {
        font-size: 14px;
    }
    
    .free-delivery-badge {
        font-size: 10px;
        padding: 3px 10px;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .products-grid {
        gap: 10px !important;
    }
    
    .product-info {
        padding: 6px;
    }
    
    .product-title {
        font-size: 11px;
        height: 28px;
    }
    
    .discounted-price,
    .price {
        font-size: 12px;
    }
    
    .inline-cashback {
        font-size: 7px;
        padding: 2px 5px;
    }
    
    .add-to-cart,
    .wishlist-btn,
    .share-btn {
        padding: 5px 4px;
        font-size: 8px;
    }
}