/**
 * Sticky Order Bar — Fixed bottom bar with Order Now + WhatsApp buttons
 *
 * Shared between product pages and landing pages.
 * Landing-specific overrides (max-width centering) are in landing-product.css.
 *
 * @package Codlion
 * @since 1.0.0
 */

/* ===== Sticky Order Bar (mobile + desktop) ===== */
.cl-sticky-order-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--cl-surface, #ffffff);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.cl-sticky-order-bar.cl-sticky-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Single button takes full width */
.cl-sticky-order-bar .cl-sticky-order-btn {
    flex: 1;
}

/* When WhatsApp button is present, split 90/10 */
.cl-sticky-order-bar.cl-sticky-has-whatsapp .cl-sticky-order-btn {
    flex: 90;
}

.cl-sticky-order-bar.cl-sticky-has-whatsapp .cl-sticky-whatsapp-btn {
    flex: 10;
    min-width: 44px;
    max-width: 56px;
}

/* When Call button is present, split 90/10 (same as WhatsApp) */
.cl-sticky-order-bar.cl-sticky-has-call .cl-sticky-order-btn {
    flex: 90;
}

.cl-sticky-order-bar.cl-sticky-has-call .cl-sticky-whatsapp-btn {
    flex: 10;
    min-width: 44px;
    max-width: 56px;
}

.cl-sticky-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    min-height: 44px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: var(--cod-btn-bg, linear-gradient(135deg, var(--cl-success, #16a34a) 0%, var(--cl-success-dark-2, #15803d) 100%));
    border: none;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-family: inherit;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(var(--cod-accent-rgb, 22, 163, 74), 0.3);
}

.cl-sticky-order-btn:hover {
    background: var(--cod-btn-bg-hover, linear-gradient(135deg, var(--cl-success-dark-2, #15803d) 0%, var(--cl-success-dark-3, #166534) 100%));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--cod-accent-rgb, 22, 163, 74), 0.45);
}

.cl-sticky-order-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(var(--cod-accent-rgb, 22, 163, 74), 0.3);
}

.cl-sticky-order-btn i {
    font-size: 18px;
}

/* WhatsApp icon-only button — SVG icon, round or button rectangle format */
.cl-sticky-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-height: 44px;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
    text-decoration: none;
    font-family: inherit;
    box-sizing: border-box;
}

.cl-sticky-whatsapp-btn:hover {
    transform: scale(1.12);
}

.cl-sticky-whatsapp-btn:active {
    transform: scale(1);
}

/* Rounded WhatsApp button — same bg as Order Now, white SVG icon */
.cl-sticky-whatsapp-btn.cl-sticky-whatsapp-rounded {
    background: var(--cod-btn-bg, var(--cl-success, #16a34a));
    border-radius: 50%;
    min-width: 44px;
    min-height: 44px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cl-sticky-whatsapp-btn.cl-sticky-whatsapp-rounded .cl-sticky-whatsapp-icon {
    width: 22px;
    height: 22px;
    color: #ffffff;
}

.cl-sticky-whatsapp-btn.cl-sticky-whatsapp-rounded:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.cl-sticky-whatsapp-btn.cl-sticky-whatsapp-rounded:active {
    transform: scale(1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* WhatsApp SVG icon (from assets/icons/whatsapp.svg via codlion_render_trust_icon) */
.cl-sticky-whatsapp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--cl-success, #16a34a);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.cl-sticky-whatsapp-icon svg {
    width: 100%;
    height: 100%;
}

/* Desktop: floating pill bar, centered */
@media screen and (min-width: 992px) {
    .cl-sticky-order-bar {
        left: 50%;
        transform: translate(-50%, 100%);
        width: auto;
        min-width: 380px;
        bottom: 28px;
        border-radius: 50px;
        padding: 10px 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }

    .cl-sticky-order-bar.cl-sticky-visible {
        transform: translate(-50%, 0);
    }

    .cl-sticky-order-btn {
        padding: 14px 36px;
    }

    .cl-sticky-whatsapp-btn:not(.cl-sticky-whatsapp-rounded) {
        border-radius: 0;
        min-width: 52px;
        max-width: 60px;
        padding: 0;
    }

    .cl-sticky-whatsapp-icon {
        width: 44px;
        height: 44px;
    }
}

/* ===== Responsive ===== */
@media screen and (max-width: 991px) {
    .cl-sticky-order-btn {
        font-size: 14px;
        padding: 11px 14px;
        min-height: 40px;
    }

    .cl-sticky-order-btn i {
        font-size: 16px;
    }

    .cl-sticky-whatsapp-btn {
        padding: 0;
        min-height: 44px;
    }

    .cl-sticky-whatsapp-icon {
        width: 38px;
        height: 38px;
    }
}

/* ===== Accessibility: reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    .cl-sticky-order-bar,
    .cl-sticky-order-btn,
    .cl-sticky-whatsapp-btn {
        transition: none;
    }

    .cl-sticky-order-btn:hover,
    .cl-sticky-whatsapp-btn:hover {
        transform: none;
    }
}
