/* Affiliate Product Display Styles */
.affiliate-product {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.affiliate-product-inner {
    text-align: center;
}

/* CONTENITORE IMMAGINE CON ALTEZZA FISSA */
/* QUADRATO PERFETTO MA RESPONSIVE */
.affiliate-product-image {
    position: relative;
    width: 100%;
    max-width: 300px; /* Larghezza massima */
    height: 0;
    padding-bottom: 100%; /* Altezza = Larghezza (quadrato) */
    overflow: hidden;
    border-radius: 8px;
    background: #f8f8f8;
    margin: 0 auto 12px auto;
}

.affiliate-product-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.affiliate-product-title {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
}

.affiliate-product-title a {
    text-decoration: none;
    color: #333;
}

.affiliate-product-price {
    font-size: 16px;
    font-weight: bold;
    color: #B12704;
    margin: 8px 0;
}

.affiliate-product-button {
    margin-top: 10px;
}

.affiliate-mobile-insert {
    display: none;
}

.affiliate-button {
    display: inline-block;
    background: #14dd00;
    color: #000 !important;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 13px;
    border: 0px solid #14dd00;
    transition: all 0.3s ease;
}

.affiliate-button:hover {
    background: #FA8900;




/* Loading state */
.apd-track-click.loading {
    pointer-events: none;
    opacity: 0.7;




/* MOBILE OPTIMIZATION */
@media (max-width: 768px) {
    .affiliate-product-image {
        height: 200px; /* Più compatto su mobile */
        max-width: 250px;
    }
    
    .affiliate-product-image.auto-size img {
        max-height: 180px;
    }
	
	.affiliate-mobile-insert {
        display: block;
        margin: 25px auto;
        text-align: center;
        clear: both;
    }
    
    .affiliate-mobile-top {
        margin-top: 20px;
    }
    
    .affiliate-mobile-bottom {
        margin-bottom: 20px;
        border-top: 1px solid #eee;
        padding-top: 25px;
    }
    
    /* Nascondi il widget nella sidebar su mobile */
    .sidebar .apd_affiliate_widget,
    .sidebar .widget_apd_affiliate_widget {
        display: none;
    }
}

/* Stili specifici per Genesis */
@media (max-width: 768px) {
    .content-sidebar-wrap .sidebar,
    .sidebar-primary,
    .sidebar-secondary {
        display: none;
    }
}
}