/* ============================================================
   Amazon Affiliate Pro — Conversion-Optimized Styles v2.0
   Temas: orange · blue · green · red · purple · dark · forest
          coral · slate · gold
   ============================================================ */

.aap-wrap *, .aap-wrap *::before, .aap-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- TEMAS DE COLOR ---- */
.aap-product-card,
.aap-theme-orange { --aap-accent:#FF9900; --aap-accent-dark:#e68900; --aap-accent-text:#111; --aap-btn-bg:#FF9900; --aap-btn-hover:#e68900; --aap-btn-text:#111; --aap-star:#FF9900; }
.aap-theme-blue   { --aap-accent:#1a73e8; --aap-accent-dark:#1557b0; --aap-accent-text:#fff; --aap-btn-bg:#1a73e8; --aap-btn-hover:#1557b0; --aap-btn-text:#fff; --aap-star:#FF9900; }
.aap-theme-green  { --aap-accent:#2e7d32; --aap-accent-dark:#1b5e20; --aap-accent-text:#fff; --aap-btn-bg:#2e7d32; --aap-btn-hover:#1b5e20; --aap-btn-text:#fff; --aap-star:#FF9900; }
.aap-theme-red    { --aap-accent:#d32f2f; --aap-accent-dark:#b71c1c; --aap-accent-text:#fff; --aap-btn-bg:#d32f2f; --aap-btn-hover:#b71c1c; --aap-btn-text:#fff; --aap-star:#FF9900; }
.aap-theme-purple { --aap-accent:#7b1fa2; --aap-accent-dark:#4a148c; --aap-accent-text:#fff; --aap-btn-bg:#7b1fa2; --aap-btn-hover:#4a148c; --aap-btn-text:#fff; --aap-star:#FF9900; }
.aap-theme-dark   { --aap-accent:#232F3E; --aap-accent-dark:#131a22; --aap-accent-text:#FF9900; --aap-btn-bg:#232F3E; --aap-btn-hover:#131a22; --aap-btn-text:#FF9900; --aap-star:#FF9900; }
.aap-theme-forest { --aap-accent:#33691e; --aap-accent-dark:#1b5e20; --aap-accent-text:#fff; --aap-btn-bg:#33691e; --aap-btn-hover:#1b5e20; --aap-btn-text:#fff; --aap-star:#FF9900; }
.aap-theme-coral  { --aap-accent:#E84393; --aap-accent-dark:#c0306f; --aap-accent-text:#fff; --aap-btn-bg:#E84393; --aap-btn-hover:#c0306f; --aap-btn-text:#fff; --aap-star:#FF9900; }
.aap-theme-slate  { --aap-accent:#455a64; --aap-accent-dark:#263238; --aap-accent-text:#fff; --aap-btn-bg:#455a64; --aap-btn-hover:#263238; --aap-btn-text:#fff; --aap-star:#FF9900; }
.aap-theme-gold   { --aap-accent:#c79100; --aap-accent-dark:#9a6e00; --aap-accent-text:#fff; --aap-btn-bg:#c79100; --aap-btn-hover:#9a6e00; --aap-btn-text:#fff; --aap-star:#c79100; }

/* ============================================================
   PRODUCT CARD (diseño horizontal, conversión optimizada)
   ============================================================ */
.aap-product-card {
    position: relative;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 14px;
    overflow: visible;
    max-width: 540px;
    margin: 28px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    transition: box-shadow .22s, transform .18s;
}
.aap-product-card:hover { box-shadow: 0 6px 28px rgba(0,0,0,0.13); transform: translateY(-2px); }

.aap-badge {
    position: absolute;
    top: -14px; left: 18px;
    background: var(--aap-accent);
    color: var(--aap-accent-text);
    font-size: 11px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
    padding: 5px 13px; border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    white-space: nowrap; z-index: 3;
}

.aap-card-inner {
    border-top: 4px solid var(--aap-accent);
    border-radius: 12px; overflow: hidden;
    display: flex; flex-direction: row; min-height: 180px;
}

.aap-card-image-col {
    width: 160px; flex-shrink: 0;
    background: #f8f8f8;
    display: flex; align-items: center; justify-content: center;
    padding: 18px 12px; position: relative;
    border-right: 1px solid #f0f0f0;
}
.aap-card-image-col img {
    max-width: 130px; max-height: 130px;
    width: auto; height: auto; object-fit: contain;
    border-radius: 6px; display: block;
    transition: transform .22s;
}
.aap-product-card:hover .aap-card-image-col img { transform: scale(1.04); }

.aap-prime {
    position: absolute; bottom: 8px;
    left: 50%; transform: translateX(-50%);
    background: #0F79C0; color: #fff;
    font-size: 10px; font-weight: 800; font-style: italic;
    letter-spacing: 1.5px; padding: 2px 8px;
    border-radius: 3px; white-space: nowrap;
}

.aap-card-content {
    flex: 1; padding: 18px 18px 14px;
    display: flex; flex-direction: column; min-width: 0;
}

.aap-card-title {
    font-size: 14px; font-weight: 700;
    color: #111; line-height: 1.4; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.aap-card-title a { color: inherit; text-decoration: none; }
.aap-card-title a:hover { color: var(--aap-accent); }

.aap-card-desc {
    font-size: 12.5px; color: #555;
    line-height: 1.55; margin-bottom: 10px; flex: 1;
}

.aap-card-rating {
    display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.aap-stars-wrap { display: inline-flex; gap: 0; line-height: 1; }
.aap-star-full  { color: var(--aap-star); font-size: 14px; }
.aap-star-half  { color: var(--aap-star); font-size: 14px; opacity: .6; }
.aap-star-empty { color: #ddd; font-size: 14px; }
.aap-review-count { font-size: 12px; color: #777; }

.aap-card-price-row {
    display: flex; align-items: baseline;
    gap: 8px; margin-bottom: 12px;
}
.aap-card-price { font-size: 22px; font-weight: 800; color: #111; line-height: 1; }
.aap-card-old-price { font-size: 14px; color: #999; text-decoration: line-through; }
.aap-card-savings {
    font-size: 12px; font-weight: 700; color: #c0392b;
    background: #fdecea; padding: 2px 7px; border-radius: 12px;
}

.aap-card-actions { display: flex; gap: 8px; align-items: center; }

.aap-btn-main {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--aap-btn-bg); color: var(--aap-btn-text);
    font-size: 13px; font-weight: 700;
    padding: 11px 16px; border-radius: 8px;
    text-decoration: none; border: none; cursor: pointer;
    transition: background .16s, transform .12s; white-space: nowrap;
}
.aap-btn-main:hover { background: var(--aap-btn-hover); transform: translateY(-1px); }

.aap-btn-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    background: #f5f5f5; color: #333;
    font-size: 12px; font-weight: 600;
    padding: 11px 13px; border-radius: 8px;
    text-decoration: none; border: 1px solid #e0e0e0; cursor: pointer;
    transition: background .16s; white-space: nowrap;
}
.aap-btn-secondary:hover { background: #ebebeb; }

.aap-disclaimer { font-size: 10px; color: #aaa; margin-top: 8px; font-style: italic; }

/* ============================================================
   VARIANTE VERTICAL (para grids)
   ============================================================ */
.aap-card-vertical {
    position: relative; background: #fff;
    border: 1.5px solid #e8e8e8; border-radius: 14px;
    overflow: visible;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow .22s, transform .18s;
}
.aap-card-vertical:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.12); transform: translateY(-2px); }
.aap-card-inner-vert {
    border-top: 4px solid var(--aap-accent);
    border-radius: 12px; overflow: hidden;
    display: flex; flex-direction: column;
}
.aap-vert-img {
    background: #f8f8f8; padding: 20px; text-align: center;
    border-bottom: 1px solid #f0f0f0;
}
.aap-vert-img img {
    max-width: 120px; max-height: 120px; object-fit: contain;
    transition: transform .2s;
}
.aap-card-vertical:hover .aap-vert-img img { transform: scale(1.05); }
.aap-vert-body { padding: 14px; }
.aap-card-vertical .aap-card-title { -webkit-line-clamp: 3; font-size: 13px; }
.aap-card-vertical .aap-card-price { font-size: 18px; }
.aap-card-vertical .aap-btn-main { width: 100%; justify-content: center; margin-top: 10px; }

.aap-products-grid-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px; margin: 20px 0;
}

/* ============================================================
   LISTICLE numerada
   ============================================================ */
.aap-listicle {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    border-radius: 12px; overflow: hidden;
    border: 1.5px solid #e8e8e8;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.aap-listicle-header {
    background: var(--aap-accent); color: var(--aap-accent-text);
    padding: 12px 18px; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
.aap-listicle-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #fff;
    border-bottom: 1px solid #f2f2f2;
    transition: background .15s;
}
.aap-listicle-item:last-child { border-bottom: none; }
.aap-listicle-item:hover { background: #fafafa; }
.aap-listicle-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--aap-accent); color: var(--aap-accent-text);
    font-size: 12px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.aap-listicle-img { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; border-radius: 4px; background: #f5f5f5; }
.aap-listicle-info { flex: 1; min-width: 0; }
.aap-listicle-name { font-size: 13px; font-weight: 600; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aap-listicle-price { font-size: 12px; color: #555; margin-top: 2px; }
.aap-listicle-btn {
    background: var(--aap-btn-bg); color: var(--aap-btn-text);
    font-size: 11px; font-weight: 700; padding: 7px 13px;
    border-radius: 7px; text-decoration: none; white-space: nowrap;
    transition: background .15s; flex-shrink: 0;
}
.aap-listicle-btn:hover { background: var(--aap-btn-hover); }

/* ============================================================
   COMPARISON TABLE
   ============================================================ */
.aap-comparison-wrap {
    margin: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    border-radius: 12px; overflow: hidden;
    border: 1.5px solid #e8e8e8;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.aap-comparison-title-bar {
    background: var(--aap-accent); color: var(--aap-accent-text);
    padding: 12px 18px; font-size: 14px; font-weight: 700;
}
.aap-table-scroll { overflow-x: auto; }
.aap-comparison-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.aap-comparison-table th {
    background: #f8f8f8; color: #333; padding: 12px 14px;
    text-align: center; font-size: 12px; font-weight: 700;
    border-bottom: 2px solid #ebebeb;
}
.aap-comparison-table th.aap-col-label { text-align: left; background: #f0f0f0; }
.aap-comparison-table td {
    padding: 11px 14px; border-bottom: 1px solid #f2f2f2;
    text-align: center; vertical-align: middle; color: #222;
}
.aap-comparison-table td.aap-col-label { text-align: left; color: #666; font-size: 12px; font-weight: 600; background: #fafafa; }
.aap-comparison-table tr:last-child td { border-bottom: none; }
.aap-comparison-table tr:hover td { background: rgba(0,0,0,0.015); }
.aap-comparison-img { max-width: 80px; max-height: 80px; object-fit: contain; }
.aap-comparison-cta td { padding: 14px; }
.aap-comparison-table .aap-price { font-size: 15px; font-weight: 800; color: #111; }

/* ============================================================
   TEXT LINK & STANDALONE BUTTON
   ============================================================ */
.aap-text-link { color: var(--aap-accent); text-decoration: underline; font-weight: 600; transition: color .15s; }
.aap-text-link:hover { color: var(--aap-accent-dark); }

.aap-btn-standalone {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--aap-btn-bg); color: var(--aap-btn-text);
    font-size: 14px; font-weight: 700; padding: 12px 28px;
    border-radius: 8px; text-decoration: none; border: none; cursor: pointer;
    transition: background .16s, transform .12s, box-shadow .16s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}
.aap-btn-standalone:hover { background: var(--aap-btn-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }

/* ============================================================
   ANIMACIÓN & UTILS
   ============================================================ */
.aap-animate { opacity: 0; transform: translateY(14px); transition: opacity .42s ease, transform .42s ease; }
.aap-animate.aap-visible { opacity: 1; transform: translateY(0); }

.aap-error  { color: #c0392b; font-size: 13px; padding: 10px 14px; background: #fdf0ef; border-radius: 8px; border-left: 3px solid #c0392b; }
.aap-notice { color: #555; font-size: 13px; padding: 10px 14px; background: #f5f5f5; border-radius: 8px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 540px) {
    .aap-card-inner { flex-direction: column; }
    .aap-card-image-col { width: 100%; border-right: none; border-bottom: 1px solid #f0f0f0; padding: 16px; }
    .aap-comparison-table { font-size: 11px; }
    .aap-comparison-img { max-width: 55px; }
    .aap-products-grid-wrap { grid-template-columns: 1fr 1fr; }
}
