/* TBS Affiliate Preisvergleich v1.6.4 – Frontend Widget */

.tbsapc-widget {
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
    background: #fafafa;
    font-size: 0.93em;
    position: relative;
}
.tbsapc-widget::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(90deg, #0070ba 0%, #3aa757 50%, #ff9900 100%);
}

.tbsapc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.tbsapc-title {
    font-weight: 800;
    font-size: 1em;
    color: #1d2327;
    letter-spacing: .3px;
}
.tbsapc-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .78em; font-weight: 700; }
.tbsapc-badge--best { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }

/* ── Angebot-Zeilen ── */
.tbsapc-offers { display: flex; flex-direction: column; gap: 8px; }

.tbsapc-offer {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    padding: 11px 14px;
    transition: border-color .15s, box-shadow .15s;
}
.tbsapc-offer:hover {
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.tbsapc-offer--best {
    border-color: #a5d6a7;
    background: linear-gradient(135deg, #f1fbf2 0%, #fff 70%);
}

/* ── Shop-Logo (kein Netzwerk-Logo!) ── */
.tbsapc-offer__shop {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Clearbit / Google Logo */
.tbsapc-shop-logo {
    height: 28px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    flex-shrink: 0;
}

/* Name als Fallback wenn kein Logo */
.tbsapc-shop-name-text,
.tbsapc-shop-name-fallback {
    font-weight: 700;
    font-size: .85em;
    color: #1d2327;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f1;
    border-radius: 5px;
    padding: 5px 10px;
    min-width: 70px;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
}

/* ── Preis-Block ── */
.tbsapc-offer__pricing {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tbsapc-offer__price {
    font-weight: 800;
    font-size: 1.15em;
    color: #1d2327;
    display: flex;
    align-items: baseline;
    gap: 5px;
}
.tbsapc-currency {
    font-size: .72em;
    font-weight: 600;
    color: #888;
    background: #f0f0f1;
    padding: 1px 5px;
    border-radius: 3px;
}
.tbsapc-offer__delivery {
    font-size: .78em;
    color: #888;
}
.tbsapc-offer__delivery.tbsapc-free-shipping,
.tbsapc-offer__delivery:has(.tbsapc-free) {
    color: #3aa757;
}
.tbsapc-offer__total {
    font-size: .76em;
    color: #aaa;
}

/* ── CTA Button ── */
.tbsapc-offer__btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #555;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 5px;
    font-size: .83em;
    font-weight: 700;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.tbsapc-offer__btn:hover { background: #333; transform: translateY(-1px); }
.tbsapc-offer__btn--best { background: #2e7d32; }
.tbsapc-offer__btn--best:hover { background: #1b5e20; }
.tbsapc-arrow { font-size: 1em; }

/* ── Mehr anzeigen ── */
.tbsapc-show-more {
    background: none;
    border: 1.5px dashed #ddd;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    padding: 8px 14px;
    font-size: .82em;
    width: 100%;
    margin-top: 2px;
    transition: background .15s, border-color .15s;
    text-align: center;
}
.tbsapc-show-more:hover { background: #f5f5f5; border-color: #bbb; }

.tbsapc-more-offers {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

/* ── Disclaimer ── */
.tbsapc-disclaimer {
    margin: 10px 0 0;
    font-size: .74em;
    color: #bbb;
    line-height: 1.4;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .tbsapc-offer {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .tbsapc-offer__shop { justify-content: flex-start; }
    .tbsapc-offer__btn  { width: 100%; justify-content: center; }
    .tbsapc-shop-logo   { max-width: 90px; }
}

/* ── Grundpreis (PAngV) ── */
.tbsapc-offer__grundpreis {
    font-size: .72em;
    color: #777;
    display: block;
    margin-top: 1px;
}

/* ── eBay Auktion / Festpreis Badges ───────────────────────── */
.tbsapc-ebay-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;
}
.tbsapc-ebay-badge--auction {
    background: #e53935;
    color: #fff;
}
.tbsapc-ebay-badge--fixed {
    background: #3aa757;
    color: #fff;
}
.tbsapc-ebay-badge--ended {
    background: #888;
    color: #fff;
}
.tbsapc-ebay-countdown {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
    line-height: 1.4;
}
.tbsapc-ebay-countdown--ending {
    background: #ffebee;
    color: #c62828;
    border-color: #ef5350;
    animation: tbsapc-pulse 1s infinite;
}
@keyframes tbsapc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ── Versandkosten Sonderstile ─────────────────────────────────── */
.tbsapc-shipping-unknown {
    display: inline-block;
    font-weight: 600;
    color: #b07a00;
    background: #fff8e1;
    border: 1px solid #ffd54f;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
}
.tbsapc-free-shipping-badge {
    display: inline-block;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    background: #00ff88;
    color: #003322;
    border: 1px solid #00cc6a;
    box-shadow: 0 0 8px rgba(0, 255, 140, 0.55), inset 0 0 4px rgba(255,255,255,0.6);
    text-shadow: 0 0 2px rgba(255,255,255,0.5);
    animation: tbsapc-neon-pulse 2.4s ease-in-out infinite;
}
@keyframes tbsapc-neon-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 140, 0.55), inset 0 0 4px rgba(255,255,255,0.6); }
    50%      { box-shadow: 0 0 14px rgba(0, 255, 140, 0.9),  inset 0 0 6px rgba(255,255,255,0.85); }
}
