/* ═══════════════════════════════════════════════════════════════════
   Font License Manager — Frontend Styles v1.0.0
   Theme-agnostic: uses currentColor / inherit where possible.
   Tested: WooCommerce default, Breakdance Builder (dark / light).
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────────────── */
.flm-selector {
    --flm-accent:      #4E19CD;
    --flm-accent-rgb:  78, 25, 205;
    --flm-border:      rgba(128,128,128,.18);
    --flm-muted:       rgba(128,128,128,.5);
    --flm-radius:      6px;
    --flm-transition:  .15s ease;
    width: 100%;
    margin-bottom: 1.5em;
    font-family: inherit;
    box-sizing: border-box;
}
.flm-selector *, .flm-selector *::before, .flm-selector *::after {
    box-sizing: inherit;
}

/* ── Discount Badge ───────────────────────────────────────────────── */
.flm-discount-badge {
    display: flex;
    align-items: center;
    gap: .65em;
    background: var(--flm-accent);
    color: #fff;
    padding: 9px 16px;
    border-radius: var(--flm-radius);
    margin-bottom: 18px;
    font-size: .875em;
    line-height: 1.4;
}
.flm-discount-pct  { font-weight: 800; font-size: 1.05em; white-space: nowrap; letter-spacing: .02em; }
.flm-discount-desc { opacity: .9; }

/* ── Internal Price Display ───────────────────────────────────────── */
.flm-price-display {
    min-height: 1.8em;
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 18px;
}
.flm-price-placeholder  { font-size: .7em; font-weight: 400; opacity: .55; font-style: italic; }
.flm-price-display del  { opacity: .45; font-size: .78em; font-weight: 400; margin-right: .35em; text-decoration: line-through; }
.flm-price-display ins  { text-decoration: none; color: inherit; }

/* ── License Row ──────────────────────────────────────────────────── */
.flm-license-row {
    display: flex;
    flex-direction: column;
    gap: .55em;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--flm-border);
}
.flm-license-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.flm-row-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
}

/* ── Custom Checkbox ──────────────────────────────────────────────── */
.flm-checkbox-label {
    display: flex;
    align-items: center;
    gap: .7em;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    /* reset WP/WC label overrides */
    margin: 0 !important;
    padding: 0 !important;
    font-weight: normal !important;
}

/* Hide native checkbox — accessibility preserved via label[for] */
.flm-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.flm-checkmark {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border: 2px solid var(--flm-muted);
    border-radius: 4px;
    background: transparent;
    transition: background var(--flm-transition), border-color var(--flm-transition);
    position: relative;
}
.flm-checkmark::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px,-1px);
    opacity: 0;
    transition: opacity .1s ease;
}
.flm-checkbox:checked ~ .flm-checkmark {
    background: var(--flm-accent);
    border-color: var(--flm-accent);
}
.flm-checkbox:checked ~ .flm-checkmark::after { opacity: 1; }
.flm-checkbox:focus-visible ~ .flm-checkmark { outline: 2px solid var(--flm-accent); outline-offset: 2px; }

.flm-label-text { font-size: 1em; font-weight: 600; line-height: 1.3; }

/* ── Per-License Price Column ─────────────────────────────────────── */
.flm-price-col {
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: .35em;
}
.flm-price-col .woocommerce-Price-amount { font-weight: 700; }
.flm-price-regular { opacity: .5; font-size: .85em; text-decoration: line-through; }
.flm-price-sale    { text-decoration: none; font-weight: 700; }

/* ── Seat Quantity ────────────────────────────────────────────────── */
.flm-seats-wrap {
    display: flex;
    align-items: center;
    gap: .75em;
    padding-left: 2.1em; /* indent under checkbox */
}
.flm-seats-label { font-size: .875em; opacity: .65; white-space: nowrap; }

.flm-qty {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 130px !important;
    max-width: 130px !important;
    border: 1px solid var(--flm-border) !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    background: rgba(128,128,128,.08) !important;
}

.flm-qty-btn {
    flex-shrink: 0 !important;
    width: 36px !important;
    height: 36px !important;
    background: transparent !important;
    color: inherit !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 1.1em !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: background var(--flm-transition) !important;
}
.flm-qty-btn:hover { background: rgba(var(--flm-accent-rgb),.12) !important; }

.flm-qty-input {
    flex: 1 !important;
    width: 0 !important; /* flex will size it */
    min-width: 0 !important;
    height: 36px !important;
    text-align: center !important;
    background: transparent !important;
    color: inherit !important;
    border: none !important;
    border-left:  1px solid var(--flm-border) !important;
    border-right: 1px solid var(--flm-border) !important;
    padding: 0 !important;
    font-size: .95em !important;
    -moz-appearance: textfield !important;
}
.flm-qty-input::-webkit-outer-spin-button,
.flm-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ═══════════════════════════════════════════════════════════════════
   TERMS PANEL
   ═══════════════════════════════════════════════════════════════════ */
.flm-terms-panel {
    margin-top: 18px;
    border: 1px solid rgba(var(--flm-accent-rgb), .3);
    border-radius: var(--flm-radius);
    overflow: hidden;
}
.flm-terms-inner { padding: 16px 18px; }

/* Header — single */
.flm-terms-header--single {
    display: flex;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--flm-border);
}
.flm-terms-title { font-weight: 700; font-size: .95em; }

/* Header — multi (badge row) */
.flm-terms-header--multi {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--flm-border);
}
.flm-terms-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(var(--flm-accent-rgb), .1);
    border: 1px solid rgba(var(--flm-accent-rgb), .25);
    border-radius: 20px;
    font-size: .75em;
    font-weight: 600;
    color: var(--flm-accent);
}

/* Per-license section (multi) */
.flm-terms-section { margin-bottom: 14px; }
.flm-terms-section:last-child { margin-bottom: 0; }
.flm-terms-section-label {
    font-size: .75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .55;
    margin-bottom: 7px;
}

/* Terms list */
.flm-terms-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
}
@media (min-width: 460px) {
    .flm-terms-list { grid-template-columns: 1fr 1fr; }
}
.flm-terms-list li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: .85em;
    line-height: 1.45;
    margin: 0;
    padding: 0;
}
.flm-terms-list li::before {
    content: '✓';
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    font-size: .65em;
    font-weight: 900;
    color: #fff;
    background: var(--flm-accent);
    border-radius: 50%;
    margin-top: .15em;
    line-height: 1;
}

.flm-terms-empty { font-size: .85em; opacity: .5; font-style: italic; margin: 0; }

/* Discount note inside panel */
.flm-terms-discount-note {
    margin-top: 14px;
    padding: 9px 13px;
    background: rgba(var(--flm-accent-rgb), .07);
    border-left: 3px solid var(--flm-accent);
    border-radius: 0 4px 4px 0;
    font-size: .82em;
    font-weight: 600;
    color: var(--flm-accent);
}

/* ── "Learn more" link ────────────────────────────────────────────── */
.flm-license-link {
    margin-top: 10px;
    font-size: .82em;
    opacity: .75;
}
.flm-license-link a { color: inherit; }
.flm-license-link a:hover { opacity: 1; }

/* ── Archive / loop card "from" label ─────────────────────────────── */
.flm-from-label { font-size: .8em; opacity: .65; font-weight: 400; margin-right: .2em; }

/* ── Cart qty ─────────────────────────────────────────────────────── */
.flm-cart-qty { font-weight: 700; }

/* ── WooCommerce native price (single product) ───────────────────── */
.summary .price del,
.entry-summary .price del { opacity: .5; }
.summary .price ins,
.entry-summary .price ins { text-decoration: none; }
