/**
 * McLean Free Shipping Bar
 * @version 1.0.1
 *
 * Every rule is !important and every class is mclean-fs- prefixed on purpose:
 * the bar renders inside .mclean-cart-wrapper and .mclean-checkout-wrapper, both of
 * which run an `all: unset !important` Elementor reset on every button, a and input
 * they contain. Anything not fully re-declared with !important arrives unstyled.
 *
 * Track/fill follow the house progress-bar idiom established in mclean-compatibility:
 * gold fill on a dark track with a 0.4s width transition.
 */

.mclean-fs {
    /* Self-contained tokens - the bar renders in three different wrappers and must
       not depend on whichever :root block happens to be in scope. */
    --mfs-gold: #fcb316;
    --mfs-gold-glow: rgba(252, 179, 22, 0.15);
    --mfs-success: #22c55e;
    --mfs-bg-card: #141414;
    --mfs-bg-track: #222222;
    --mfs-border: #2a2a2a;
    --mfs-text: #ffffff;
    --mfs-text-secondary: #b0b0b0;

    display: block !important;
    box-sizing: border-box !important;
    margin: 0 0 1.25rem 0 !important;
    padding: 1rem !important;
    background: var(--mfs-bg-card) !important;
    border: 1px solid var(--mfs-border) !important;
    border-radius: 12px !important;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.mclean-fs *,
.mclean-fs *::before,
.mclean-fs *::after {
    box-sizing: border-box !important;
}

/* ---------------------------------------------------------------- message */

.mclean-fs .mclean-fs-msg {
    display: block !important;
    margin: 0 0 0.625rem 0 !important;
    padding: 0 !important;
    color: var(--mfs-text-secondary) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
}

.mclean-fs .mclean-fs-msg strong {
    color: var(--mfs-gold) !important;
    font-weight: 700 !important;
}

/* wc_price() emits its own markup - keep it inheriting the gold. */
.mclean-fs .mclean-fs-msg .woocommerce-Price-amount,
.mclean-fs .mclean-fs-msg .woocommerce-Price-currencySymbol {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

.mclean-fs .mclean-fs-check {
    display: inline-block !important;
    margin-right: 0.375rem !important;
    color: var(--mfs-success) !important;
    font-weight: 700 !important;
}

.mclean-fs.is-qualified .mclean-fs-msg strong {
    color: var(--mfs-success) !important;
}

/* ------------------------------------------------------------------ track */

.mclean-fs .mclean-fs-track {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--mfs-bg-track) !important;
    border: 0 !important;
    border-radius: 2px !important;
    overflow: hidden !important;
}

.mclean-fs .mclean-fs-fill {
    display: block !important;
    height: 100% !important;
    width: 0;
    background: var(--mfs-gold) !important;
    border-radius: 2px !important;
    transition: width 0.4s ease, background-color 0.3s ease !important;
}

.mclean-fs.is-qualified .mclean-fs-fill {
    background: var(--mfs-success) !important;
}

/* ------------------------------------------------------------ suggestions */

.mclean-fs .mclean-fs-suggest {
    display: block !important;
    margin-top: 1rem !important;
    padding-top: 0.875rem !important;
    border-top: 1px solid var(--mfs-border) !important;
}

.mclean-fs .mclean-fs-suggest-eyebrow {
    display: block !important;
    margin-bottom: 0.75rem !important;
    color: var(--mfs-gold) !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
}

.mclean-fs .mclean-fs-suggest-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
}

.mclean-fs .mclean-fs-item {
    display: grid !important;
    grid-template-columns: 48px 1fr auto !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.5rem !important;
    background: transparent !important;
    border: 1px solid var(--mfs-border) !important;
    border-radius: 8px !important;
    transition: border-color 0.15s ease, background-color 0.15s ease !important;
}

.mclean-fs .mclean-fs-item:hover {
    border-color: rgba(252, 179, 22, 0.4) !important;
    background: rgba(252, 179, 22, 0.03) !important;
}

.mclean-fs .mclean-fs-item-image {
    display: block !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    background: #0a0a0a !important;
}

.mclean-fs .mclean-fs-item-image img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 4px !important;
}

.mclean-fs .mclean-fs-item-info {
    min-width: 0 !important;
}

