/* ==========================================================================
   ExploringArizona.org - Amazon Affiliate Layout Section
   ========================================================================== */

/* 3-Card Grid for Future Amazon Affiliate Row */
.AMA-section-intro {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 15px;
}
.AMA-affiliate-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 35px;
}
.AMA-product-card {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ==========================================================================
   High-Capacity Amazon Affiliate List-Row Layout (Up to 16 Items)
   ========================================================================== */
/* Main vertical stack container */
.AMA-affiliate-list {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Tight, uniform spacing between rows */
    margin-bottom: 35px;
}
/* Individual horizontal product row */
.AMA-product-row {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 15px;
    background-color: #ffffff;
    gap: 15px;
}
/* Bulletproof fixed-square image container */
.AMA-product-img-box {
    width: 90px;
    height: 90px;
    flex-shrink: 0; /* Prevents the box from squishing */
    background-color: #fcfcfc;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* Forces huge images (even 4000px) into the 90px space safely */
.AMA-product-img-box img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
/* Center content area that expands dynamically */
.AMA-product-details {
    flex: 1;
    min-width: 0; /* Prevents text overflow bugs */
}
.AMA-product-details h4 {
    margin: 0 0 4px 0;
    font-size: 1.1em;
    color: #2c3e50;
}
.AMA-product-details p {
    margin: 0;
    font-size: 0.88em;
    color: #555;
    line-height: 1.4;
}
/* Compact action link button area */
.AMA-product-action {
    flex-shrink: 0;
    padding-left: 10px;
}
.AMA-affiliate-list-btn {
    background-color: #ff9900; /* Amazon Gold */
    color: #111111;
    text-decoration: none;
    padding: 10px 16px;
    font-size: 0.85em;
    font-weight: bold;
    border-radius: 3px;
    white-space: nowrap; /* Prevents text from wrapping to two lines */
    display: inline-block;
    border-bottom: 2px solid #d48000;
    transition: background-color 0.2s ease;
}
.AMA-affiliate-list-btn:hover {
    background-color: #e68a00;
}

/* Responsive adjustments for narrow widths */
@media (max-width: 600px) {
    .AMA-product-row {
        flex-direction: column;
        text-align: center;
        align-items: center;
        padding: 15px;
    }
    .AMA-product-action {
        padding-left: 0;
        width: 100%;
    }
    .AMA-affiliate-list-btn {
        display: block;
        text-align: center;
    }
}

/* Responsive adjustments if the parent table flexes down */
@media (max-width: 768px) {
    .AMA-affiliate-grid {
        flex-direction: column;
        gap: 20px;
    }
}