/* Amazon Associates Display – Front-end styles  v1.4
   ========================================================= */

/* Card: plain block container, centers its children via text-align */
.aad-product-card {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: 24px 0;
    text-align: center;
}

/* Clickable image wrapper — inline-block so it hugs the image width */
.aad-image-link {
    display: inline-block;
    text-decoration: none;
    line-height: 0;
    max-width: 100%;
}

.aad-image-link:hover,
.aad-image-link:focus {
    outline: none;
}

/* Product image — height fixed at 500 px, width follows aspect ratio */
.aad-product-image {
    display: block;
    height: 500px;        /* fallback; overridden by inline style from PHP */
    width: auto;
    max-width: 100%;
    border-radius: 3px;
    transition: opacity 0.15s ease;
}

.aad-image-link:hover .aad-product-image,
.aad-image-link:focus .aad-product-image {
    opacity: 0.88;
}

/* CTA button — pill-shaped, red, 450 px wide, centered */
.aad-cta-button {
    display: block;
    box-sizing: border-box;
    width: 450px;
    max-width: 100%;
    margin: 12px auto 0;
    padding: 14px 24px;
    background-color: #cc0000;
    color: #ffffff !important;
    /* font-size is set inline by PHP — editable in Settings */
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none !important;
    border-radius: 50px;
    letter-spacing: 0.01em;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    -webkit-font-smoothing: antialiased;
    cursor: pointer;
}

.aad-cta-button:hover,
.aad-cta-button:focus {
    background-color: #a80000;
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
    outline: none;
}

.aad-cta-button:active {
    background-color: #8c0000;
    box-shadow: none;
    transform: translateY(0);
}

/* "UNAVAILABLE" marker */
.aad-unavailable {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Responsive ---------------------------------------------------------------- */

/* Tablet: button starts shrinking once viewport is narrower than 540 px */
@media (max-width: 540px) {
    .aad-product-image {
        height: auto !important;
        max-height: 320px;
        width: auto;
        max-width: 100%;
    }

    /* Button fills available width on small screens */
    .aad-cta-button {
        width: 100%;
        padding: 12px 20px;
    }
}