.mclean-fs .mclean-fs-item-name,
.mclean-fs a.mclean-fs-item-name {
    display: block !important;
    color: var(--mfs-text) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    /* Mount names are long ("QD Sling Mount Solutions - Picatinny Rail Mount with
       Swivel") and would otherwise blow the card height out. */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.mclean-fs a.mclean-fs-item-name:hover {
    color: var(--mfs-gold) !important;
}

.mclean-fs .mclean-fs-item-price {
    margin-top: 0.125rem !important;
    color: var(--mfs-gold) !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
}

.mclean-fs .mclean-fs-item-price .woocommerce-Price-amount,
.mclean-fs .mclean-fs-item-price .woocommerce-Price-currencySymbol,
.mclean-fs .mclean-fs-item-price bdi {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

/* Ghost-gold button, matching .mclean-cart-crosssell-btn.
   Fully re-declared: `all: unset !important` strips these elements bare. */
.mclean-fs .mclean-fs-item-btn,
.mclean-fs a.mclean-fs-item-btn,
.mclean-fs button.mclean-fs-item-btn {
    display: inline-block !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0.4rem 0.75rem !important;
    background: transparent !important;
    border: 1px solid var(--mfs-gold) !important;
    border-radius: 4px !important;
    color: var(--mfs-gold) !important;
    font-family: inherit !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: 0.08em !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease !important;
}

.mclean-fs .mclean-fs-item-btn:hover,
.mclean-fs a.mclean-fs-item-btn:hover,
.mclean-fs button.mclean-fs-item-btn:hover {
    background: var(--mfs-gold) !important;
    color: #0a0a0a !important;
    transform: translateY(-1px) !important;
}

.mclean-fs .mclean-fs-item-btn:focus-visible,
.mclean-fs button.mclean-fs-item-btn:focus-visible {
    outline: 2px solid var(--mfs-gold) !important;
    outline-offset: 2px !important;
}

.mclean-fs .mclean-fs-item-btn.is-busy,
.mclean-fs button.mclean-fs-item-btn.is-busy {
    opacity: 0.55 !important;
    pointer-events: none !important;
    cursor: default !important;
}

/* ------------------------------------------------------------------ error */

.mclean-fs .mclean-fs-error {
    display: block !important;
    margin-top: 0.625rem !important;
    padding: 0.5rem 0.75rem !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid #ef4444 !important;
    border-radius: 6px !important;
    color: #ef4444 !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

/* --------------------------------------------------------- context tweaks */

/* Checkout: sits at the top of the sticky order summary, which already has a
   gold-glow header directly above it, so drop the extra card chrome. */
.mclean-fs.mclean-fs--checkout {
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--mfs-border) !important;
    border-radius: 0 !important;
    padding: 1rem 1.25rem !important;
}

/* Mini-cart drawer: 420px wide and, critically, height-constrained.
   .mclean-mini-cart-footer is flex-shrink:0, so every pixel this bar adds pushes the
   View Cart / Checkout buttons down — enough cards and they leave the viewport
   entirely and the drawer has no way to check out. Everything below caps the bar's
   height so the CTAs always survive. */
.mclean-fs.mclean-fs--mini {
    margin: 0 !important;
    padding: 0.75rem 1rem !important;
    background: transparent !important;
    border: 0 !important;
    border-top: 1px solid var(--mfs-border) !important;
    border-radius: 0 !important;
}

.mclean-fs.mclean-fs--mini .mclean-fs-msg {
    margin-bottom: 0.5rem !important;
    font-size: 0.8rem !important;
}

.mclean-fs.mclean-fs--mini .mclean-fs-suggest {
    margin-top: 0.75rem !important;
    padding-top: 0.625rem !important;
}

.mclean-fs.mclean-fs--mini .mclean-fs-suggest-eyebrow {
    margin-bottom: 0.5rem !important;
    font-size: 0.65rem !important;
}

/* Hard ceiling. Two compact cards fit; anything beyond scrolls inside the bar
   rather than growing the footer. */
.mclean-fs.mclean-fs--mini .mclean-fs-suggest-grid {
    max-height: 120px !important;
    overflow-y: auto !important;
    gap: 0.375rem !important;
    -webkit-overflow-scrolling: touch !important;
}

.mclean-fs.mclean-fs--mini .mclean-fs-item-image {
    width: 36px !important;
    height: 36px !important;
}

.mclean-fs.mclean-fs--mini .mclean-fs-item {
    grid-template-columns: 36px 1fr auto !important;
    gap: 0.5rem !important;
    padding: 0.375rem !important;
}

.mclean-fs.mclean-fs--mini .mclean-fs-item-name {
    font-size: 0.72rem !important;
    -webkit-line-clamp: 1 !important;
}

.mclean-fs.mclean-fs--mini .mclean-fs-item-price {
    font-size: 0.72rem !important;
}

.mclean-fs.mclean-fs--mini .mclean-fs-item-btn,
.mclean-fs.mclean-fs--mini button.mclean-fs-item-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.65rem !important;
}

/* Short viewports: drop the cards and keep only the progress message. The checkout
   button matters more than an upsell.
   820px, not 700px: at 720px tall the CTA cleared the fold by only 20px, and the
   footer grows further whenever a coupon or kit-discount row is present. Common
   laptop heights (720/768/800) all sit in that danger band. Tall phones (844/932)
   keep the cards, and there the drawer is full-width so they read well. */
@media (max-height: 820px) {
    .mclean-fs.mclean-fs--mini .mclean-fs-suggest {
        display: none !important;
    }
}

/* The drawer is a flex column; the bar must not be squeezed by the scroll area. */
.mclean-fs-slot {
    display: block !important;
    flex-shrink: 0 !important;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 640px) {
    .mclean-fs .mclean-fs-item-name,
    .mclean-fs a.mclean-fs-item-name {
        font-size: 0.75rem !important;
    }

    .mclean-fs .mclean-fs-item {
        grid-template-columns: 40px 1fr auto !important;
        gap: 0.5rem !important;
    }

    .mclean-fs .mclean-fs-item-image {
        width: 40px !important;
        height: 40px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mclean-fs .mclean-fs-fill,
    .mclean-fs .mclean-fs-item,
    .mclean-fs .mclean-fs-item-btn {
        transition: none !important;
    }
}
