:root {
    --primary-color: #4a6bff;
    --secondary-color: #f8f9fa;
    --accent-color: #ff6b6b;
    --text-color: #333;
    --light-text: #777;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product {
    background-color: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
    margin: 50px auto;
}

.affiliate-container {
    max-width: 90%;
    height: 100%;
    margin: 2rem auto;
    padding: 40px 15px;
    position: relative;
}

.affiliate-header {
    text-align: center;
    margin-bottom: 2rem;
}

.affiliate-header h2 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.affiliate-header p {
    color: var(--light-text);
    font-size: 1.1rem;
}

.affiliate-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.category-btn {
    padding: 0.6rem 1.2rem;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-btn:hover,
.category-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.slider-container {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    min-height: 480px;
    margin-bottom: 30px;
}

.affiliate-slider {
    display: flex;
    align-items: stretch;
    transition: transform 0.5s ease;
    width: 100%;
}

.product-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
    flex: 0 0 calc(20% - 1.2rem);
    margin-right: 1.5rem;
    min-width: 0;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ensure card takes full height */
}

.product-card:last-child {
    margin-right: 0;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

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

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--accent-color);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.product-info {
    padding: 1.2rem;
}

.product-title {
    /* font-size: 2rem; */
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.product-description {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-bottom: .5rem;
    display: -webkit-box;
    /* line-height: 1.4; */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 1rem; */
}

.product-price {
    font-weight: bold;
    color: var(--primary-color);
}

.product-rating {
    color: #ffc107;
    font-size: 0.9rem;
}

.product-btn {
    display: block;
    width: 100%;
    padding: 0.5rem;
    font-size: 15px;
    background-color: #FFD814;
    color: #0F1111;
    border: 1px solid #FCD200;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.product-btn:hover {
    background-color: #F7CA00;
    border-color: #F2C200;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.current-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.original-price {
    font-size: 0.9rem;
    color: #B12704;
    text-decoration: line-through;
}

.discount {
    font-size: 0.9rem;
    color: #067D62;
    font-weight: 500;
}

.delivery-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 12px;
    font-size: 0.85rem;
}

.delivery-badge {
    background-color: #F5F5F5;
    color: #565959;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.delivery-time {
    color: #067D62;
}

.refer-earn-badge {
    background-color: #28a745;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: #777;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    border: none;
    font-size: 2rem;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.slider-nav:hover {
    background-color: var(--primary-color);
    opacity: 1;
}

.slider-prev {
    left: 0;
}

.slider-next {
    right: 0;
}

.slider-dots {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 8px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: background-color 0.3s;
}

.slider-dot.active {
    background-color: var(--primary-color);
}

@media (max-width: 1200px) {
    .product-card {
        flex: 0 0 calc(25% - 1.2rem);
        min-width: 0;
    }
}

@media (max-width: 992px) {
    .product-card {
        flex: 0 0 calc(33.333% - 1.2rem);
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .product-card {
        flex: 0 0 calc(50% - 1.2rem);
        min-width: 0;
    }

    .affiliate-slider {
        margin-right: -0.8rem;
    }

    /* Adjust image height for tablets */
    .product-image {
        height: 160px;
    }

    .category-btn {
        padding: 0.4rem 1rem;
        font-size: 12px;
        font-weight: 400;
    }

}

@media (max-width: 576px) {
    .product-card {
        flex: 0 0 calc(100% - 0.8rem);
        margin-right: 0.8rem;
        height: auto;
        /* Allow natural height on mobile */
    }

    .affiliate-slider {
        margin-right: -0.8rem;
    }

    .affiliate-header h2 {
        font-size: 1.8rem;
    }

    .slider-nav {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    /* Full height adjustments for mobile */
    .product-image {
        height: 200px;
        /* Fixed height for mobile */
    }

    .product-description {
        flex-grow: 1;
        /* Allow description to expand */
    }
}

