/* Sticky Configurator Bar - Mobile First */
#wb-sticky-configurator {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--wb-sticky-bg, #ffffff);
    z-index: 99999;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    padding-bottom: calc(12px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: none;
    /* Shown via scroll with JS */
}

#wb-sticky-configurator.active {
    transform: translateY(0);
    display: block;
}

.wb-sticky-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Row 1: Attributes */
.wb-sticky-row-attributes {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
}

.wb-sticky-row-attributes::-webkit-scrollbar {
    display: none;
}

.wb-attribute-box {
    flex: 1 0 auto;
    min-width: 100px;
    max-width: 150px;
    background: var(--wb-sticky-box-bg, #f5f5f5);
    color: var(--wb-sticky-text, #000000);
    padding: 8px 12px;
    border-radius: var(--wb-sticky-radius, 12px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wb-attribute-box.selected {
    background: var(--wb-sticky-box-active-bg, #000000);
    color: var(--wb-sticky-active-text, #ffffff);
}

.wb-box-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.wb-box-value {
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Row 2: CTA */
.wb-sticky-cta-button {
    width: 100%;
    background: var(--wb-sticky-cta-bg, #000000);
    color: var(--wb-sticky-cta-text, #ffffff);
    border: none;
    padding: 16px;
    border-radius: var(--wb-sticky-radius, 12px);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s active;
}

.wb-sticky-cta-button:active {
    transform: scale(0.98);
}

/* Popover */
.wb-popover {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 16px;
    right: 16px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
    display: none;
    animation: wb-pop-up 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100000;
}

.wb-popover.active {
    display: block;
}

.wb-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 16px;
    color: #333;
}

.wb-popover-close {
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
}

.wb-popover-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.wb-option-btn {
    background: #f8f8f8;
    border: 1.5px solid #eee;
    padding: 12px 10px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wb-option-btn.selected {
    border-color: var(--wb-sticky-box-active-bg, #000);
    background: #fff;
}

.wb-popover-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
}

/* Animations */
@keyframes wb-pop-up {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wb-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.wb-shake {
    animation: wb-shake 0.3s ease-in-out 2;
}

/* Themes Overrides */
.wb-theme-dark {
    --wb-sticky-bg: #111111;
    --wb-sticky-box-bg: #222222;
    --wb-sticky-text: #ffffff;
    --wb-sticky-cta-bg: #ffffff;
    --wb-sticky-cta-text: #111111;
}

.wb-theme-luxury {
    --wb-sticky-bg: #1a1a1a;
    --wb-sticky-box-bg: #2a2a2a;
    --wb-sticky-text: #d4af37;
    --wb-sticky-box-active-bg: #d4af37;
    --wb-sticky-cta-bg: #d4af37;
    --wb-sticky-cta-text: #1a1a1a;
}