/**
 * Smart Route Sticky Bar Styles
 *
 * @package Places_Thailand
 * @task TASK-B2C-GUIDES-STICKY-BAR
 *
 * Performance & A11y notes:
 *  - Hardware accelerated GPU layer (will-change: transform).
 *  - Fixed horizontal anchoring (translate(-50%, ...)) prevents horizontal layout shifts.
 *  - iOS Safe Area inset padding for modern bezel-less screens.
 *  - Minimum 44x44px clickable tap target for close button.
 */

.b2c-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    box-sizing: border-box;
    background-color: var(--color-graphite-dark, #0F141C);
    border-radius: 32px 32px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
    z-index: 99;
    will-change: transform;
    transform: translate(-50%, 100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
    color: #FFFFFF;
}

/* Visible State */
.b2c-sticky-bar[data-state="visible"] {
    transform: translate(-50%, 0) !important;
    visibility: visible !important;
    pointer-events: auto;
}

/* Explicit Hidden State */
.b2c-sticky-bar[data-state="hidden"] {
    transform: translate(-50%, 100%) !important;
    visibility: hidden !important;
    pointer-events: none;
}

/* Content Area */
.b2c-sticky-bar__content {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.b2c-sticky-bar__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
    color: #F3F4F6;
    font-family: inherit;
}

/* Action Button */
.btn--ai-route {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #FF5B26 0%, #FF8533 100%);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    padding: 10px 22px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(255, 91, 38, 0.3);
    text-decoration: none;
}

.btn--ai-route:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 91, 38, 0.45);
}

.btn--ai-route:active {
    transform: translateY(0);
}

/* Dismiss Close Button (Apple Tap Target ≥ 44px) */
.b2c-sticky-bar__close {
    background: transparent;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    margin-left: 16px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.b2c-sticky-bar__close:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.1);
}

.b2c-sticky-bar__close svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* Responsive: Mobile & Tablet */
@media (max-width: 768px) {
    .b2c-sticky-bar {
        left: 0;
        transform: translateY(100%);
        border-radius: 24px 24px 0 0;
        padding: 20px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .b2c-sticky-bar[data-state="visible"] {
        transform: translateY(0) !important;
    }

    .b2c-sticky-bar[data-state="hidden"] {
        transform: translateY(100%) !important;
    }

    .b2c-sticky-bar__content {
        flex-direction: column;
        text-align: center;
        gap: 14px;
        width: 100%;
        padding-right: 28px;
    }

    .b2c-sticky-bar__text {
        font-size: 14px;
    }

    .btn--ai-route {
        width: 100%;
        max-width: 280px;
        padding: 12px 20px;
        font-size: 15px;
    }

    .b2c-sticky-bar__close {
        position: absolute;
        top: 12px;
        right: 12px;
        padding: 8px;
        margin-left: 0;
    }
}

/* TASK-B2C-GLOBAL-STICKY-01 — release refinements */
.b2c-sticky-bar {
    z-index: 999;
}

.btn--ai-route:focus-visible,
.b2c-sticky-bar__close:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .b2c-sticky-bar,
    .btn--ai-route,
    .b2c-sticky-bar__close {
        transition: none !important;
    }
}
