/* ============================================
   Amazon Affiliate Pro — Frontend Styles
   ============================================ */
:root {
    --aap-orange:     #FF9900;
    --aap-orange-dk:  #e68900;
    --aap-blue:       #146EB4;
    --aap-blue-dk:    #0f5c9e;
    --aap-text:       #0f1111;
    --aap-text-muted: #565959;
    --aap-border:     #ddd;
    --aap-bg:         #fff;
    --aap-bg-light:   #f7f8f8;
    --aap-prime:      #00A8E0;
    --aap-star:       #FF9900;
    --aap-green:      #007600;
    --aap-radius:     8px;
    --aap-shadow:     0 2px 12px rgba(0,0,0,.10);
}

/* ── Product Box ── */
.aap-product-box {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border: 1px solid var(--aap-border);
    border-radius: var(--aap-radius);
    background: var(--aap-bg);
    box-shadow: var(--aap-shadow);
    overflow: hidden;
    margin: 1.5em auto;
    transition: box-shadow .2s;
}
.aap-product-box:hover { box-shadow: 0 4px 20px rgba(0,0,0,.15); }

.aap-box-inner {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.aap-box-image {
    position: relative;
    min-width: 200px;
    width: 36%;
    background: var(--aap-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.aap-box-image img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    transition: transform .25s;
}
.aap-box-image:hover img { transform: scale(1.04); }

.aap-badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #c0392b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}
.aap-badge-prime {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: var(--aap-prime);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    font-style: italic;
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: .5px;
}

.aap-box-info {
    flex: 1;
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.aap-brand {
    font-size: 12px;
    color: var(--aap-text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
}

.aap-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}
.aap-title a { color: var(--aap-text); text-decoration: none; }
.aap-title a:hover { color: var(--aap-blue); text-decoration: underline; }

/* ── Stars ── */
.aap-rating {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
}
.aap-stars { display: flex; gap: 1px; }
.star { font-size: 16px; }
.star.full  { color: var(--aap-star); }
.star.half  { color: var(--aap-star); opacity: .7; }
.star.empty { color: #ccc; }
.aap-rating-sm .star { font-size: 13px; }
.aap-rating-num { font-size: 13px; color: var(--aap-blue); font-weight: 600; }
.aap-reviews     { font-size: 12px; color: var(--aap-text-muted); }

/* ── Features ── */
.aap-features {
    list-style: none;
    margin: .2rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.aap-features li {
    font-size: 13px;
    color: var(--aap-text-muted);
    padding-left: 1.2rem;
    position: relative;
    line-height: 1.4;
}
.aap-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--aap-green);
    font-weight: 700;
}

/* ── Price ── */
.aap-price-wrap { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.aap-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--aap-text);
}
.aap-old-price {
    font-size: 1rem;
    color: var(--aap-text-muted);
    text-decoration: line-through;
}
.aap-price-inline {
    font-weight: 700;
    color: var(--aap-text);
}

/* ── Buttons ── */
.aap-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .7rem 1.5rem;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: filter .2s, transform .1s;
    cursor: pointer;
    border: none;
}
.aap-btn:hover { filter: brightness(.92); transform: translateY(-1px); }
.aap-btn:active { transform: translateY(0); }

.aap-btn-buy {
    background: var(--aap-orange);
    color: #111;
    width: fit-content;
}
.aap-btn-sm {
    padding: .45rem 1rem;
    font-size: 12px;
    background: var(--aap-orange);
    color: #111;
    border-radius: 16px;
}
.aap-arrow { font-size: 16px; }

/* ── Disclaimer ── */
.aap-disclaimer {
    font-size: 11px;
    color: #aaa;
    margin: .3rem 0 0;
    font-style: italic;
}

/* ── Bestsellers ── */
.aap-bestsellers {
    border: 1px solid var(--aap-border);
    border-radius: var(--aap-radius);
    overflow: hidden;
    margin: 1.5em 0;
    box-shadow: var(--aap-shadow);
}
.aap-bestsellers-header {
    background: linear-gradient(135deg, #232F3E 0%, #37475A 100%);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .8rem;
}
.aap-bestsellers-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}
.aap-bestsellers-icon { font-size: 1.4rem; }

.aap-bestsellers-list { background: var(--aap-bg); }

.aap-bestseller-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background .15s;
}
.aap-bestseller-item:last-child { border-bottom: none; }
.aap-bestseller-item:hover { background: #fafafa; }

.aap-rank-badge {
    min-width: 32px;
    height: 32px;
    background: var(--aap-orange);
    color: #111;
    font-weight: 800;
    font-size: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aap-bs-image {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aap-bs-image img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.aap-bs-info {
    flex: 1;
    min-width: 0;
}
.aap-bs-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 .3rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aap-bs-info h4 a { color: var(--aap-text); text-decoration: none; }
.aap-bs-info h4 a:hover { color: var(--aap-blue); text-decoration: underline; }

.aap-bs-footer {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-top: .4rem;
}

/* ── Compare Table ── */
.aap-compare-wrap {
    margin: 1.5em 0;
    overflow-x: auto;
}
.aap-compare-table-container { overflow-x: auto; }
.aap-compare-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--aap-border);
    border-radius: var(--aap-radius);
    overflow: hidden;
    box-shadow: var(--aap-shadow);
    background: var(--aap-bg);
}
.aap-compare-table th,
.aap-compare-table td {
    padding: .9rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    font-size: 14px;
}
.aap-compare-label {
    background: #232F3E;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    width: 120px;
    min-width: 100px;
}
.aap-compare-images td {
    background: var(--aap-bg-light);
    text-align: center;
    padding: 1.2rem;
}
.aap-compare-images img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}
.aap-compare-title { font-size: 13px; font-weight: 500; }
.aap-compare-price-row td .aap-price { font-size: 1.2rem; }
.aap-compare-buy-row td { text-align: center; }
.aap-compare-features { margin: 0; }
.aap-compare-table tr:hover td { background: #fafafa; }
.aap-compare-table tr:hover .aap-compare-label { background: #232F3E; }

/* ── Error ── */
.aap-error {
    background: #ffeef0;
    border: 1px solid #f0c0c0;
    border-radius: 6px;
    color: #c0392b;
    padding: .8rem 1rem;
    font-size: 13px;
    margin: 1em 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .aap-box-inner { flex-direction: column; }
    .aap-box-image { width: 100%; min-width: unset; padding: 1.2rem; }
    .aap-bestseller-item { flex-wrap: wrap; }
    .aap-compare-table th,
    .aap-compare-table td { padding: .6rem .7rem; font-size: 12px; }
    .aap-compare-images img { width: 80px; height: 80px; }
}
