/* ==========================================================================
   Ascotech Second License Bump - Modern Upsell Card Design
   ========================================================================== */

/* 1. Ensure WooCommerce add-to-cart form wraps children cleanly */
.single-product form.cart,
.woocommerce div.product form.cart,
form.cart:has(.custom-license-bump) {
    flex-wrap: wrap !important;
}

/* 2. Main Bump Card Container */
.custom-license-bump {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    box-sizing: border-box !important;
    margin: 18px 0 22px 0 !important;
    padding: 14px 16px !important;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-family: var(--display-font, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.custom-license-bump:hover {
    border-color: #cbd5e1;
    background-color: #fafbfc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Active / Checked State */
.custom-license-bump:has(input[type="checkbox"]:checked),
.custom-license-bump.is-checked {
    border-color: #ea1b25 !important;
    background: linear-gradient(180deg, #fffcfc 0%, #fff7f7 100%) !important;
    box-shadow: 0 4px 14px rgba(234, 27, 37, 0.08), 0 0 0 1px #ea1b25 !important;
}

/* 3. Clickable Label Wrapper */
.bump-container {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    cursor: pointer;
    user-select: none;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

/* 4. Custom Checkbox */
.bump-checkbox-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.bump-checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.bump-custom-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    background-color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    pointer-events: none;
}

.bump-check-icon {
    width: 12px;
    height: 10px;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Checkbox Checked & Focus States */
.bump-container input[type="checkbox"]:checked + .bump-custom-checkbox,
.custom-license-bump.is-checked .bump-custom-checkbox {
    background-color: #ea1b25;
    border-color: #ea1b25;
    box-shadow: 0 2px 6px rgba(234, 27, 37, 0.35);
}

.bump-container input[type="checkbox"]:checked + .bump-custom-checkbox .bump-check-icon,
.custom-license-bump.is-checked .bump-custom-checkbox .bump-check-icon {
    opacity: 1;
    transform: scale(1);
}

.bump-container input[type="checkbox"]:focus-visible + .bump-custom-checkbox {
    outline: 2px solid #ea1b25;
    outline-offset: 2px;
}

/* 5. Bump Content Area */
.bump-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.bump-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.bump-title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.bump-icon-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #fef3c7;
    color: #d97706;
    font-size: 11px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.15);
}

.bump-title {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.35;
}

.bump-title strong {
    font-weight: 700;
    color: #0f172a;
}

/* 6. Discount Badge */
.bump-badge {
    background-color: #ecfdf5;
    color: #15803d;
    border: 1px solid #bbf7d0;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* 7. Pricing Display */
.bump-pricing {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 1px;
}

.bump-price-prefix,
.bump-price-separator,
.bump-price-suffix {
    color: #475569;
}

.bump-price-highlight {
    color: #ea1b25;
    font-weight: 700;
    font-size: 13.5px;
}

.bump-price-highlight .woocommerce-Price-amount {
    color: #ea1b25 !important;
    font-weight: 700 !important;
}

.bump-old-price del {
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
    font-size: 12.5px;
}

.bump-old-price .woocommerce-Price-amount {
    color: #94a3b8 !important;
    text-decoration: line-through !important;
}

/* 8. Mobile Responsiveness */
@media (max-width: 480px) {
    .custom-license-bump {
        padding: 12px 14px !important;
        margin: 14px 0 18px 0 !important;
    }
    .bump-container {
        gap: 10px;
    }
    .bump-title {
        font-size: 13px;
    }
    .bump-pricing {
        font-size: 12.5px;
    }
}

/* 9. Disabled State (when already in cart - max 1 per order) */
.custom-license-bump.is-disabled {
    opacity: 0.8;
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    cursor: default !important;
}

.custom-license-bump.is-disabled label {
    cursor: default !important;
}

.bump-badge-in-cart {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

.bump-already-added-note {
    font-size: 12.5px;
    color: #64748b;
    font-style: italic;
}
