/**
 * Estilos para Productos Amazon PA API
 * Grid responsive de productos con ofertas
 */

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */

.amazon-products-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.amazon-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #232f3e;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #ff9900;
}

.amazon-products-widget {
    width: 100%;
}

/* ============================================
   GRID DE PRODUCTOS
   ============================================ */

.amazon-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 15px;
}

/* ============================================
   TARJETA DE PRODUCTO
   ============================================ */

.amazon-product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.amazon-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ============================================
   IMAGEN DEL PRODUCTO
   ============================================ */

.amazon-product-card .product-image {
    position: relative;
    padding: 20px;
    background: white;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amazon-product-card .product-image img {
    max-width: 100%;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.amazon-product-card .discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #cc0c39;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(204, 12, 57, 0.3);
    z-index: 10;
}

/* ============================================
   INFORMACIÓN DEL PRODUCTO
   ============================================ */

.amazon-product-card .product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.amazon-product-card .product-title {
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #0066c0;
    min-height: 40px;
}

.amazon-product-card .product-title a {
    color: #0066c0;
    text-decoration: none;
    transition: color 0.2s;
}

.amazon-product-card .product-title a:hover {
    color: #c45500;
    text-decoration: underline;
}

/* ============================================
   RATING
   ============================================ */

.amazon-product-card .product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    font-size: 14px;
}

.amazon-product-card .product-rating .star {
    color: #ddd;
    font-size: 16px;
}

.amazon-product-card .product-rating .star.filled {
    color: #ffa41c;
}

.amazon-product-card .product-rating .rating-value {
    color: #565959;
    font-size: 13px;
    margin-left: 5px;
}

/* ============================================
   PRECIO
   ============================================ */

.amazon-product-card .product-price {
    margin: 10px 0 15px 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.amazon-product-card .original-price {
    color: #565959;
    text-decoration: line-through;
    font-size: 14px;
}

.amazon-product-card .current-price {
    color: #b12704;
    font-size: 20px;
    font-weight: 700;
}

/* ============================================
   BOTÓN CTA
   ============================================ */

.amazon-product-card .amazon-cta-button {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: #ff9900;
    color: #0f1111;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    margin-top: auto;
}

.amazon-product-card .amazon-cta-button:hover {
    background: #fa8900;
    color: #0f1111;
}

/* ============================================
   DISCLAIMER
   ============================================ */

.amazon-products-widget .amazon-disclaimer {
    text-align: center;
    font-size: 11px;
    color: #565959;
    margin-top: 10px;
    font-style: italic;
}

/* ============================================
   FALLBACK WIDGET (Sin PA API)
   ============================================ */

.amazon-fallback {
    padding: 20px;
}

.amazon-search-widget {
    background: linear-gradient(135deg, #232f3e 0%, #37475a 100%);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.amazon-search-widget .amazon-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.amazon-search-widget h4 {
    color: white;
    font-size: 20px;
    margin: 0 0 10px 0;
}

.amazon-search-widget p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 20px 0;
}

.amazon-search-widget .amazon-search-button {
    display: inline-block;
    padding: 12px 30px;
    background: #ff9900;
    color: #0f1111;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: background 0.2s;
}

.amazon-search-widget .amazon-search-button:hover {
    background: #fa8900;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablets */
@media (max-width: 992px) {
    .amazon-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .amazon-section-title {
        font-size: 20px;
    }

    .amazon-product-card .product-image {
        min-height: 150px;
    }

    .amazon-product-card .product-image img {
        max-height: 140px;
    }
}

/* Móviles */
@media (max-width: 640px) {
    .amazon-products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .amazon-products-section {
        padding: 15px;
        margin: 20px 0;
    }

    .amazon-section-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .amazon-product-card .product-image {
        min-height: 180px;
        padding: 15px;
    }

    .amazon-product-card .product-image img {
        max-height: 160px;
    }

    .amazon-product-card .product-title {
        font-size: 13px;
        min-height: auto;
    }

    .amazon-product-card .current-price {
        font-size: 18px;
    }

    .amazon-product-card .amazon-cta-button {
        padding: 12px 20px;
        font-size: 13px;
    }
}

/* Móviles pequeños */
@media (max-width: 400px) {
    .amazon-product-card .product-image {
        min-height: 150px;
    }

    .amazon-product-card .product-image img {
        max-height: 130px;
    }
}

/* ============================================
   VARIANTE BANNER (para archive)
   ============================================ */

.mejor-ad-amazon.amazon-banner {
    margin: 20px 0;
}

.amazon-banner .amazon-products-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.amazon-banner .amazon-product-card {
    max-width: 300px;
    margin: 0 auto;
}

/* ============================================
   VARIANTE NATIVE GRID (integrado en listado)
   ============================================ */

.archive-native-grid .amazon-product-card {
    background: #fff9e6;
    border: 2px solid #ff9900;
}

.archive-native-grid .amazon-product-card::before {
    content: "Patrocinado";
    display: block;
    background: #232f3e;
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    margin: -15px -15px 10px -15px;
    text-align: center;
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.amazon-product-card {
    animation: fadeInUp 0.4s ease-out;
}

.amazon-product-card:nth-child(1) {
    animation-delay: 0.1s;
}

.amazon-product-card:nth-child(2) {
    animation-delay: 0.2s;
}

.amazon-product-card:nth-child(3) {
    animation-delay: 0.3s;
}
