/*
 * Smart Bundle — promo "Build Your Bundle"
 * Loaded only on single download (product) pages.
 * Tiers source: wp-content/themes/hornet-wp/checkout_cart.php
 *   - Trigger: 2+ paid plugins AND €10+ subtotal
 *   - 40% (€10+), 45% (€25+), 50% (€50+), 55% (€100+),
 *     60% (€150+), 65% (€200+), 70% max (€300+)
 */

/* ---------- Inline badge (next to Add to Cart) ---------- */
.smart-bundle-badge {
    display: inline-block;
    background: rgb(255, 206, 67);
    color: #000;
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 14px;
    border: 3px solid #000;
    box-shadow: 3px 3px 0px #000;
    margin: 6px 0 0;
    text-decoration: none;
    line-height: 1.2;
    vertical-align: middle;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.smart-bundle-badge:hover,
.smart-bundle-badge:focus {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px #000;
    background: rgb(255, 67, 205);
    color: #000;
    text-decoration: none;
}

/* ---------- Compact line with hover popup ---------- */
.smart-bundle-info {
    position: relative;
    margin: 8px auto 16px;
    max-width: 100%;
    text-align: center;
}

.smart-bundle-info .sbi-title {
    display: inline-block;
    background: rgb(67, 205, 255);
    color: #000;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    padding: 10px 16px;
    border: 3px solid #000;
    box-shadow: 4px 4px 0px #000;
}

.smart-bundle-info .sbi-more {
    color: #000;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    cursor: pointer;
    font-weight: 700;
    margin-left: 4px;
}

.smart-bundle-info .sbi-more:hover,
.smart-bundle-info .sbi-more:focus {
    color: rgb(255, 67, 205);
    outline: none;
}

/* Popup: hidden by default, appears on hover/focus */
.smart-bundle-info .sbi-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 4px solid #000;
    padding: 18px;
    width: max-content;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 6px 6px 0px #000;
    z-index: 50;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

/* Arrow above popup */
.smart-bundle-info .sbi-popup::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-bottom-color: #000;
}

.smart-bundle-info .sbi-popup::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 7px solid transparent;
    border-bottom-color: #fff;
}

/* Show popup on hover of the wrapper, or focus on "more..." */
.smart-bundle-info:hover .sbi-popup,
.smart-bundle-info:focus-within .sbi-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.smart-bundle-info .sbi-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 12px;
    font-size: 13px;
}

.smart-bundle-info .sbi-table th,
.smart-bundle-info .sbi-table td {
    border: 2px solid #000;
    padding: 8px 10px;
    text-align: center;
    color: #000;
}

.smart-bundle-info .sbi-table th {
    background: rgb(67, 205, 255);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
}

.smart-bundle-info .sbi-table td.sbi-trigger {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.smart-bundle-info .sbi-table td.sbi-pct {
    font-weight: 900;
    background: rgb(255, 206, 67);
    white-space: nowrap;
}

.smart-bundle-info .sbi-table td.sbi-max {
    background: rgb(255, 67, 205);
    font-weight: 900;
    white-space: nowrap;
}

.smart-bundle-info .sbi-tip {
    background: rgb(67, 205, 255);
    border: 2px solid #000;
    padding: 8px 12px;
    margin: 0;
    text-align: center;
    font-weight: 600;
    color: #000;
    font-size: 12px;
    line-height: 1.4;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .smart-bundle-badge {
        font-size: 12px;
        padding: 6px 10px;
        letter-spacing: 0;
        margin: 8px 0 0;
    }
    .smart-bundle-info .sbi-title {
        font-size: 13px;
    }
    .smart-bundle-info .sbi-popup {
        min-width: 280px;
        padding: 14px;
        left: 0;
        transform: none;
        /* On touch devices hover doesn't work — show inline below */
        position: static;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        margin-top: 12px;
        box-shadow: 4px 4px 0px #000;
    }
    .smart-bundle-info .sbi-popup::before,
    .smart-bundle-info .sbi-popup::after {
        display: none;
    }
    .smart-bundle-info .sbi-table {
        font-size: 12px;
    }
    .smart-bundle-info .sbi-table th,
    .smart-bundle-info .sbi-table td {
        padding: 7px 8px;
    }
}

/* Touch devices (no hover capability): always show popup inline */
@media (hover: none) {
    .smart-bundle-info .sbi-popup {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        margin-top: 12px;
        left: auto;
    }
    .smart-bundle-info .sbi-popup::before,
    .smart-bundle-info .sbi-popup::after {
        display: none;
    }
}