/* Jumia-Style Product Grid Layout */

/* Products Grid Container */
.products-grid {
    display: grid;
    gap: 15px;
    padding: 20px 0;
}

/* Responsive Grid Layout */
/* Mobile: 2 cards per row */
@media (max-width: 575.98px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px 0;
    }
}

/* Small tablets: 2 cards per row */
@media (min-width: 576px) and (max-width: 767.98px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Medium tablets: 3 cards per row */
@media (min-width: 768px) and (max-width: 991.98px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* Large screens: 4 cards per row */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
}

/* Extra large screens: 5 cards per row */
@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

/* Jumia-Style Product Card */
.jumia-product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 1;
}

.jumia-product-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-3px);
    z-index: 1000;
}

/* Product Image Container */
.jumia-product-image {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio for mobile */
    overflow: hidden;
    background: #f8f9fa;
}

.jumia-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.jumia-product-card:hover .jumia-product-image img {
    transform: scale(1.05);
}

/* Product Badge */
.jumia-product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    backdrop-filter: blur(8px);
}

.jumia-product-badge.featured {
    background: rgba(52, 152, 219, 0.9);
    color: white;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.jumia-product-badge.sale {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.jumia-product-badge.top-rated {
    background: rgba(46, 204, 113, 0.9);
    color: white;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.jumia-product-badge.best-deal {
    background: rgba(230, 126, 34, 0.9);
    color: white;
    border: 1px solid rgba(230, 126, 34, 0.2);
}

/* Product Info */
.jumia-product-info {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.jumia-product-category {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 500;
}

.jumia-product-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 28px;
}

.jumia-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.jumia-product-title a:hover {
    color: #2c3e50;
}

.jumia-product-description {
    font-size: 10px;
    color: #666;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 14px;
}

/* Price Section */
.jumia-product-price {
    margin-bottom: 10px;
}

.jumia-current-price {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.jumia-original-price {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
    margin-left: 6px;
}

.jumia-discount-percent {
    display: inline-block;
    background: #ff6b35;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

/* Action Buttons */
.jumia-product-actions {
    display: flex;
    gap: 6px;
}

.jumia-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.jumia-btn-primary {
    background: #3498db;
    color: white;
}

.jumia-btn-primary:hover {
    background: #2c3e50;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.jumia-btn-secondary {
    background: transparent;
    color: #2c3e50;
    border: 1px solid #2c3e50;
    margin-top: 6px;
}

.jumia-btn-secondary:hover {
    background: #2c3e50;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Mobile Specific Styles */
@media (max-width: 575.98px) {
    .jumia-product-image {
        padding-top: 60%; /* Shorter aspect ratio for mobile */
    }
    
    .jumia-product-info {
        padding: 6px;
    }
    
    .jumia-product-title {
        font-size: 10px;
        min-height: 24px;
        -webkit-line-clamp: 2;
        margin-bottom: 4px;
        line-height: 1.2;
    }
    
    .jumia-product-description {
        font-size: 8px;
        min-height: 12px;
        -webkit-line-clamp: 1;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
        color: #666;
    }
    
    .jumia-current-price {
        font-size: 11px;
        font-weight: 700;
    }
    
    .jumia-original-price {
        font-size: 9px;
    }
    
    .jumia-discount-percent {
        font-size: 7px;
        padding: 1px 3px;
    }
    
    .jumia-btn {
        padding: 4px 6px;
        font-size: 8px;
        gap: 2px;
    }
    
    .jumia-product-badge {
        font-size: 7px;
        padding: 1px 4px;
        top: 4px;
        left: 4px;
    }
    
    .jumia-product-category {
        display: none;
    }
    
    .jumia-product-price {
        margin-bottom: 6px;
    }
}

/* Tablet Specific Styles */
@media (min-width: 576px) and (max-width: 991.98px) {
    .jumia-product-info {
        padding: 11px;
    }
    
    .jumia-product-title {
        font-size: 12px;
    }
    
    .jumia-current-price {
        font-size: 13px;
    }
    
    .jumia-btn {
        padding: 7px 10px;
        font-size: 10px;
    }
}

/* Loading Animation */
.jumia-product-card.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Placeholder for missing images */
.jumia-product-image .placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 24px;
}

/* Section Headers */
.products-section {
    margin-bottom: 40px;
}

.section-header {
    margin-bottom: 25px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

/* Product Tabs */
.product-tabs .nav-pills {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.product-tabs .nav-link {
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.product-tabs .nav-link.active,
.product-tabs .nav-link:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Category Tabs */
.category-tabs .nav-pills {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.category-tabs .nav-link {
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-tabs .nav-link.active,
.category-tabs .nav-link:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Tab Content */
.tab-content {
    min-height: 400px;
}

.tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for very small screens */
@media (max-width: 360px) {
    .products-grid {
        gap: 4px;
        padding: 5px 0;
    }
    
    .jumia-product-image {
        padding-top: 55%; /* Even shorter for very small screens */
    }
    
    .jumia-product-info {
        padding: 4px;
    }
    
    .jumia-product-title {
        font-size: 9px;
        min-height: 20px;
        margin-bottom: 3px;
    }
    
    .jumia-current-price {
        font-size: 10px;
    }
    
    .jumia-original-price {
        font-size: 8px;
    }
    
    .jumia-discount-percent {
        font-size: 6px;
        padding: 1px 2px;
    }
    
    .jumia-btn {
        padding: 3px 4px;
        font-size: 7px;
    }
    
    .jumia-product-badge {
        font-size: 6px;
        padding: 1px 3px;
    }
    
    .jumia-product-price {
        margin-bottom: 4px;
    }
}