/* ---------------------------------------------------------------
   Product Page: Sticky Bottom Bar
   Height: 68px desktop / 2-row mobile
---------------------------------------------------------------- */

:root {
    --csb-h: 68px;
}

#clipon-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--csb-h);
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 20px rgba(0,0,0,.10);
    z-index: 9900;
    display: flex;
    align-items: center;
}

.csb-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── Thumbnail ── */
.csb-thumb {
    flex-shrink: 0;
    width: 190px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

/* ── Frame info ── */
.csb-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.csb-info-main {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csb-info-sub {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Quantity ── */
.csb-qty-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid #d1d5db;
    border-radius: 999px;
    overflow: hidden;
    height: 40px;
}

.csb-qty-btn {
    width: 36px;
    height: 100%;
    background: none;
    border: none;
    font-size: 18px;
    font-weight: 400;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}

.csb-qty-btn:hover { background: #f3f4f6; }

.csb-qty-input {
    width: 36px;
    height: 100%;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #111;
    -moz-appearance: textfield;
    background: #fff;
    outline: none;
}

.csb-qty-input::-webkit-inner-spin-button,
.csb-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Buttons ── */
.csb-buttons {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csb-btn {
    height: 40px;
    padding: 0 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    font-family: inherit;
    letter-spacing: .02em;
}

.csb-btn-cart {
    background: #111;
    color: #fff;
}
.csb-btn-cart:hover { background: #374151; }

.csb-btn-checkout {
    background: #fff;
    color: #111;
    border: 1.5px solid #d1d5db;
}
.csb-btn-checkout:hover { border-color: #111; background: #f9fafb; }
.csb-btn-gpay { background: #000; color: #fff; }
.csb-btn-gpay:hover { background: #222; }

.csb-btn-link { background: #00d66b; color: #000; }
.csb-btn-link:hover { background: #00b85c; }

/* disabled state during submit */
.csb-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------
   Lift floating cart icon above the sticky bar
---------------------------------------------------------------- */
.floating-cart,
.cart-icon-wrapper,
.woo-cart-counter,
.woocommerce-mini-cart-wrapper,
.widget_shopping_cart,
.site-cart,
.custom-cart-icon,
[class*="cart-btn"],
[class*="floating-cart"] {
    bottom: calc(var(--csb-h) + 16px) !important;
}

/* body padding so page content isn't hidden behind bar */
body.single-product {
    padding-bottom: var(--csb-h);
}

/* ---------------------------------------------------------------
   Mobile — collapse to 2 rows
---------------------------------------------------------------- */
@media (max-width: 767px) {
    :root { --csb-h: 116px; }

    #clipon-sticky-bar { height: var(--csb-h); align-items: stretch; }

    .csb-inner {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
        align-content: center;
    }

    /* Row 1: thumb + info + qty */
    .csb-thumb { width: 40px; height: 40px; }

    .csb-info { flex: 1; }

    .csb-qty-wrap { height: 34px; }
    .csb-qty-btn { width: 30px; }
    .csb-qty-input { width: 30px; font-size: 13px; }

    /* Row 2: buttons full width */
    .csb-buttons {
        width: 100%;
        gap: 6px;
    }

    .csb-btn {
        flex: 1;
        height: 36px;
        padding: 0 10px;
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    .csb-info-sub { display: none; }
}
/* Hide original product page buttons */
.single-product .quantity,
.single-product .single_add_to_cart_button,
.single-product #wc-stripe-express-checkout-element,
.single-product .wc-stripe-express-checkout-wrapper,
.single-product .wc-stripe-express-checkout-button-separator {
    display: none !important;
}
/* ── Selectors tray ── */
:root { --csb-tray-h: 160px; }

.csb-lens-filter-half {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.csb-lens-swatch-half {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* Hide original variation rows immediately before JS runs */
.single-product .variations tr:has(#pa_bridge),
.single-product .variations tr:has(#pa_lens-color),
.single-product .woocommerce-variation-add-to-cart .wc-pao-addon-wrap:has(select) {
    display: none !important;
}

#csb-selectors-tray {
    position: fixed;
    bottom: var(--csb-h);
    left: 0%;
    right: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 12px 20px;
    z-index: 9899;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
	align-items: center;
    overflow: hidden;

}

.csb-tray-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
	justify-content: center;
}

/* Bridge pills */
.csb-bridge-container {
    display: flex;
    align-items: center;
    width: 650px;
    height: 50px;
    border-radius: 25px;
    border: 1px solid #ccc;
    background: #F2F2F2;
    padding: 4px;
}
.csb-bridge-pill {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-radius: 25px;
    border: none;
    background: transparent;
    transition: all .15s;
    font-family: inherit;
}
.csb-bridge-pill.active { background: #29aae1; color: #fff; }

/* Lens swatches */
.csb-swatch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.csb-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    outline: 2px solid transparent;
    cursor: pointer;
    transition: outline .15s, transform .15s;
    flex-shrink: 0;
    padding: 0;
}
.csb-swatch:hover { transform: scale(1.18); }
.csb-lens-swatch-half .csb-swatch.active:hover { transform: none; }
.csb-swatch.active {
    outline: 2px solid #29aae1;
    outline-offset: 2px;
}

.csb-lens-desc-text {
    display: block;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-top: 2px;
    min-height: 16px;
	text-align: center;
}

body.single-product {
    padding-bottom: calc(var(--csb-h) + var(--csb-tray-h)) !important;
}

.csb-price {
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}
.csb-price del {
    color: #aaa;
    font-weight: 400;
    font-size: 13px;
    margin-right: 4px;
}
.csb-price ins {
    text-decoration: none;
    color: #29aae1;
}

@media (max-width: 960px) {
    #csb-selectors-tray { left: 0; right: 0; border-radius: 0; border-left: none; border-right: none; align-items: center; }
}

@media (max-width: 767px) and (orientation: portrait) {
    .csb-bridge-container {
        width: 100%;
        max-width: 100%;
    }
    .csb-lens-filter-half {
        width: 50%;
        padding: 0 2px;
    }
    .csb-lens-filter-half .csb-bridge-pill {
        font-size: 11px;
        padding: 0 4px;
    }
    .csb-lens-swatch-half {
        width: 50%;
        padding: 0 6px;
        gap: 6px;
    }
    .csb-lens-swatch-half .csb-swatch {
        width: 26px;
        height: 26px;
    }
    .csb-bridge-pill {
        font-size: 14px;
    }
    :root { --csb-h: 150px; }

    #clipon-sticky-bar { height: var(--csb-h); align-items: stretch; }

    .csb-inner {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 0;
        align-content: center;
    }

    /* Hide info text on mobile — not enough room */
    .csb-info { display: none; }

    /* Row 1: thumbnail + qty + Add to Cart */

    .csb-qty-wrap {
        height: 36px;
        margin-left: 10px;
        align-self: center;
        flex-shrink: 0;
    }
    .csb-qty-btn  { width: 30px; }
    .csb-qty-input { width: 30px; font-size: 13px; }

    .csb-btn-cart {
        margin-left: 8px;
        align-self: center;
        height: 36px;
        padding: 0 9px;
        font-size: 13px;
        flex-shrink: 0;
    }

    /* Row 2: Checkout + Google Pay + Pay with Link */
    .csb-buttons {
        width: 80%;
        margin-top: 15px;
		padding-bottom:15px;
        gap: 6px;
    }

    .csb-btn {
        flex: 1;
        height: 32px;
        padding: 0 8px;
        font-size: 11px;
    }
	.csb-bridge-pill {
	padding: 0 50px;
	}
	.csb-swatch {
    width: 23px;
    height: 23px;
	}	
	.csb-swatch-row {
	padding-top: 15px;	
	}
}
@media (max-width: 767px) {
    .csb-thumb { width: 40%; height: 56px; flex-shrink: 0; }
}