/*
 * Magic Order Bump — Frontend styles
 *
 * The --mobump-accent CSS custom property is set dynamically via
 * wp_add_inline_style() in includes/frontend.php using the value
 * saved in the plugin settings. The fallback here is only used if
 * the inline style block is somehow missing.
 *
 * @package Mobump
 */

:root {
    --mobump-accent: #f59e0b;
}

/* ── Bump container ──────────────────────────────────────────────────────── */

#mobump-bump {
    display: none; /* shown via .mobump-visible */
    position: absolute;
    z-index: 20;
    box-sizing: border-box;
    border: 2px dashed var(--mobump-accent);
    border-radius: 10px;
    padding: 16px 18px;
    background: #fffdf5;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
    user-select: none;
}

#mobump-bump.mobump-visible {
    display: flex;
}

#mobump-bump:hover {
    background: #fff8e1;
}

#mobump-bump.mobump-checked {
    background: #f0fdf4;
    border-color: #16a34a;
    border-style: solid;
}

#mobump-bump.mobump-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Checkbox indicator ──────────────────────────────────────────────────── */

.mobump-check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid #d1d5db;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: background 0.2s, border-color 0.2s;
    background: #fff;
    flex-shrink: 0;
}

#mobump-bump.mobump-checked .mobump-check {
    background: #16a34a;
    border-color: #16a34a;
}

.mobump-check svg {
    display: none;
}

#mobump-bump.mobump-checked .mobump-check svg {
    display: block;
}

/* ── Product thumbnail ───────────────────────────────────────────────────── */

.mobump-img {
    width: 72px;
    height: 72px;
    min-width: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    align-self: center;
    flex-shrink: 0;
}

/* ── Text content ────────────────────────────────────────────────────────── */

.mobump-body {
    flex: 1;
    min-width: 0;
}

.mobump-title {
    font-weight: 700;
    font-size: 15px;
    color: #111;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.mobump-badge {
    background: var(--mobump-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.mobump-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

/* ── Inline error message ────────────────────────────────────────────────── */

.mobump-error {
    margin-top: 6px;
    font-size: 12px;
    color: #dc2626;
    display: none;
}

#mobump-bump.mobump-has-error .mobump-error {
    display: block;
}
