/**
 * CartSetup Floating UI Styles
 *
 * CSS CUSTOM PROPERTIES (z-index stack):
 *   All z-index values come from PHP constants injected via UPSELLMAX.Z.
 *   CSS variables are set on :root by floating-ui.js at initialisation.
 *   Rule: No z-index literal may appear in this file.
 *   @see constants.php — UPSELLMAX_Z_* definitions
 *   @see Section 9.5 — Z-Index Stack
 *   @see Section 16.3 — "No z-index literal in CSS or JS"
 *
 * RESPONSIVE BREAKPOINTS:
 *   Mobile  < 768px  → drawer as bottom sheet
 *   Tablet  768–1024px → drawer at 380px width
 *   Desktop > 1024px → drawer at 420px width
 *   @see Section 18.1 — Responsive behaviour
 *
 * @package UpsellMax\CartSetup
 * @see     Section 12 — CSS asset owned by floating-ui layer
 */

/* ── Custom properties (set by floating-ui.js from UPSELLMAX.Z) ─────────── */
:root {
    --umscs-z-capture-bg:      var(--umscs-z-capture-bg-val,     9999995);
    --umscs-z-capture-ring:    var(--umscs-z-capture-ring-val,   9999996);
    --umscs-z-drawer:          var(--umscs-z-drawer-val,         9999997);
    --umscs-z-capture-confirm: var(--umscs-z-capture-confirm-val,9999998);
    --umscs-z-admin-modal:     var(--umscs-z-admin-modal-val,    9999999);

    /* Design tokens */
    --umscs-drawer-width:        420px;
    --umscs-drawer-width-tablet: 380px;
    --umscs-color-primary:       #1a73e8;
    --umscs-color-surface:       #ffffff;
    --umscs-color-overlay:       rgba(0,0,0,0.45);
    --umscs-radius:              12px;
    --umscs-shadow:              0 8px 40px rgba(0,0,0,0.18);
    --umscs-transition:          0.3s cubic-bezier(0.4,0,0.2,1);
    --umscs-font:                -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Floating Cart Button ──────────────────────────────────────────────── */
.um-floating-cart {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--umscs-z-drawer);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--umscs-color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--umscs-shadow);
    transition: transform var(--umscs-transition), opacity var(--umscs-transition);
    user-select: none;
    border: none;
    padding: 0;
}

.um-floating-cart:hover {
    transform: scale(1.08);
}

.um-floating-cart:focus-visible {
    outline: 3px solid var(--umscs-color-primary);
    outline-offset: 3px;
}

.um-floating-cart svg {
    width: 24px;
    height: 24px;
}

.um-floating-cart__count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    padding: 0 4px;
    font-family: var(--umscs-font);
    pointer-events: none;
}

.um-floating-cart--hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* ── Admin bar offset ─────────────────────────────────────────────────── */
/* Applied by floating-ui.js after measuring actual admin bar height.    */
/* @see Section 9.1 — getOffset() admin bar measurement                  */
.admin-bar .um-floating-cart {
    bottom: 24px; /* JS overrides bottom based on layout */
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .um-floating-cart {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
}
