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

/* Gemeinsame, von Childthemes überschreibbare Produktseiten-Basis. */
.tbsapc-product-page {
    --tbs-product-bg: #070b1b;
    --tbs-product-panel: #11172b;
    --tbs-product-panel-soft: #171d33;
    --tbs-product-text: #f7f8fc;
    --tbs-product-accent: #25d9ee;
    --tbs-product-accent-2: #db28d7;
    --tbs-product-price: #70f56f;
    --tbs-product-border: rgba(37, 217, 238, .26);
    margin: 0;
    background: var(--tbs-product-bg);
    color: var(--tbs-product-text);
}
.tbsapc-product-page :where(main,.site-main,#main,#primary,.content-area){width:min(calc(100% - 32px),1480px)!important;max-width:1480px!important;margin-inline:auto!important}
/*
 * Affiliate product pages need the full content width. Several supported
 * themes reserve a 350px sidebar and then create another two-column product
 * grid inside the remaining space. Long product names and prices consequently
 * collapse into a column only a few characters wide. Hide that secondary
 * sidebar only on plugin product pages and make the content column explicit.
 */
.tbsapc-product-page :where(.content-layout){display:block!important;width:100%!important;max-width:none!important}
.tbsapc-product-page :where(.content-layout > .content-area){width:100%!important;max-width:none!important}
.tbsapc-product-page :where(.content-layout > .widget-area,.content-layout > aside){display:none!important}
.tbsapc-product-page :where(.woocommerce-notices-wrapper,.woocommerce div.product){width:100%!important;max-width:1420px!important;margin-inline:auto!important}
.tbsapc-product-page :where(.woocommerce div.product){display:grid!important;grid-template-columns:minmax(280px,.85fr) minmax(0,1.15fr)!important;gap:clamp(24px,4vw,64px)!important;padding:clamp(20px,4vw,52px);border:1px solid var(--tbs-product-border);border-radius:24px;background:linear-gradient(145deg,var(--tbs-product-panel-soft),var(--tbs-product-panel));color:var(--tbs-product-text);box-shadow:0 24px 70px rgba(0,0,0,.24)}
.tbsapc-product-page :where(.woocommerce div.product .woocommerce-product-gallery,.woocommerce div.product .summary){float:none!important;width:auto!important;min-width:0!important;max-width:100%!important;margin:0!important;box-sizing:border-box}
.tbsapc-product-page :where(.woocommerce div.product .woocommerce-tabs,.woocommerce div.product .related,.woocommerce div.product .upsells,.woocommerce div.product .tbsapc-matched-products){grid-column:1/-1!important;width:100%!important;min-width:0!important}
.tbsapc-product-page :where(div.product h1,div.product h2,div.product h3,div.product p,div.product label){color:inherit}
.tbsapc-product-page :where(div.product .product_title){max-width:100%!important;font-size:clamp(1.75rem,3vw,3.25rem)!important;line-height:1.08!important;overflow-wrap:anywhere!important;word-break:normal!important;hyphens:auto}
.tbsapc-product-page :where(div.product .price){display:block!important;max-width:100%!important;color:var(--tbs-product-price);font-size:clamp(1.25rem,2.5vw,1.7rem)!important;font-weight:800;line-height:1.25!important;overflow-wrap:normal!important;word-break:normal!important;white-space:normal!important}
.tbsapc-product-page :where(div.product img){max-width:100%;height:auto;max-height:620px;object-fit:contain;border-radius:16px}
.tbsapc-product-page :where(div.product .button,div.product button,div.product input[type="submit"]){display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:11px 20px;border:0;border-radius:999px;background:linear-gradient(90deg,var(--tbs-product-accent-2),var(--tbs-product-accent));color:#07101c;font-weight:800;text-decoration:none}
.tbsapc-product-page :where(.woocommerce-tabs,.related,.upsells){clear:both;padding-top:32px}
.tbsapc-product-page :where(.related ul.products,.upsells ul.products){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin:0;padding:0}
.tbsapc-product-page :where(.related li.product,.upsells li.product){float:none;width:auto;min-width:0;margin:0;padding:18px;border:1px solid var(--tbs-product-border);border-radius:18px;background:rgba(255,255,255,.035)}
.tbsapc-product-page :where(.related li.product img,.upsells li.product img){width:100%;aspect-ratio:4/3;object-fit:contain;background:rgba(0,0,0,.18)}
@media(max-width:900px){.tbsapc-product-page :where(.woocommerce div.product){grid-template-columns:minmax(0,1fr)!important}.tbsapc-product-page :where(.woocommerce div.product .woocommerce-product-gallery){width:min(100%,760px)!important;margin-inline:auto!important}}
@media(max-width:760px){.tbsapc-product-page :where(main,.site-main,#main,#primary,.content-area){width:min(calc(100% - 20px),1480px)!important}.tbsapc-product-page :where(.related ul.products,.upsells ul.products){grid-template-columns:1fr}}
.tbsapc-energy{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0 18px}.tbsapc-energy__class{display:inline-flex;align-items:center;gap:10px;color:#172033!important;text-decoration:none!important}.tbsapc-energy__class strong{display:grid;place-items:center;width:46px;height:36px;clip-path:polygon(0 0,76% 0,100% 50%,76% 100%,0 100%);background:#65b94c;font-size:1.2rem}.tbsapc-energy__class span{font-size:.82rem;font-weight:700;color:inherit}.tbsapc-energy__class--a strong{background:#00a651}.tbsapc-energy__class--b strong{background:#50b848}.tbsapc-energy__class--c strong{background:#bfd730}.tbsapc-energy__class--d strong{background:#fff200}.tbsapc-energy__class--e strong{background:#fdb913}.tbsapc-energy__class--f strong{background:#f36f21}.tbsapc-energy__class--g strong{background:#ed1c24;color:#fff}.tbsapc-energy__sheet{font-size:.85rem;font-weight:700}.tbsapc-energy-missing,.tbsapc-energy-price-blocked{display:block;padding:9px 12px;border:1px solid #d97706;border-radius:8px;background:#fff7ed;color:#9a3412!important;font-size:.82rem;font-weight:700}.tbsapc-energy-missing a{color:inherit!important;text-decoration:underline}.tbsapc-energy--compact{margin:7px 0}.tbsapc-energy--compact .tbsapc-energy__class strong{width:38px;height:30px}

.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: 18px;
    width: auto;
    max-width: 72px;
    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: 60px; }
}

/* ── 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); }
}

/* Emoji/Icons im Widget-Header auf exakt 16px begrenzen */
.tbsapc-widget h4 img,
.tbsapc-widget h4 img.emoji,
img.emoji[src*="s.w.org"] {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    vertical-align: middle;
    display: inline-block !important;
}

/* ── Affiliate-Variantenauswahl ─────────────────────────────────── */
.tbsapc-variant-selector {
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid rgba(126, 184, 247, .35);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}

.tbsapc-variant-selector__title {
    margin-bottom: 8px;
    color: #fff;
    font-weight: 700;
    line-height: 1.35;
}

.tbsapc-variant-selector__label {
    display: block;
    margin-bottom: 5px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.tbsapc-variant-selector__select {
    width: 100%;
    min-height: 42px;
    padding: 8px 34px 8px 10px;
    border: 1px solid #3a7bd5;
    border-radius: 6px;
    background: #fff;
    color: #172033;
    font-size: 14px;
    cursor: pointer;
}

.tbsapc-variant-selector__select:focus {
    outline: 2px solid #7eb8f7;
    outline-offset: 2px;
}

.tbsapc-variant-selector__current {
    margin-top: 7px;
    color: #7eb8f7;
    font-size: 12px;
    font-weight: 600;
}

.tbsapc-variant-selector__note {
    margin: 7px 0 0;
    color: #aeb9ca;
    font-size: 11px;
    line-height: 1.45;
}
