/* Affiliate Components Styles */

/* Carousel */
.affiliate-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding: 1rem 0;
    margin: 2rem 0;
    scrollbar-width: thin;
}

.affiliate-carousel::-webkit-scrollbar {
    height: 8px;
}

.affiliate-carousel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.affiliate-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s;
}

.affiliate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.affiliate-card img {
    max-height: 150px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.affiliate-card h4 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
    line-height: 1.3;
}

.affiliate-card .price {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.affiliate-card .discount {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.affiliate-card .cta-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
}

.affiliate-actions {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
    justify-content: center;
    width: 100%;
}

.affiliate-card .cta-button.secondary {
    background: #455a64; /* Secondary Dark Grey */
    font-size: 0.9rem;
}

/* Sidebar */
.affiliate-sidebar {
    display: none;
}

@media (min-width: 1200px) {
    .affiliate-sidebar {
        display: block;
        position: fixed;
        right: 20px;
        top: 100px;
        width: 250px;
        z-index: 100;
    }
    
    .affiliate-sidebar .affiliate-card {
        border-left: 4px solid var(--accent);
    }
}

/* Bottom Banner */
.affiliate-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 1rem;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateY(100%);
    animation: slideUp 0.5s forwards 2s; /* Delay appearance */
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.affiliate-banner img {
    height: 60px;
    width: auto;
}

.affiliate-banner-content {
    flex: 1;
    max-width: 600px;
}

.affiliate-banner h4 {
    margin: 0;
    font-size: 1rem;
}

.affiliate-banner p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.affiliate-banner-close {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    z-index: 10;
}

.affiliate-banner-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.affiliate-banner-text {
    display: flex;
    flex-direction: column;
}

.affiliate-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    min-width: 140px;
}

.affiliate-banner-actions .button {
    width: 100%;
    margin-top: 0 !important;
}

@media (max-width: 768px) {
    .affiliate-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .affiliate-banner-content {
        max-width: 100%;
    }

    .affiliate-banner-info {
        gap: 0.75rem;
    }
    
    .affiliate-banner img {
        height: 50px;
    }

    .affiliate-banner .affiliate-banner-text p {
        display: none !important;
    }

    .affiliate-banner h4 {
        font-size: 0.95rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-align: left;
    }

    .affiliate-banner-actions {
        flex-direction: row;
        width: 100%;
        align-items: center;
    }

    .affiliate-banner-actions .button {
        flex: 1;
        text-align: center;
    }
}

/* Affiliate CTA Shortcode */
.affiliate-cta {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.affiliate-cta-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.affiliate-cta-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.affiliate-cta img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    background: white;
    padding: 2px;
    border: 1px solid #eee;
}

.affiliate-cta-text h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #333;
}

.affiliate-cta-text p {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.4;
}

.affiliate-cta-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 160px;
}

.affiliate-cta-actions .button {
    width: 100%;
    text-align: center;
    justify-content: center;
}

@media (max-width: 600px) {
    .affiliate-cta-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .affiliate-cta-info {
        flex-direction: column;
        text-align: center;
    }
    
    .affiliate-cta-actions {
        width: 100%;
        flex-direction: row;
    }
    
    .affiliate-cta-actions .button {
        flex: 1;
    }
}
