/* Amazon Affiliate Cards — Frontend Styles */

.aac-grid {
    margin: 1.5rem 0;
}

.aac-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.aac-cards {
    display: grid;
    grid-template-columns: repeat(var(--aac-cols, 3), 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .aac-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .aac-cards {
        grid-template-columns: 1fr !important;
    }
}

/* ── Card Base ── */
.aac-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.aac-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* ── Card Image ── */
.aac-card-img-link {
    display: block;
    text-decoration: none;
}

.aac-card-img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f8f8f8;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aac-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
    padding: 8px;
}

.aac-card:hover .aac-card-img {
    transform: scale(1.03);
}

.aac-img-fallback {
    display: none;
    font-size: 3rem;
    color: #ccc;
}

.aac-card-img-wrap.aac-img-error .aac-img-fallback {
    display: block;
}

/* ── Card Body ── */
.aac-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.aac-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aac-card-title.aac-title-placeholder {
    color: #9ca3af;
    font-weight: 400;
    font-style: italic;
}

.aac-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 10px;
}

.aac-card-btn {
    display: block;
    text-align: center;
    background: #FF9900;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none !important;
    margin-top: auto;
    transition: background 0.15s ease;
    letter-spacing: 0.01em;
}

.aac-card-btn:hover {
    background: #e68900;
    color: #fff !important;
}

/* ── Style: Minimal ── */
.aac-style-minimal .aac-card {
    border-color: #f0f0f0;
    border-radius: 8px;
}

.aac-style-minimal .aac-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transform: none;
}

.aac-style-minimal .aac-card-btn {
    background: transparent;
    color: #FF9900 !important;
    border: 1.5px solid #FF9900;
}

.aac-style-minimal .aac-card-btn:hover {
    background: #fff8ec;
}

/* ── Style: Compact ── */
.aac-style-compact .aac-cards {
    gap: 10px;
}

.aac-style-compact .aac-card {
    flex-direction: row;
    align-items: center;
    border-radius: 8px;
}

.aac-style-compact .aac-card-img-wrap {
    width: 90px;
    min-width: 90px;
    aspect-ratio: 1 / 1;
    border-radius: 8px 0 0 8px;
    flex-shrink: 0;
}

.aac-style-compact .aac-card-body {
    padding: 10px 12px;
}

.aac-style-compact .aac-card-title {
    -webkit-line-clamp: 2;
    font-size: 13px;
}

.aac-style-compact .aac-card-btn {
    font-size: 12px;
    padding: 6px 10px;
}

@media (max-width: 480px) {
    .aac-style-compact .aac-card {
        flex-direction: column;
    }
    .aac-style-compact .aac-card-img-wrap {
        width: 100%;
        border-radius: 8px 8px 0 0;
    }
}
