/* Amazon Product Display Plugin Styles */

.apd-product-card {
    display: flex;
    max-width: 600px;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.apd-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.apd-product-image {
    position: relative;
    flex: 0 0 150px;
    margin-right: 20px;
    align-self: flex-start;
}

.apd-product-image img {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
}

.apd-prime-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, #00a8cc, #0073e6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apd-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.apd-product-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #232f3e;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apd-product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.apd-stars {
    display: flex;
    gap: 2px;
    font-size: 14px;
}

.apd-star {
    color: #ffa500;
    line-height: 1;
}

.apd-star-full {
    color: #ffa500;
}

.apd-star-half {
    background: linear-gradient(90deg, #ffa500 50%, #e1e8ed 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.apd-star-empty {
    color: #e1e8ed;
}

.apd-rating-count {
    font-size: 12px;
    color: #565959;
    margin-left: 4px;
}

.apd-product-price {
    font-size: 18px;
    font-weight: bold;
    color: #b12704;
    margin-bottom: 12px;
}

.apd-product-actions {
    margin-top: auto;
}

.apd-buy-button {
    display: inline-block;
    background: linear-gradient(135deg, #ff9900, #ff7700);
    color: white !important;
    padding: 10px 24px;
    border-radius: 20px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(255, 153, 0, 0.3);
}

.apd-buy-button:hover {
    background: linear-gradient(135deg, #e68900, #e66600);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 153, 0, 0.4);
    color: white !important;
}

.apd-buy-button:active {
    transform: translateY(0);
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .apd-product-card {
        flex-direction: column;
        max-width: 100%;
        padding: 15px;
    }
    
    .apd-product-image {
        flex: none;
        margin: 0 auto 15px auto;
        text-align: center;
    }
    
    .apd-product-image img {
        max-width: 120px;
        max-height: 120px;
    }
    
    .apd-product-title {
        text-align: center;
        font-size: 15px;
    }
    
    .apd-product-rating,
    .apd-product-price {
        text-align: center;
    }
    
    .apd-buy-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .apd-product-card {
        margin: 15px 0;
        padding: 12px;
    }
    
    .apd-product-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    
    .apd-product-price {
        font-size: 16px;
    }
    
    .apd-buy-button {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .apd-product-card {
        background: #1a1a1a;
        border-color: #333;
        color: #ffffff;
    }
    
    .apd-product-title {
        color: #ffffff;
    }
    
    .apd-product-image img {
        background: #2a2a2a;
    }
    
    .apd-rating-count {
        color: #cccccc;
    }
}

/* Animation for loading states */
.apd-product-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.apd-product-card.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Print styles */
@media print {
    .apd-product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .apd-buy-button {
        display: none;
    }
    
    .apd-prime-badge {
        background: #000 !important;
        color: white !important;
    }
}