/**
 * Grid Default Template CSS
 * CSS per il template base hardcoded del plugin Amazon Deals BOT
 * 
 * @version 3.1
 * @author OrlanGO + Claude Sonnet 4
 */
 
@import url('https://fonts.googleapis.com/css2?family=McLaren&display=swap');

/* Container principale template */
.ads-template-grid-default {
    font-family: 'McLaren', cursive, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 20px 0;
    clear: both;
}

/* Titolo ADS */
.ads-template-grid-default .ads-title {
    color: #ef746a;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 20px 0;
    border-bottom: 2px solid #ef746a;
    padding-bottom: 8px;
}

/* Statistiche ADS */
.ads-template-grid-default .ads-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #ef746a;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #495057;
}

.ads-template-grid-default .ads-stats span {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.ads-template-grid-default .ads-count::before {
    content: "🛍️";
    margin-right: 5px;
}

.ads-template-grid-default .ads-discount::before {
    content: "💰";
    margin-right: 5px;
}

.ads-template-grid-default .ads-updated::before {
    content: "⏱️";
    margin-right: 5px;
}

/* Griglia prodotti */
.ads-template-grid-default .ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* Card singolo prodotto */
.ads-template-grid-default .ads-product {
    background: #ffffff;
    border: 1px solid #ef746a;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ads-template-grid-default .ads-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #ffadad;
}

/* Badge sconto */
.ads-template-grid-default .ads-product-discount {
    position: absolute;
    top: -8px;
    right: 16px;
    background: linear-gradient(135deg, #ffadad 0%, #ef746a 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(239, 116, 106, 0.3);
    z-index: 2;
}

/* Immagine prodotto - INGRANDITA */
.ads-template-grid-default .ads-product-image {
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ads-template-grid-default .ads-product-image img {
    max-width: 280px !important;
    max-height: 280px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

/* Fallback immagine - INGRANDITA */
.ads-template-grid-default .ads-image-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 280px;
    height: 280px;
    background: linear-gradient(135deg, #ef746a 0%, #ffadad 100%);
    border: 2px dashed #ced4da;
    border-radius: 8px;
    margin: 0 auto;
}

.ads-template-grid-default .ads-fallback-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.ads-template-grid-default .ads-fallback-text {
    font-size: 12px;
    color: white;
    font-weight: 500;
}

/* Titolo prodotto */
.ads-template-grid-default .ads-product-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #2c3e50;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 60px;
}

/* Sezione prezzi */
.ads-template-grid-default .ads-pricing {
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ads-template-grid-default .ads-price-current {
    font-size: 20px;
    font-weight: 700;
    color: #e74c3c;
    letter-spacing: -0.5px;
}

.ads-template-grid-default .ads-price-original {
    font-size: 16px;
    color: #95a5a6;
    text-decoration: line-through;
    font-weight: 500;
}

/* Pulsante acquisto */
.ads-template-grid-default .ads-buy-button {
    display: block;
    width: calc(100% - 20px);
    background: linear-gradient(135deg, #ffadad 0%, #ef746a 100%);
    color: white;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 116, 106, 0.2);
    margin: 16px auto 0;
}

.ads-template-grid-default .ads-buy-button:hover {
    background: linear-gradient(135deg, #ef746a 0%, #ffadad 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 116, 106, 0.3);
    color: white;
    text-decoration: none;
}

.ads-template-grid-default .ads-buy-button:active {
    transform: translateY(0);
}

/* Messaggio nessun prodotto */
.ads-template-grid-default .ads-no-products {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    color: #6c757d;
}

.ads-template-grid-default .ads-no-products p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ads-template-grid-default .ads-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .ads-template-grid-default .ads-product {
        padding: 16px;
    }
    
    .ads-template-grid-default .ads-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .ads-template-grid-default .ads-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .ads-template-grid-default .ads-grid {
        grid-template-columns: 1fr;
    }
    
    .ads-template-grid-default .ads-product-image {
        min-height: 120px;
    }
    
    .ads-template-grid-default .ads-product-image img {
        max-width: 120px;
        max-height: 120px;
    }
}

/* Animazioni di caricamento */
@keyframes ads-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ads-template-grid-default .ads-product {
    animation: ads-fadeIn 0.6s ease forwards;
}

.ads-template-grid-default .ads-product:nth-child(2) {
    animation-delay: 0.1s;
}

.ads-template-grid-default .ads-product:nth-child(3) {
    animation-delay: 0.2s;
}

.ads-template-grid-default .ads-product:nth-child(4) {
    animation-delay: 0.3s;
}

/* Accessibilità */
.ads-template-grid-default .ads-buy-button:focus {
    outline: 2px solid #ef746a;
    outline-offset: 2px;
}

.ads-template-grid-default .ads-product:focus-within {
    outline: 2px solid #ef746a;
    outline-offset: 2px;
}