/* ==========================================================================
   Subscribe & Save on the guest menu (all tiers). Loaded by lib/sub-menu.php.

   Inside the item sheet everything uses the tier's own .ent-sheet tokens (--ent-*, from that tier's cart.css),
   and the order-type rows reuse the sheet's .ent-option markup, so Starter/Premium (dark + orange),
   Platinum (light + yellow) and Enterprise (dark + gold) each look native.
   Outside the sheet (menu chips, plan bar, toast) js/sub-menu.js copies those same tokens onto :root as --sub-*.
   ========================================================================== */

:root {
    --sub-bg: #1e2023;
    --sub-surface: #282b2f;
    --sub-line: rgba(255, 255, 255, .09);
    --sub-text: #f2f2f0;
    --sub-muted: #9da2a9;
    --sub-accent: #f26b38;
    --sub-on-accent: #ffffff;
}

/* --------------------------------------------------------------------------
   Item sheet: order type + frequency
-------------------------------------------------------------------------- */
.ent-sheet .sub-options[hidden],
.ent-sheet .sub-freq-wrap[hidden] {
    display: none;
}

.ent-sheet .sub-options-head em.sub-save {
    background: color-mix(in srgb, var(--ent-accent) 18%, transparent);
    color: var(--ent-accent);
}

.ent-sheet .sub-options .ent-option-name small {
    line-height: 1.35;
}

.ent-sheet .sub-options .ent-option-price s {
    margin-right: 6px;
    color: var(--ent-muted);
    font-weight: 400;
}

.ent-sheet .sub-freq-wrap {
    margin-top: 14px;
}

.ent-sheet .sub-freq-label {
    display: block;
    margin-bottom: 8px;
    color: var(--ent-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ent-sheet .sub-freqs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ent-sheet .sub-freq {
    position: relative;
    margin: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ent-sheet .sub-freq input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ent-sheet .sub-freq span {
    display: inline-block;
    padding: 9px 16px;
    border: 1.5px solid var(--ent-line);
    border-radius: 999px;
    background: var(--ent-surface);
    color: var(--ent-text);
    font-size: 14px;
    font-weight: 600;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.ent-sheet .sub-freq input:checked + span {
    border-color: var(--ent-accent);
    background: var(--ent-accent);
    color: var(--ent-on-accent);
}

.ent-sheet .sub-freq input:focus-visible + span {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ent-accent) 35%, transparent);
}

.ent-sheet .sub-note {
    display: flex;
    gap: 8px;
    margin: 12px 0 0;
    color: var(--ent-muted);
    font-size: 12px;
    line-height: 1.5;
}

.ent-sheet .sub-note i {
    margin-top: 2px;
    color: var(--ent-accent);
}

/* --------------------------------------------------------------------------
   Floating plan bar
-------------------------------------------------------------------------- */
.sub-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 1029;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
    padding: 10px 10px 10px 16px;
    border: 1px solid var(--sub-line);
    border-radius: 16px;
    background: var(--sub-bg);
    color: var(--sub-text);
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    animation: subBarIn .25s ease-out;
}

.sub-bar:hover,
.sub-bar:focus {
    color: var(--sub-text);
    text-decoration: none;
}

/* Enterprise has its own cart button bottom-right: keep clear of it. */
.has-cart-fab .sub-bar {
    right: 92px;
    margin: 0;
}

.sub-bar-icon {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--sub-accent) 18%, transparent);
    color: var(--sub-accent);
}

.sub-bar-text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3;
}

.sub-bar-text b {
    display: block;
    font-weight: 700;
}

.sub-bar-text small {
    color: var(--sub-muted);
    font-size: 12px;
}

.sub-bar-cta {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--sub-accent);
    color: var(--sub-on-accent);
    font-weight: 700;
    white-space: nowrap;
}

@keyframes subBarIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Toast (only when the tier has no toast helper of its own)
-------------------------------------------------------------------------- */
.sub-toast {
    position: fixed;
    left: 50%;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--sub-line);
    border-radius: 999px;
    background: var(--sub-bg);
    color: var(--sub-text);
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    transform: translateX(-50%);
    animation: subBarIn .2s ease-out;
}

.sub-toast i {
    color: var(--sub-accent);
}
