.cb-sfv-selector { margin: 0 0 20px; }
.cb-sfv-selector-title { display: block; margin-bottom: 11px; font-size: 1.05em; }
.cb-sfv-options { display: grid; grid-template-columns: repeat(auto-fill,minmax(115px,1fr)); gap: 12px; }
.cb-sfv-choice { background: #fff; color: #263238; border: 1px solid #c9d4d8; border-radius: 9px; padding: 8px; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; box-shadow: none; transition: border-color .15s ease; }
.cb-sfv-choice:hover:not(:disabled),.cb-sfv-choice.is-selected { border-color: #128d91; }
.cb-sfv-choice.is-selected { outline: 2px solid #128d91; outline-offset: 1px; }
.cb-sfv-choice:focus-visible { outline: 3px solid #128d91; outline-offset: 2px; }
.cb-sfv-choice img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; height: auto; border-radius: 5px; }
.cb-sfv-choice-name { font-size: .88em; font-weight: 600; }
.cb-sfv-choice-price { font-size: 1em; font-weight: 700; }
.cb-sfv-choice-stock { font-size: .77em; color: #476368; }
.cb-sfv-choice.cb-sfv-sold { cursor: not-allowed; opacity: .58; }
.cb-sfv-choice.cb-sfv-sold .cb-sfv-choice-stock { color: #a13939; }
/* Hide only the native selector's visuals when the JS bridge is confirmed working. */
form.variations_form.cb-sfv-enhanced table.variations { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
@media (max-width: 500px) { .cb-sfv-options { grid-template-columns: repeat(2,minmax(0,1fr)); } }
/* Wrappers permit a separate owner-edit control without nesting buttons. */
.cb-sfv-option { min-width: 0; position: relative; }
.cb-sfv-option > .cb-sfv-choice { width: 100%; height: 100%; }
/* Unpriced gallery photographs are selectable but never purchasable. */
.cb-sfv-additional { margin-top: 18px; }
.cb-sfv-extra-choice { width: 100%; height: 100%; }
.cb-sfv-show-main { border: 0; padding: 4px 0; margin-top: 8px; background: transparent; color: #167b82; text-decoration: underline; cursor: pointer; font-size: .86em; }
.cb-sfv-show-main:hover, .cb-sfv-show-main:focus-visible { color: #115d65; }

/* Preserve all native WooCommerce gallery slides for the normal WooCommerce gallery. Hide only
   the duplicate thumbnail navigation; Smart Frag cards provide photo selection. */
body.cb-sfv-native-gallery .woocommerce-product-gallery .flex-control-thumbs,
body.cb-sfv-native-gallery .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
    display: none !important;
}

/* On themes with the classic gallery but no FlexSlider, keep secondary images
   in the DOM for the normal WooCommerce gallery without showing a second gallery beneath the hero. */
body.cb-sfv-native-gallery .woocommerce-product-gallery:not(:has(.flex-viewport))
.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child) {
    display: none;
}

/* Marine Marketplace-style lightbox: scoped to Smart Frag products only. */
.cb-sfv-lightbox { position:fixed; inset:0; z-index:2147483000; display:none; align-items:center; justify-content:center; padding:100px 18px 24px; box-sizing:border-box; }
.cb-sfv-lightbox.is-open { display:flex; }
.cb-sfv-lightbox-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.78); touch-action:none; }
.cb-sfv-lightbox-inner { position:relative; z-index:1; display:flex; flex-direction:column; align-items:stretch; max-width:min(1100px,94vw); max-height:calc(100dvh - 135px); border-radius:18px; overflow:hidden; background:#0c141c; box-shadow:0 18px 44px rgba(0,0,0,.45); }
.cb-sfv-lightbox-stage { position:relative; min-height:0; display:flex; justify-content:center; align-items:center; overflow:hidden; }
.cb-sfv-lightbox-img { display:block; width:auto; height:auto; max-width:100%; max-height:calc(100dvh - 230px); object-fit:contain; background:#000; transform-origin:center center; will-change:transform; touch-action:none; }
.cb-sfv-lightbox-close { position:absolute; right:10px; top:8px; z-index:5; width:40px; height:40px; padding:0; border:0; border-radius:50%; background:rgba(0,0,0,.65); color:#fff; font-size:26px; line-height:40px; cursor:pointer; }
.cb-sfv-lightbox-nav { position:absolute; z-index:4; top:50%; transform:translateY(-50%); width:46px; height:58px; padding:0; border:0; border-radius:14px; background:rgba(0,0,0,.48); color:#fff; font-size:42px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.cb-sfv-lightbox-prev { left:8px; } .cb-sfv-lightbox-next { right:8px; }
.cb-sfv-lightbox-nav[hidden],.cb-sfv-lightbox-buy[hidden],.cb-sfv-lightbox-sold[hidden],.cb-sfv-lightbox-caption[hidden],.cb-sfv-lightbox-price[hidden] { display:none!important; }
.cb-sfv-lightbox-info { display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; position:relative; z-index:5; padding:12px 16px; color:#fff; font-size:14px; min-height:36px; background:rgba(15,29,41,.98); }
.cb-sfv-lightbox-caption { font-weight:600; }
.cb-sfv-lightbox-price { font-size:17px; font-weight:800; }
.cb-sfv-lightbox-buy { min-height:38px; border:1px solid #65d1d0; padding:8px 16px; border-radius:10px; background:#138f95; color:#fff; font-weight:700; cursor:pointer; }
.cb-sfv-lightbox-buy:hover,.cb-sfv-lightbox-buy:focus-visible { background:#0e7479; color:#fff; }
.cb-sfv-lightbox-sold { color:#ffb0aa; font-weight:700; }
html.cb-sfv-lightbox-open,body.cb-sfv-lightbox-open { overscroll-behavior:none; }
.cb-sfv-lightbox.is-open { touch-action:none; }
@media (min-width:1024px) { .cb-sfv-lightbox { padding:145px 28px 35px; } .cb-sfv-lightbox-inner { max-width:min(1000px,88vw); max-height:calc(100dvh - 180px); } .cb-sfv-lightbox-img { max-height:calc(100dvh - 265px); } }
@media (max-width:760px) { .cb-sfv-lightbox { padding:72px 10px 16px; } .cb-sfv-lightbox-inner { max-width:96vw; max-height:calc(100dvh - 90px); } .cb-sfv-lightbox-img { max-height:calc(100dvh - 190px); } .cb-sfv-lightbox-nav { width:38px; height:48px; font-size:34px; } .cb-sfv-lightbox-info { padding:10px; gap:8px; } }
