/* ═══════════════════════════════════════════════════════════════════════════
   SANDOX PRODUCT OPTIONS v4.2 — Product page only CSS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ══ SECTION A: Hide native WC / WoodMart elements on single product page ══ */

.single-product .variations_form table.variations,
.single-product .variations_form .variations,
.single-product .woocommerce-variation-price,
.single-product .single_variation_wrap .woocommerce-variation-price,
.single-product .single_variation_wrap .woocommerce-variation.single_variation {
    display: none !important;
}

/* ALL price range elements on single product only */
.single-product .summary .price,
.single-product .summary > .price,
.single-product .entry-summary .price,
.single-product p.price,
.single-product .price-wrapper,
.single-product .woodmart-product-price,
.single-product .wc-block-components-product-price,
.single-product [class*="price-range"],
.single-product .product-price {
    display: none !important;
}

/* Native ATC: hide visually but keep in DOM for WC JS engine */
.single-product .single_add_to_cart_button,
.single-product button.single_add_to_cart_button,
.single-product form.cart .single_add_to_cart_button {
    position: fixed !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Collapse the variation wrap to 0 but keep it rendered */
.single-product .single_variation_wrap {
    display: block !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.single-product .woocommerce-variation-add-to-cart { display: none !important; }

/* WoodMart Buy Now */
.single-product .woodmart-buy-now-btn,
.single-product .buy-now-btn,
.single-product a.buy_now_button,
.single-product button.buy_now_button,
.single-product [class*="buy-now"],
.single-product [class*="buynow"] {
    display: none !important;
}

/* Wishlist */
.single-product .yith-wcwl-add-to-wishlist,
.single-product .tinvwl_add_to_wishlist_button,
.single-product .tinv-wishlist,
.single-product .add_to_wishlist,
.single-product .woodmart-wishlist-btn {
    display: none !important;
}

/* Compare */
.single-product .compare-button,
.single-product .woodmart-compare-btn,
.single-product a.compare,
.single-product .product-compare-button {
    display: none !important;
}

/* WoodMart product action bar */
.single-product .woodmart-single-actions,
.single-product .woodmart-product-actions,
.single-product .product-bottom-actions,
.single-product .product-single-actions,
.single-product .entry-summary .product-social-links {
    display: none !important;
}

/* Pay-later banners */
.single-product [class*="affirm"],
.single-product [class*="klarna"],
.single-product [class*="afterpay"],
.single-product [class*="sezzle"] {
    display: none !important;
}

/* ══ SECTION B: WoodMart sticky bottom bar (native) — hide it ═════════════ */
/* WoodMart has its own sticky bar — we replace it with ours */
.woodmart-sticky-atc,
.woodmart-sticky-add-to-cart,
[class*="sticky-atc"],
[class*="sticky-add-to-cart"],
.wdm-sticky-add-to-cart {
    display: none !important;
}

/* ══ SECTION C: SANDOX INLINE UI ══════════════════════════════════════════ */

.sandox-options-wrap { font-family: inherit; margin: 0 0 20px; }

/* ── Price + ATC block ───────────────────────────────────────────────────── */
.sandox-top-atc-block {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ebebeb;
}
.sandox-top-price-wrap { flex: 1; min-width: 140px; }

.sandox-price-current {
    font-size: 26px;
    font-weight: 700;
    color: #111;
    display: block;
    line-height: 1.2;
}
.sandox-price-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.sandox-price-before { font-size: 13px; color: #444; }
.sandox-price-orig   { font-size: 13px; color: #aaa; text-decoration: line-through; }
.sandox-price-save   {
    font-size: 13px;
    font-weight: 700;
    background: #e6f4ea;
    color: #1a7c3e;
    padding: 3px 10px;
    border-radius: 4px;
}

/* ── THE MAIN ATC BUTTON — exact BackMarket dark style ──────────────────── */
.sandox-inline-atc-btn {
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 16px 36px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 185px;
    letter-spacing: 0.01em;
    line-height: 1;
}
.sandox-inline-atc-btn:hover   { background: #2d2d2d; }
.sandox-inline-atc-btn:disabled {
    background: #d0d0d0;
    color: #888;
    cursor: not-allowed;
}

/* ── Sections ────────────────────────────────────────────────────────────── */
.sandox-section { margin-bottom: 22px; }
.sandox-section-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #111 !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    line-height: 1.3 !important;
}

/* ── Guarantee box ───────────────────────────────────────────────────────── */
.sandox-guarantee {
    display: flex; align-items: center; gap: 10px;
    background: #eef3ff; border: 1px solid #d0dcff;
    border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
    font-size: 13px; color: #444; cursor: pointer;
}
.sandox-shield {
    width: 30px; height: 30px; flex-shrink: 0;
    background: #d0dcff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #3a5bcc;
}
.sandox-guarantee-text { flex: 1; line-height: 1.4; }
.sandox-chevron { font-size: 20px; color: #888; flex-shrink: 0; }

/* ── Option cards ────────────────────────────────────────────────────────── */
.sandox-option-list { display: flex; flex-direction: column; gap: 8px; }
.sandox-option-card {
    display: flex; align-items: center; gap: 12px;
    border: 1.5px solid #e0e0e0; border-radius: 10px;
    padding: 13px 16px; cursor: pointer; position: relative;
    transition: border-color 0.15s; background: #fff; user-select: none;
}
.sandox-option-card:hover { border-color: #aaa; }
.sandox-option-card.selected { border: 2px solid #111; background: #fafafa; }
.sandox-option-card.unavailable { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.sandox-radio {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #ccc; flex-shrink: 0; position: relative;
    transition: border-color 0.15s, background 0.15s;
}
.sandox-option-card.selected .sandox-radio { border-color: #111; background: #111; }
.sandox-option-card.selected .sandox-radio::after {
    content: ''; position: absolute;
    top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 7px; height: 7px; border-radius: 50%; background: #fff;
}
.sandox-label { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sandox-name  { font-size: 14px; font-weight: 600; color: #111; }
.sandox-desc  { font-size: 12px; color: #666; line-height: 1.3; }
.sandox-sold-out { font-size: 12px; color: #bbb; margin-top: 1px; }

.sandox-popular {
    position: absolute; top: -10px; right: 12px;
    background: #ffd700; color: #7a5800;
    font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
}

/* ── Color grid ──────────────────────────────────────────────────────────── */
.sandox-color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sandox-color-card {
    display: flex; align-items: center; gap: 10px;
    border: 1.5px solid #e0e0e0; border-radius: 10px;
    padding: 11px 14px; cursor: pointer;
    transition: border-color 0.15s; background: #fff; user-select: none;
}
.sandox-color-card:hover { border-color: #aaa; }
.sandox-color-card.selected { border: 2px solid #111; background: #fafafa; }
.sandox-color-card.unavailable { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.sandox-color-dot {
    width: 22px; height: 22px; border-radius: 50%;
    flex-shrink: 0; border: 1px solid rgba(0,0,0,0.12);
}

/* ── Message ─────────────────────────────────────────────────────────────── */
.sandox-variation-msg {
    margin-top: 10px; padding: 10px 14px;
    border-radius: 8px; font-size: 13px; display: none;
}
.sandox-variation-msg.error {
    background: #fff2f2; border: 1px solid #ffcdd2; color: #c62828; display: block;
}

/* ══ SECTION D: DESKTOP STICKY TOP BAR — BackMarket style ════════════════ */
#sandox-sticky-top {
    position: fixed; top: 0; left: 0; right: 0; z-index: 99999;
    background: #fff; border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
    padding: 10px 24px;
    align-items: center; gap: 20px;
    display: none;
}
#sandox-sticky-top.visible { display: flex; }

/* Thumbnail */
.sdx-sticky-thumb {
    width: 48px; height: 48px;
    border-radius: 6px; overflow: hidden; flex-shrink: 0;
    border: 1px solid #eee;
}
.sdx-sticky-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}

/* Variant summary (Fair - 128GB - Black) */
.sdx-sticky-variants {
    flex: 1;
    min-width: 0;
}
.sdx-sticky-title {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sdx-sticky-variant-line {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price block in sticky bar */
.sdx-sticky-price-wrap {
    text-align: right;
    flex-shrink: 0;
}
.sdx-sticky-price-main {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    display: block;
}
.sdx-sticky-price-sub {
    font-size: 11px;
    color: #555;
    display: block;
    margin-top: 1px;
    white-space: nowrap;
}
.sdx-sticky-price-sub del { color: #aaa; margin-right: 4px; }
.sdx-sticky-save-badge {
    display: inline-block;
    background: #e6f4ea;
    color: #1a7c3e;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}

/* ATC in sticky bar */
.sandox-sticky-top-btn {
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}
.sandox-sticky-top-btn:hover    { background: #2d2d2d; }
.sandox-sticky-top-btn:disabled { background: #d0d0d0; color: #888; cursor: not-allowed; }

/* ══ SECTION E: MOBILE STICKY BOTTOM BAR ════════════════════════════════ */
@media (min-width: 769px) {
    #sandox-sticky-bar { display: none !important; }
}

@media (max-width: 768px) {
    .sandox-inline-atc-btn { display: none; }
    #sandox-sticky-top     { display: none !important; }

    .single-product body,
    body.single-product { padding-bottom: 84px; }

    #sandox-sticky-bar {
        display: flex;
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 99998;
        background: #fff;
        border-top: 1.5px solid #e0e0e0;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.10);
        padding: 10px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        align-items: center; gap: 12px;
    }
    .sandox-bar-price-wrap { flex: 1; min-width: 0; }
    .sandox-bar-price {
        font-size: 19px; font-weight: 700; color: #111;
        display: block; line-height: 1.1;
    }
    .sandox-bar-price-meta {
        display: flex; align-items: center; gap: 5px;
        margin-top: 2px; flex-wrap: wrap;
    }
    .sandox-bar-before { font-size: 11px; color: #444; }
    .sandox-bar-orig   { font-size: 11px; color: #aaa; text-decoration: line-through; }
    .sandox-bar-save   {
        font-size: 11px; background: #e6f4ea; color: #1a7c3e;
        padding: 1px 7px; border-radius: 3px; font-weight: 700;
    }
    .sandox-bar-btn {
        background: #1a1a1a; color: #fff; border: none;
        border-radius: 10px; padding: 15px 24px;
        font-size: 15px; font-weight: 600;
        cursor: pointer; white-space: nowrap;
        flex-shrink: 0; transition: background 0.15s;
        letter-spacing: 0.01em;
    }
    .sandox-bar-btn:hover    { background: #2d2d2d; }
    .sandox-bar-btn:disabled { background: #d0d0d0; color: #888; cursor: not-allowed; }

    .sandox-color-grid    { grid-template-columns: 1fr; }
    .sandox-color-card    { padding: 13px 16px; }
    .sandox-price-current { font-size: 22px; }
    .sandox-section-title { font-size: 16px !important; }
}
