/* =========================================================
   BINOISE — Single Product Redesign
   Scoped to .sp-page to avoid affecting archive/product cards.
   ========================================================= */

body.single-product {
    background: #fff;
}

.sp-page {
    --sp-orange: #fa7921;
    --sp-red: #f55157;
    --sp-navy: #23254e;
    --sp-text: #3f4064;
    --sp-muted: #81858b;
    --sp-line: #e8eaed;
    --sp-soft: #f7f8fa;
    --sp-card: #fff;
}

.sp-container {
    width: min(100% - 48px, 1680px);
    max-width: 1680px;
    margin-inline: auto;
    padding: 0 !important;
}

.sp-main-section {
    padding: 30px 0 24px !important;
}

.sp-product-layout {
    display: grid !important;
    grid-template-columns: minmax(430px, .88fr) minmax(650px, 1.35fr) !important;
    gap: 38px !important;
    align-items: start !important;
    direction: rtl;
}

/* ---------- Gallery ---------- */
.sp-product-gallery {
    position: relative;
    width: 100% !important;
    min-width: 0;
    gap: 14px !important;
    direction: ltr;
}

.sp-gallery-badges {
    position: absolute;
    top: 16px;
    right: 116px;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.sp-sale-badge,
.sp-image-count-badge {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.sp-sale-badge {
    background: rgba(245, 81, 87, .94);
    color: #fff;
    box-shadow: 0 8px 18px rgba(245, 81, 87, .18);
}

.sp-image-count-badge {
    background: rgba(255,255,255,.92);
    color: var(--sp-text);
    border: 1px solid rgba(224,226,230,.9);
}

.sp-main-gallery {
    height: 600px !important;
    min-height: 600px;
    border-radius: 24px !important;
    border: 1px solid #eceef0;
    background: #f8f8f8 !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

.sp-main-gallery .swiper-slide,
.sp-main-slide {
    background: #f8f8f8 !important;
}

.sp-main-gallery img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 28px;
    mix-blend-mode: multiply;
}

.sp-gallery-thumbs-wrap {
    width: 92px !important;
    height: 600px !important;
    flex: 0 0 92px;
}

.sp-gallery-thumbs {
    width: 92px !important;
    height: 536px !important;
}

.sp-gallery-thumbs .swiper-wrapper {
    padding-top: 0 !important;
}

.sp-gallery-thumbs .swiper-slide,
.sp-thumb-slide {
    width: 88px !important;
    height: 88px !important;
    min-width: 88px !important;
    border-radius: 14px !important;
    border: 1px solid #e5e7eb;
    background: #fff !important;
    overflow: hidden;
    padding: 5px;
    transition: .2s ease;
}

.sp-gallery-thumbs .swiper-slide:hover,
.sp-gallery-thumbs .swiper-slide-thumb-active {
    border-color: rgba(250, 121, 33, .7);
    box-shadow: 0 8px 18px rgba(250, 121, 33, .10);
}
.sp-gallery-next {
    width: 40px !important;
    height: 40px !important;
    border-color: #d9dde3 !important;
    color: var(--sp-orange);
    box-shadow: 0 8px 20px rgba(0,0,0,.05);
}

.sp-gallery-color-bar {
    width: auto !important;
    min-width: 148px;
    bottom: 16px !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,.92) !important;
    border: 1px solid rgba(229,231,235,.95);
    box-shadow: 0 10px 24px rgba(0,0,0,.06);
}

.sp-gallery-color-bar .single-color-switch {
    width: 24px !important;
    height: 24px !important;
    margin: 0 3px !important;
}

/* ---------- Summary layout ---------- */
.sp-summary-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px !important;
    width: 100% !important;
    min-width: 0;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.sp-product-info {
    min-width: 0;
    padding-top: 8px;
}

.sp-product-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 28px;
    margin-bottom: 12px;
}

.sp-product-eyebrow a {
    color: #1677ff;
    font-size: 13px;
    font-weight: 800;
}

.sp-product-eyebrow a:hover {
    color: var(--sp-orange);
}

.sp-eyebrow-separator {
    color: #b8bcc4;
}

.sp-summary-head {
    padding-bottom: 20px !important;
    border-bottom: 1px solid var(--sp-line) !important;
}

.sp-summary-head h1 {
    margin: 0 !important;
    color: #0c0c0c !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    line-height: 1.9 !important;
}

.sp-product-meta-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.sp-rating-wrap {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: auto !important;
}

.sp-rating-wrap .woocommerce-product-rating {
    margin: 0 !important;
}

.sp-review-count {
    font-size: 12px;
    font-weight: 700;
    color: #1677ff;
    width: 100%;
}

.sp-product-sku {
    font-size: 11px;
    color: #9aa0a6;
    font-weight: 600;
}

/* Features */
.sp-features-block {
    padding: 24px 0 20px;
    border-bottom: 1px solid var(--sp-line);
}

.sp-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.sp-section-title-row h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    color: #111;
}

.sp-section-title-row a {
    font-size: 12px;
    font-weight: 800;
    color: #1677ff;
}

.sp-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
}

.sp-feature-card {
    min-width: 0;
    border-radius: 12px;
    background: #f2f3f5;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sp-feature-card span {
    color: #81858b;
    font-size: 11px;
    font-weight: 700;
}

.sp-feature-card strong {
    color: #3f4064;
    font-size: 12px;
    line-height: 1.9;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-purchase-notes {
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sp-note-row {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    align-items: start;
}

.sp-note-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f4f5f7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #62666d;
}

.sp-note-icon svg {
    width: 20px;
    height: 20px;
}

.sp-note-row strong {
    display: block;
    color: #3f4064;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 3px;
}

.sp-note-row p {
    margin: 0;
    color: #81858b;
    font-size: 11px;
    line-height: 1.9;
}

/* ---------- Buy card ---------- */
.sp-buy-card {
    position: sticky;
    top: 108px;
    min-width: 0;
    border: 1px solid #e0e0e2;
    border-radius: 18px;
    background: #f7f7f8;
    padding: 18px;
    align-self: start;
}

.sp-seller-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
}

.sp-seller-icon,
.sp-buy-row-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid #e7e8eb;
    color: #3f4064 !important;
}

.sp-seller-icon svg,
.sp-buy-row-icon svg {
    width: 19px;
    height: 19px;
}

.sp-seller-head span,
.sp-buy-card-row span {
    display: block;
    color: #ff6b1a !important;
    font-size: 11px;
    font-weight: 700;
}

.sp-seller-head strong,
.sp-buy-card-row strong {
    display: block;
    color: #3f4064;
    font-size: 13px;
    line-height: 1.9;
    font-weight: 900;
    margin-top: 3px;
}

.sp-seller-status {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 46px 14px 0;
    color: #029a49;
    font-size: 11px;
    font-weight: 800;
    border-bottom: 1px solid #e5e6e8;
}

.sp-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #029a49;
    box-shadow: 0 0 0 4px rgba(2,154,73,.08);
}

.sp-buy-card-row {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid #e5e6e8;
}

.sp-price-box {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 18px 0 10px !important;
    gap: 8px !important;
}

.sp-price-box .price-label {
    color: #81858b !important;
    font-size: 11px !important;
    text-align: left;
}

.sp-price-box .single-product-price {
    justify-content: flex-start;
    flex-direction: row-reverse;
    gap: 8px !important;
}

.sp-price-box del {
    color: #a8a8a8 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

.sp-price-box ins,
.sp-price-box > .single-product-price > .price,
.sp-price-box .single-product-price > .woocommerce-Price-amount {
    color: var(--sp-red) !important;
    font-size: 20px !important;
    font-weight: 900 !important;
}

.sp-cart-box {
    width: 100%;
}

.sp-cart-box form.cart,
.sp-cart-box .variations_form.cart,
.sp-cart-box .simpleAddtocart {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    margin: 0 !important;
}

.sp-cart-box .variations {
    width: 100%;
}

.sp-cart-box .variation-attr {
    gap: 12px !important;
}

.sp-cart-box .variation-attr > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
}

.sp-cart-box .variation-attr .label,
.sp-cart-box .variations label {
    font-size: 12px !important;
    font-weight: 900 !important;
    color: #3f4064 !important;
    margin: 0 !important;
}

.sp-cart-box .custom-variations-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.sp-cart-box .warranty-btn .btn-label {
    min-height: 38px;
    padding: 0 11px;
    border-radius: 9px;
    border: 1px solid #d9dce1;
    background: #fff;
    color: #62666d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s ease;
}

.sp-cart-box .warranty-btn input:checked + .btn-label {
    border-color: var(--sp-orange);
    color: var(--sp-orange);
    background: #fff7f1;
    box-shadow: 0 0 0 2px rgba(250,121,33,.07);
}

.sp-cart-box .color-swatch {
    display: inline-flex;
    cursor: pointer;
}

.sp-cart-box .color-swatch .swatch-circle {
    width: 28px !important;
    height: 28px !important;
    border: 3px solid #fff !important;
    box-shadow: 0 0 0 1px #c9cdd3;
}

.sp-cart-box .color-swatch input:checked + .swatch-circle {
    box-shadow: 0 0 0 2px #1677ff;
}

.sp-cart-box .reset_variations.sp-reset-variations {
    width: max-content;
    min-height: 32px;
    margin-top: 2px;
    padding: 0 10px 0 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e1e4e8;
    color: #767b84;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 10px !important;
    font-weight: 800;
    line-height: 1;
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(35, 37, 78, .035);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-3px) scale(.98);
    transition: opacity .2s ease, transform .2s ease, border-color .2s ease, color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.sp-cart-box .reset_variations.sp-reset-variations.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.sp-cart-box .reset_variations.sp-reset-variations:hover {
    color: var(--sp-orange);
    border-color: rgba(250, 121, 33, .42);
    background: #fff8f3;
    box-shadow: 0 5px 14px rgba(250, 121, 33, .08);
}

.sp-cart-box .sp-reset-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    background: #f4f5f7;
    color: #8a8e95;
    font-size: 14px;
    font-weight: 700;
    transition: transform .25s ease, color .2s ease, background-color .2s ease;
}

.sp-cart-box .reset_variations.sp-reset-variations:hover .sp-reset-icon {
    color: var(--sp-orange);
    background: #fff0e5;
    transform: rotate(-35deg);
}

.sp-cart-box .sp-reset-text {
    white-space: nowrap;
}

.sp-cart-box .variation-price {
    margin: 0;
}

.sp-cart-box .woocommerce-variation-price {
    padding: 4px 0 0;
}

.sp-cart-box .woocommerce-variation-price .price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-cart-box .woocommerce-variation-price ins span bdi {
    color: var(--sp-red) !important;
    font-size: 20px !important;
    font-weight: 900 !important;
}

.sp-cart-box .newDiv {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
}

.sp-cart-box .newDiv > .flex {
    width: 100% !important;
    gap: 8px !important;
}

.sp-cart-box .single_add_to_cart_button {
    width: 100% !important;
    box-shadow: none !important;
    transition: .2s ease;
}

.sp-cart-box .single_add_to_cart_button:hover {
    background: #e9484f !important;
    transform: none !important;
    box-shadow: 0 10px 22px rgba(245,81,87,.18) !important;
}

.sp-cart-box .quantity {
    width: 100% !important;
    height: 44px !important;
    justify-content: center !important;
    border-radius: 10px !important;
    background: #fff !important;
    border: 1px solid #dcdfe3 !important;
    margin: 0 !important;
}

.sp-cart-box .yith-wcwl-add-to-wishlist,
.sp-cart-box .yith-wcwl-add-button,
.sp-cart-box .yith-wcwl-wishlistaddedbrowse,
.sp-cart-box .yith-wcwl-wishlistexistsbrowse {
    flex: 0 0 46px;
}

.sp-cart-box .yith-wcwl-add-to-wishlist a,
.sp-cart-box .yith-wcwl-add-button a {
    width: 46px !important;
    height: 50px !important;
    border-radius: 10px !important;
    border: 1px solid #dcdfe3 !important;
    background: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sp-buy-security {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e5e6e8;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
    align-items: center;
    color: #81858b;
}

.sp-buy-security span {
    width: 24px;
    height: 24px;
    display: inline-flex;
    color: #62666d;
}

.sp-buy-security span svg {
    width: 100%;
    height: 100%;
}

.sp-buy-security p {
    margin: 0;
    font-size: 10px;
    line-height: 1.8;
    font-weight: 700;
}

/* ---------- Service strip ---------- */
.sp-services-section {
    padding: 8px 0 26px;
}

.sp-services-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    border-top: 1px solid #eceef0;
    border-bottom: 1px solid #eceef0;
    padding: 18px 0;
}

.sp-service-item {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px 16px;
    border-left: 1px solid #eff0f2;
}

.sp-service-item:last-child {
    border-left: 0;
}

.sp-service-item > span {
    width: 34px;
    height: 34px;
    display: inline-flex;
    color: #a0a4aa;
    flex: 0 0 auto;
}

.sp-service-item > span svg {
    width: 100%;
    height: 100%;
}

.sp-service-item strong {
    display: block;
    color: #62666d;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 2px;
}

.sp-service-item small {
    display: block;
    color: #a0a4aa;
    font-size: 10px;
    font-weight: 600;
}

/* ---------- Related products ---------- */
.sp-related-wrapper {
    padding: 0 0 28px;
}

.sp-related-products {
    border: 1px solid #e0e0e2;
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
}

.sp-related-head {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #eceef0;
}

.sp-related-kicker {
    display: block;
    color: var(--sp-orange);
    font-size: 10px;
    font-weight: 800;
    margin-bottom: 4px;
}

.sp-related-head h2 {
    position: relative;
    margin: 0;
    padding-bottom: 10px;
    font-size: 18px;
    font-weight: 900;
    color: #0c0c0c;
}

.sp-related-head h2::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 72px;
    height: 3px;
    border-radius: 999px;
    background: var(--sp-red);
}

.sp-related-count {
    color: #81858b;
    font-size: 11px;
    font-weight: 700;
}

.sp-related-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 1fr);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: #d8dade transparent;
}

.sp-related-item {
    min-width: 0;
    padding: 14px;
    border-left: 1px solid #eceef0;
}

.sp-related-item:last-child {
    border-left: 0;
}

.sp-related-item .product-card {
    border: 0 !important;
    background: #fff !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.sp-related-item .product-card:hover {
    box-shadow: none !important;
    transform: none !important;
}

/* ---------- Tabs ---------- */
.sp-tabs-section {
    padding: 0 0 30px !important;
}

.sp-tabs-card {
    padding: 0 !important;
    border-radius: 18px !important;
    background: #fff !important;
    border: 1px solid #e0e0e2;
    overflow: hidden !important;
}

.sp-tabs-card .custom-product-tabs {
    width: 100%;
}

.sp-tabs-card .custom-tabs-nav {
    position: sticky;
    top: 84px;
    z-index: 6;
    width: 100%;
    margin: 0 !important;
    padding: 0 20px !important;
    border: 0 !important;
    border-bottom: 1px solid #eceef0 !important;
    border-radius: 0 !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: none !important;
    backdrop-filter: blur(8px);
    justify-content: flex-start;
    overflow-x: auto;
}

.sp-tabs-card .custom-tab-item {
    width: auto !important;
    min-width: max-content !important;
    height: 58px !important;
    padding: 0 18px !important;
    border-radius: 0 !important;
    color: #62666d !important;
    background: transparent !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

.sp-tabs-card .custom-tab-item.active {
    color: #0c0c0c !important;
}

.sp-tabs-card .custom-tab-item.active::after {
    left: 18px !important;
    right: 18px !important;
    bottom: 0 !important;
    height: 3px !important;
    background: var(--sp-red) !important;
}

.sp-tabs-card .custom-tabs-content {
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 32px 32px 42px;
}

.sp-tabs-card .custom-tab-panel h3 {
    text-align: right !important;
    font-size: 20px !important;
}

.sp-tabs-card .woocommerce-product-attributes.shop_attributes {
    gap: 12px 28px !important;
}

.sp-tabs-card .woocommerce-product-attributes-item {
    border-bottom: 1px solid #eceef0 !important;
    padding: 12px 0 !important;
}

/* ---------- Reviews ---------- */
.sp-review-section {
    padding: 0 0 60px !important;
}

.sp-review-card {
    border: 1px solid #e0e0e2;
    border-radius: 18px;
    background: #fff;
    padding: 28px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1480px) {
    .sp-product-layout {
        grid-template-columns: minmax(400px, .85fr) minmax(590px, 1.25fr) !important;
        gap: 28px !important;
    }

    .sp-summary-shell {
        grid-template-columns: minmax(0, 1fr) 305px;
        gap: 20px !important;
    }

    .sp-main-gallery {
        height: 540px !important;
        min-height: 540px;
    }

    .sp-gallery-thumbs-wrap {
        height: 540px !important;
    }

    .sp-gallery-thumbs {
        height: 478px !important;
    }
}

@media (max-width: 1180px) {
    .sp-container {
        width: min(100% - 32px, 1180px);
    }

    .sp-product-layout {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .sp-summary-shell {
        grid-template-columns: minmax(0, 1fr) 330px;
    }

    .sp-product-gallery {
        max-width: 820px !important;
        margin-inline: auto;
    }

    .sp-buy-card {
        top: 88px;
    }

    .sp-services-grid {
        grid-template-columns: repeat(3, minmax(0,1fr));
        gap: 0;
    }

    .sp-service-item:nth-child(3) {
        border-left: 0;
    }

    .sp-service-item:nth-child(n+4) {
        border-top: 1px solid #eff0f2;
        margin-top: 12px;
        padding-top: 16px;
    }
}

@media (max-width: 820px) {
    .sp-container {
        width: min(100% - 24px, 820px);
    }

    .sp-main-section {
        padding-top: 16px !important;
    }

    .sp-product-gallery {
        display: flex !important;
        flex-direction: column-reverse !important;
        direction: rtl;
    }

    .sp-main-gallery {
        width: 100% !important;
        height: 420px !important;
        min-height: 420px !important;
        border-radius: 18px !important;
    }

    .sp-main-gallery img {
        padding: 18px;
    }

    .sp-gallery-thumbs-wrap {
        width: 100% !important;
        height: 78px !important;
        flex: 0 0 auto;
    }

    .sp-gallery-thumbs {
        width: 100% !important;
        height: 78px !important;
    }

    .sp-gallery-thumbs .swiper-slide,
    .sp-thumb-slide {
        width: 72px !important;
        height: 72px !important;
        min-width: 72px !important;
    }

    .sp-gallery-badges {
        right: 12px;
        top: 12px;
    }

    .sp-gallery-next {
        display: none !important;
    }

    .sp-summary-shell {
        grid-template-columns: 1fr;
        gap: 18px !important;
    }

    .sp-buy-card {
        position: static;
        border-radius: 16px;
    }

    .sp-services-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .sp-service-item,
    .sp-service-item:nth-child(3) {
        border-left: 0;
        border-bottom: 1px solid #eff0f2;
        justify-content: flex-start;
    }

    .sp-service-item:nth-child(n+4) {
        margin-top: 0;
        padding-top: 6px;
        border-top: 0;
    }

    .sp-service-item:last-child {
        grid-column: 1 / -1;
        border-bottom: 0;
    }

    .sp-related-scroll {
        grid-auto-columns: 72%;
    }

    .sp-tabs-card .custom-tabs-content {
        padding: 24px 16px 30px;
    }

    .sp-review-card {
        padding: 18px;
    }
}

@media (max-width: 520px) {
    .sp-container {
        width: calc(100% - 20px);
    }

    .sp-main-gallery {
        height: 340px !important;
        min-height: 340px !important;
    }

    .sp-main-gallery img {
        padding: 10px;
    }

    .sp-sale-badge,
    .sp-image-count-badge {
        min-height: 28px;
        padding: 0 9px;
        font-size: 10px;
        border-radius: 8px;
    }

    .sp-summary-head h1 {
        font-size: 18px !important;
        line-height: 1.8 !important;
    }

    .sp-product-meta-line {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .sp-feature-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .sp-feature-card {
        padding: 10px;
    }

    .sp-section-title-row {
        align-items: flex-start;
    }

    .sp-buy-card {
        padding: 14px;
    }

    .sp-services-grid {
        padding: 8px 0;
    }

    .sp-service-item {
        padding: 12px 8px;
        gap: 8px;
    }

    .sp-service-item > span {
        width: 28px;
        height: 28px;
    }

    .sp-service-item strong {
        font-size: 11px;
    }

    .sp-service-item small {
        font-size: 9px;
    }

    .sp-related-products,
    .sp-tabs-card,
    .sp-review-card {
        border-radius: 14px !important;
    }

    .sp-related-head {
        min-height: 70px;
        padding: 14px;
    }

    .sp-related-head h2 {
        font-size: 16px;
    }

    .sp-related-scroll {
        grid-auto-columns: 82%;
    }

    .sp-related-item {
        padding: 10px;
    }

    .sp-tabs-card .custom-tabs-nav {
        padding: 0 8px !important;
    }

    .sp-tabs-card .custom-tab-item {
        height: 50px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
    }
}

/* =========================================================
   V2 layout corrections — gallery below, wider buy card,
   compact related products and rebuilt mobile flow.
   ========================================================= */

/* Main desktop proportions */
@media (min-width: 1181px) {
    .sp-product-layout {
        grid-template-columns: minmax(520px, .92fr) minmax(760px, 1.38fr) !important;
        gap: 32px !important;
    }

    .sp-summary-shell {
        grid-template-columns: minmax(0, 1fr) 390px !important;
        gap: 24px !important;
    }
}

@media (min-width: 1481px) {
    .sp-product-layout {
        grid-template-columns: minmax(590px, .96fr) minmax(820px, 1.42fr) !important;
        gap: 36px !important;
    }

    .sp-summary-shell {
        grid-template-columns: minmax(0, 1fr) 410px !important;
        gap: 28px !important;
    }
}

/* Gallery: main image first, thumbnails always below */
.sp-product-gallery {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    direction: rtl !important;
    max-width: none !important;
}

.sp-gallery-badges {
    top: 16px !important;
    right: 16px !important;
    left: auto !important;
}

.sp-main-gallery {
    order: 1;
    width: 100% !important;
    height: 570px !important;
    min-height: 570px !important;
    border-radius: 24px !important;
    border: 1px solid #e9eaed !important;
    background: #f7f7f8 !important;
}

.sp-main-gallery .sp-main-slide {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f7f7f8 !important;
}

.sp-main-gallery .sp-main-product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 26px !important;
    mix-blend-mode: multiply;
}

.sp-gallery-thumbs-row {
    order: 2;
    width: 100%;
    height: 86px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 10px;
    align-items: center;
    direction: rtl;
}

.sp-gallery-thumbs-row:not(:has(.sp-gallery-next)) {
    grid-template-columns: 1fr;
}

.sp-gallery-thumbs-wrap {
    width: 100% !important;
    height: auto !important;
    flex: none !important;
}

.sp-gallery-thumbs {
    width: 100% !important;
    height: 82px !important;
    min-height: 82px !important;
    overflow: hidden !important;
}

.sp-gallery-thumbs .swiper-wrapper {
    align-items: stretch !important;
    padding: 0 !important;
}

.sp-gallery-thumbs .swiper-slide,
.sp-thumb-slide {
    width: auto !important;
    height: 80px !important;
    min-width: 0 !important;
    border-radius: 14px !important;
    border: 1px solid #e1e3e6 !important;
    background: #fff !important;
    padding: 5px !important;
    overflow: hidden !important;
    cursor: pointer;
}

.sp-gallery-thumbs .swiper-slide-thumb-active,
.sp-gallery-thumbs .swiper-slide:hover {
    border-color: #fa7921 !important;
    box-shadow: 0 0 0 2px rgba(250,121,33,.08) !important;
}

.sp-gallery-thumbs .sp-thumb-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #f7f7f8 !important;
    mix-blend-mode: multiply;
}

.sp-gallery-next {
    position: static !important;
    inset: auto !important;
    margin: 0 !important;
    transform: none !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border: 1px solid #dfe1e5 !important;
    border-radius: 12px !important;
    background: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fa7921 !important;
    box-shadow: 0 6px 18px rgba(0,0,0,.05) !important;
}

.sp-gallery-next::after {
    display: none !important;
}

.sp-gallery-next img {
    width: 14px !important;
    height: 14px !important;
    transform: rotate(180deg);
}

/* The only color selector should be the variation selector in the buy card. */
.sp-gallery-color-bar,
.single-product-gallery > .sp-gallery-color-bar {
    display: none !important;
}

/* Buy card: wider and cleaner */
.sp-buy-card {
    padding: 20px !important;
    border-radius: 20px !important;
    background: #f7f7f8 !important;
    border-color: #dedfe3 !important;
}

.sp-seller-head {
    padding-bottom: 16px !important;
}

.sp-seller-head strong,
.sp-buy-card-row strong {
    font-size: 12px !important;
}

.sp-buy-card-row {
    padding: 16px 0 !important;
}

.sp-price-box {
    padding: 20px 0 12px !important;
}

.sp-price-box .single-product-price {
    min-height: 36px;
    align-items: center;
}

.sp-price-box ins,
.sp-price-box > .single-product-price > .price,
.sp-price-box .single-product-price > .woocommerce-Price-amount {
    font-size: 22px !important;
}

.sp-cart-box form.cart,
.sp-cart-box .variations_form.cart,
.sp-cart-box .simpleAddtocart {
    gap: 16px !important;
}

.sp-cart-box .variation-attr {
    gap: 16px !important;
}

.sp-cart-box .variation-attr > div {
    gap: 10px !important;
}

.sp-cart-box .custom-variations-wrapper {
    gap: 9px !important;
}

.sp-cart-box .color-swatch .swatch-circle {
    width: 32px !important;
    height: 32px !important;
}

.sp-cart-box .warranty-btn .btn-label {
    min-height: 42px !important;
    padding: 0 13px !important;
    border-radius: 10px !important;
    line-height: 1.65;
}

/* Avoid the second price block from the legacy add-to-cart templates. */
.sp-cart-box .wc-product-price {
    display: none !important;
}

.sp-cart-box .newDiv {
    display: grid !important;
    grid-template-columns: 108px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: stretch !important;
}

.sp-cart-box .newDiv > .flex {
    width: 100% !important;
    min-width: 0 !important;
    gap: 8px !important;
}

.sp-cart-box .quantity {
    width: 108px !important;
    min-width: 108px !important;
    height: 52px !important;
}
.sp-cart-box .yith-wcwl-add-to-wishlist,
.sp-cart-box .yith-wcwl-add-button,
.sp-cart-box .yith-wcwl-wishlistaddedbrowse,
.sp-cart-box .yith-wcwl-wishlistexistsbrowse {
    width: 48px !important;
    min-width: 48px !important;
    margin: 0 !important;
}

.sp-cart-box .yith-wcwl-add-to-wishlist a,
.sp-cart-box .yith-wcwl-add-button a {
    width: 48px !important;
    height: 52px !important;
    border-radius: 12px !important;
}

/* Related products: compact dedicated cards, 6 across desktop */
.sp-related-products {
    overflow: hidden !important;
}

.sp-related-head {
    min-height: 76px !important;
    padding: 16px 20px 12px !important;
}

.sp-related-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-top: 1px solid #eceef0;
}

.sp-related-card {
    min-width: 0;
    padding: 14px 12px 16px;
    border-left: 1px solid #eceef0;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: background-color .2s ease;
}

.sp-related-card:last-child {
    border-left: 0;
}

.sp-related-card:hover {
    background: #fdfdfd;
}

.sp-related-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #f7f7f8;
    overflow: hidden;
    margin-bottom: 12px;
}

.sp-related-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 10px;
    mix-blend-mode: multiply;
    transition: transform .22s ease;
}

.sp-related-card:hover .sp-related-image img {
    transform: scale(1.035);
}

.sp-related-card-body {
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

.sp-related-category {
    color: #fa7921;
    font-size: 10px;
    font-weight: 800;
    margin-bottom: 6px;
}

.sp-related-title {
    color: #272727;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.9;
    min-height: 46px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-related-colors {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    margin: 8px 0 4px;
}

.sp-related-colors span {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d9dce1;
}

.sp-related-price {
    margin-top: auto;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    color: #5f5f5f;
    font-size: 14px;
    font-weight: 900;
}

.sp-related-price ins {
    color: #f55157;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
}

.sp-related-price del {
    color: #a8a8a8;
    font-size: 10px;
    font-weight: 500;
}

.sp-related-price .woocommerce-Price-currencySymbol {
    font-size: 9px;
}

.sp-related-cta {
    height: 36px;
    margin-top: 8px;
    border-radius: 10px;
    background: #fff7f1;
    color: #fa7921;
    border: 1px solid rgba(250,121,33,.14);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 900;
    transition: all .2s ease;
}

.sp-related-cta:hover {
    background: #fa7921;
    color: #fff;
    border-color: #fa7921;
}

/* Tablet */
@media (max-width: 1180px) {
    .sp-product-layout {
        grid-template-columns: 1fr !important;
        gap: 22px !important;
    }

    .sp-product-gallery {
        width: min(100%, 760px) !important;
        margin-inline: auto;
    }

    .sp-main-gallery {
        height: 520px !important;
        min-height: 520px !important;
    }

    .sp-summary-shell {
        grid-template-columns: minmax(0, 1fr) 370px !important;
        gap: 20px !important;
    }

    .sp-related-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .sp-related-card:nth-child(4n) {
        border-left: 0;
    }

    .sp-related-card:nth-child(n+5) {
        border-top: 1px solid #eceef0;
    }
}

/* Mobile: intentionally rebuilt, not inherited from desktop */
@media (max-width: 820px) {
    .sp-main-section {
        padding-top: 10px !important;
        padding-bottom: 16px !important;
    }

    .sp-container {
        width: calc(100% - 20px) !important;
    }

    .sp-product-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    .sp-product-gallery {
        width: 100% !important;
        max-width: none !important;
        gap: 9px !important;
    }

    .sp-main-gallery {
        height: min(92vw, 390px) !important;
        min-height: min(92vw, 390px) !important;
        border-radius: 18px !important;
    }

    .sp-main-gallery .sp-main-product-image {
        padding: 12px !important;
    }

    .sp-gallery-badges {
        top: 10px !important;
        right: 10px !important;
    }

    .sp-gallery-thumbs-row {
        height: 66px !important;
        grid-template-columns: 1fr !important;
    }

    .sp-gallery-thumbs {
        height: 64px !important;
        min-height: 64px !important;
    }

    .sp-gallery-thumbs .swiper-slide,
    .sp-thumb-slide {
        height: 62px !important;
        border-radius: 11px !important;
    }

    .sp-gallery-next {
        display: none !important;
    }

    .sp-summary-shell {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    .sp-product-info {
        padding-top: 0 !important;
    }

    .sp-product-eyebrow {
        margin-bottom: 8px !important;
    }

    .sp-summary-head {
        padding-bottom: 14px !important;
    }

    .sp-summary-head h1 {
        font-size: 18px !important;
        line-height: 1.75 !important;
    }

    .sp-product-meta-line {
        margin-top: 8px !important;
    }

    .sp-features-block {
        padding: 16px 0 0 0 !important;
        border-bottom: 0px solid !important;
    }
    
    .sp-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    .sp-feature-card {
        padding: 10px !important;
        border-radius: 10px !important;
    }

    .sp-purchase-notes {
        display: none !important;
    }

    .sp-buy-card {
        position: static !important;
        top: auto !important;
        width: 100% !important;
        padding: 16px !important;
        border-radius: 16px !important;
        background: #f7f7f8 !important;
    }

    .sp-seller-head,
    .sp-buy-card-row {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    .sp-price-box {
        padding: 16px 0 8px !important;
    }

    .sp-price-box ins,
    .sp-price-box > .single-product-price > .price,
    .sp-price-box .single-product-price > .woocommerce-Price-amount {
        font-size: 20px !important;
    }

    .sp-cart-box .variation-attr {
        gap: 13px !important;
    }

    .sp-cart-box .warranty-btn .btn-label {
        min-height: 40px !important;
        padding: 0 10px !important;
        font-size: 10px !important;
    }

    .sp-cart-box .newDiv {
        grid-template-columns: 92px minmax(0, 1fr) !important;
        gap: 8px !important;
    }

    .sp-cart-box .quantity {
        width: 92px !important;
        min-width: 92px !important;
        height: 50px !important;
    }

    .sp-cart-box .newDiv > .flex {
        grid-template-columns: 46px minmax(0, 1fr) !important;
        gap: 7px !important;
    }

    .sp-cart-box .single_add_to_cart_button,
    .sp-cart-box .yith-wcwl-add-to-wishlist a,
    .sp-cart-box .yith-wcwl-add-button a {
        height: 50px !important;
        min-height: 50px !important;
    }

    .sp-services-section {
        padding-bottom: 16px !important;
    }

    .sp-services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        padding: 8px 0 !important;
    }

    .sp-service-item {
        min-height: 70px;
        justify-content: flex-start !important;
        border-left: 0 !important;
        border-bottom: 1px solid #eff0f2;
        padding: 10px 8px !important;
    }

    .sp-service-item:last-child {
        grid-column: 1 / -1;
        border-bottom: 0;
    }

    .sp-related-wrapper {
        padding-bottom: 18px !important;
    }

    .sp-related-head {
        min-height: 68px !important;
        padding: 12px 14px 10px !important;
    }

    .sp-related-head h2 {
        font-size: 16px !important;
    }

    .sp-related-grid {
        display: grid !important;
        grid-auto-flow: column;
        grid-auto-columns: minmax(170px, 46vw);
        grid-template-columns: none !important;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: inline proximity;
        scrollbar-width: none;
    }

    .sp-related-grid::-webkit-scrollbar {
        display: none;
    }

    .sp-related-card {
        scroll-snap-align: start;
        padding: 10px !important;
        border-top: 0 !important;
        border-left: 1px solid #eceef0 !important;
    }

    .sp-related-image {
        border-radius: 12px !important;
        margin-bottom: 9px !important;
    }

    .sp-related-card-body {
        min-height: 148px !important;
    }

    .sp-related-title {
        font-size: 11px !important;
        min-height: 42px !important;
    }

    .sp-related-cta {
        height: 34px !important;
        font-size: 10px !important;
    }

    .sp-tabs-card .custom-tabs-nav {
        top: 64px !important;
        padding: 0 8px !important;
    }

    .sp-tabs-card .custom-tab-item {
        height: 50px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
    }

    .sp-tabs-card .custom-tabs-content {
        padding: 20px 14px 26px !important;
    }

    .sp-review-card {
        padding: 14px !important;
    }
    .sp-services-grid {
    border-top: 1px solid #eceef0;
    border-bottom: 0px solid !important;
    }
}



@media (max-width: 480px) {
    .sp-container {
        width: calc(100% - 16px) !important;
    }

    .sp-main-gallery {
        height: min(94vw, 350px) !important;
        min-height: min(94vw, 350px) !important;
    }

    .sp-feature-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .sp-buy-card {
        padding: 14px !important;
    }

    .sp-cart-box .newDiv {
        grid-template-columns: 84px minmax(0, 1fr) !important;
    }

    .sp-cart-box .quantity {
        width: 84px !important;
        min-width: 84px !important;
    }

    .sp-related-grid {
        grid-auto-columns: minmax(158px, 48vw);
    }
}

/* =========================================================
   Single product — variation interaction & live price V5
   ========================================================= */

/*
 * Variation UX: هر Option که با انتخاب فعلی Variation قابل خرید ندارد
 * به‌طور کامل از رابط حذف می‌شود تا کاربر ترکیب غیرقابل سفارش نبیند.
 */
.sp-cart-box .custom-variations-wrapper .color-swatch,
.sp-cart-box .custom-variations-wrapper .warranty-btn {
    position: relative;
}

.sp-cart-box .custom-variations-wrapper .is-combination-hidden,
.sp-cart-box .custom-variations-wrapper [hidden].color-swatch,
.sp-cart-box .custom-variations-wrapper [hidden].warranty-btn {
    display: none !important;
}

/* Target اصلی WooCommerce برای Availability باقی می‌ماند، اما قیمت دوم مخفی می‌شود. */
.sp-cart-box .variation-price .woocommerce-variation-price,
.sp-cart-box .variation-price .price {
    display: none !important;
}

/* باکس قیمت زنده */
.sp-buy-card .sp-price-box {
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 14px 0 25px !important;
    padding: 13px !important;
    border: 1px solid rgba(250, 121, 33, .18) !important;
    border-radius: 14px !important;
    background: radial-gradient(circle at 100% 0, rgba(250, 121, 33, .09), transparent 45%), #fff !important;
    box-shadow: 0 8px 24px rgba(35, 37, 78, .045) !important;
}

.sp-price-cart-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sp-orange);
    background: #fff5ed;
    border: 1px solid rgba(250, 121, 33, .16);
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .55);
}

.sp-price-cart-icon svg {
    width: 23px !important;
    height: 23px !important;
    display: block;
}

.sp-price-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sp-price-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sp-buy-card .sp-price-box .price-label {
    margin: 0 !important;
    color: #81858b !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-align: right !important;
}

.sp-price-mode {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #fff7f1;
    color: var(--sp-orange);
    border: 1px solid rgba(250, 121, 33, .14);
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

.sp-buy-card .sp-price-box .single-product-price {
    min-height: 31px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    line-height: 1.4;
}

.sp-buy-card .sp-price-box .single-product-price .price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.sp-buy-card .sp-price-box .single-product-price ins {
    background: transparent !important;
    text-decoration: none !important;
}

.sp-buy-card .sp-price-box .single-product-price ins,
.sp-buy-card .sp-price-box .single-product-price ins .amount {
    color: #F55157 !important;
}

.sp-buy-card .sp-price-box .single-product-price del {
    order: 2;
    color: #999 !important;
    opacity: 1 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    text-decoration: line-through !important;
}

.sp-buy-card .sp-price-box .single-product-price del .amount {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

.sp-buy-card .sp-price-box .single-product-price ins,
.sp-buy-card .sp-price-box .single-product-price > .woocommerce-Price-amount,
.sp-buy-card .sp-price-box .single-product-price .price > .woocommerce-Price-amount,
.sp-buy-card .sp-price-box .single-product-price ins .woocommerce-Price-amount {
    order: 1;
    color: var(--sp-red) !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
}

.sp-price-hint {
    color: #9a9da4;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.7;
}

#sp-dynamic-product-price.is-price-updated {
    animation: spPricePulse .32s ease both;
}

@keyframes spPricePulse {
    0% {
        opacity: .35;
        transform: translateY(3px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .sp-buy-card .sp-price-box {
        grid-template-columns: 42px minmax(0, 1fr) !important;
        gap: 10px !important;
        margin-top: 12px !important;
        padding: 11px !important;
        border-radius: 13px !important;
    }

    .sp-price-cart-icon {
        width: 42px;
        height: 42px;
        border-radius: 11px;
    }

    .sp-price-cart-icon svg {
        width: 21px !important;
        height: 21px !important;
    }

    .sp-buy-card .sp-price-box .single-product-price ins,
    .sp-buy-card .sp-price-box .single-product-price > .woocommerce-Price-amount,
    .sp-buy-card .sp-price-box .single-product-price .price > .woocommerce-Price-amount,
    .sp-buy-card .sp-price-box .single-product-price ins .woocommerce-Price-amount {
        font-size: 18px !important;
    }
}
.quantity.flex.rounded-lg.border.border-gray-5.w-fit {
    display: none;
}

/* VNext — product detail alignment and summary refinements */
.sp-product-layout {
    align-items: stretch !important;
}

.sp-product-layout > .sp-product-gallery,
.sp-product-layout > .sp-summary-shell,
.sp-summary-shell > .sp-product-info,
.sp-summary-shell > .sp-buy-card {
    height: 100%;
}

.sp-summary-shell {
    align-items: stretch !important;
}

.sp-product-info,
.sp-buy-card {
    display: flex;
    flex-direction: column;
}

.sp-product-info {
    justify-content: flex-start;
}

/* Keep the original WooCommerce star markup exactly as-is; only rearrange the row. */
.sp-product-meta-line {
    justify-content: flex-start !important;
}

.sp-rating-wrap {
    width: 100%;
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.sp-rating-wrap > .woocommerce-product-rating {
    display: contents !important;
}

.sp-rating-wrap .star-rating {
    order: 1;
    flex: 0 0 auto;
    margin: 0 !important;
}

.sp-rating-wrap > .sp-review-count {
    order: 2;
    flex: 0 0 auto;
}

.sp-rating-wrap .single-video-link {
    order: 3;
    margin-right: auto !important;
    flex: 0 0 auto;
    white-space: nowrap;
}

.sp-review-count {
    color: #1f6fe5;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.6;
    text-decoration: none;
    white-space: nowrap;
}

.sp-review-count:hover {
    color: #0c5fd8;
}

.single-video-link span {
    font-weight: 800;
}

.sp-buy-card {
    justify-content: flex-start;
}

.sp-seller-head,
.sp-seller-status {
    display: none !important;
}

/* Shipping is now the only service/status block in the buy card. */
.sp-buy-card-row--shipping {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.sp-buy-card-row--shipping .sp-buy-row-icon {
    color: #3f4064 !important;
    border-color: #e2e4e8 !important;
    background: #ffffff !important;
}

.sp-buy-card-row--shipping > div > span {
    color: #3f4064 !important;
}

.sp-buy-card-row--shipping strong {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    width: max-content;
    max-width: 100%;
    color: #18a36a !important;
}

.sp-buy-card-row--shipping strong::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 999px;
    background: #18a36a;
    box-shadow: 0 0 0 4px rgba(24, 163, 106, .10);
}

.sp-buy-card .sp-price-box {
    grid-template-columns: minmax(0, 1fr) !important;
    padding-top: 18px !important;
}

.sp-price-cart-icon {
    display: none !important;
}

.sp-buy-card .sp-price-box .sp-price-content {
    align-items: flex-start;
}

.sp-buy-card .sp-price-box .single-product-price {
    min-height: 38px !important;
}

.sp-buy-card .sp-price-box .single-product-price ins,
.sp-buy-card .sp-price-box .single-product-price > .woocommerce-Price-amount,
.sp-buy-card .sp-price-box .single-product-price .price > .woocommerce-Price-amount,
.sp-buy-card .sp-price-box .single-product-price ins .woocommerce-Price-amount {
    font-size: 24px !important;
    font-weight: 900 !important;
}

.sp-buy-card .sp-price-box .single-product-price del,
.sp-buy-card .sp-price-box .single-product-price del .woocommerce-Price-amount {
    font-size: 14px !important;
}

@media (max-width: 767px) {
    .sp-rating-wrap {
        gap: 8px;
        flex-wrap: wrap;
    }

    .sp-rating-wrap .single-video-link {
        margin-right: auto !important;
    }

    .sp-review-count {
        font-size: 13px;
    }

    .sp-buy-card .sp-price-box .single-product-price ins,
    .sp-buy-card .sp-price-box .single-product-price > .woocommerce-Price-amount,
    .sp-buy-card .sp-price-box .single-product-price .price > .woocommerce-Price-amount,
    .sp-buy-card .sp-price-box .single-product-price ins .woocommerce-Price-amount {
        font-size: 22px !important;
    }
}

/* =========================================================
   Desktop alignment fix — baseline binoisetheme1
   1) Keep the three desktop columns inside the viewport down to tablet.
   2) Keep rating/review/video actions inside the middle column.
   3) Push the live-stock region to the bottom of the middle column so its
      visual bottom aligns with the gallery and buy card.
   ========================================================= */
@media (min-width: 1181px) and (max-width: 1480px) {
    .sp-product-layout {
        grid-template-columns: minmax(430px, .92fr) minmax(0, 1.38fr) !important;
        gap: 24px !important;
    }

    .sp-summary-shell {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 350px) !important;
        gap: 20px !important;
    }
}

@media (min-width: 1181px) {
    .sp-product-layout > .bnoise-product-gallery,
    .sp-product-layout > .sp-summary-shell {
        height: 100% !important;
        min-height: 0;
    }

    .sp-product-info {
        height: 100% !important;
        min-height: 0;
    }

    .sp-product-info > .sp-purchase-notes {
        margin-top: auto;
    }
}

/* The old rule gave the review link width:100%, which pushed the video link
   outside the middle column on compact desktop widths. */
@media (min-width: 821px) {
    .sp-product-meta-line,
    .sp-rating-wrap {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .sp-rating-wrap > .sp-review-count {
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
    }

    .sp-rating-wrap .single-video-link {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        margin-right: auto !important;
        margin-left: 0 !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
    }
}

/* Mobile only — keep product video, stars and review count on one compact row. */
@media (max-width: 767px) {
    .sp-product-meta-line {
        width: 100% !important;
    }

    .sp-rating-wrap {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        min-width: 0 !important;
    }

    .sp-rating-wrap .single-video-link {
        order: 0 !important;
        margin: 0 !important;
        flex: 0 0 auto !important;
        gap: 5px !important;
        font-size: 12px !important;
        line-height: 1.5 !important;
        white-space: nowrap !important;
    }

    .sp-rating-wrap .single-video-link img {
        width: 16px !important;
        height: 16px !important;
    }

    .sp-rating-wrap .star-rating {
        order: 1 !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    .sp-rating-wrap > .sp-review-count {
        order: 2 !important;
        width: auto !important;
        margin: 0 !important;
        flex: 0 0 auto !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }
}
@media (max-width: 767px) {

    .sp-rating-wrap > .woocommerce-product-rating {
        display: flex !important;
        width: 100% !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
    }

    .sp-rating-wrap > .woocommerce-product-rating .single-video-link {
        margin: 0 !important;
        flex: 0 0 auto !important;
    }

    .sp-rating-wrap > .woocommerce-product-rating .star-rating {
        margin: 0 !important;
        flex: 0 0 auto !important;
    }

    .sp-rating-wrap > .woocommerce-product-rating .woocommerce-review-link,
    .sp-rating-wrap > .woocommerce-product-rating .sp-review-count {
        margin: 0 !important;
        flex: 0 0 auto !important;
    }
}

/* =========================================================
   Scheduled sale countdown — single product buy card
   Uses the exact WooCommerce sale end date and follows the
   selected variation when variation-specific dates exist.
   ========================================================= */
.sp-sale-countdown {
    position: relative;
    display: grid;
    gap: 10px;
    margin: 2px 0 4px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid rgba(254, 94, 34, .18);
    border-radius: 16px;
    background:
            radial-gradient(circle at 100% 0, rgba(254, 94, 34, .10), transparent 34%),
            linear-gradient(145deg, #fff 0%, #fff9f5 100%);
}

.sp-sale-countdown::after {
    content: "";
    position: absolute;
    left: -28px;
    bottom: -38px;
    width: 104px;
    height: 104px;
    border: 1px solid rgba(254, 94, 34, .08);
    border-radius: 50%;
    pointer-events: none;
}

.sp-sale-countdown[hidden],
.sp-sale-countdown.is-hidden {
    display: none !important;
}

.sp-sale-countdown__head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sp-sale-countdown__badge {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--sp-orange, #fe5e22);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    box-shadow: 0 7px 16px rgba(254, 94, 34, .16);
}

.sp-sale-countdown__label {
    color: #7a7f88;
    font-size: 9px;
    line-height: 1.6;
    font-weight: 800;
}

.sp-sale-countdown__timer {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.sp-sale-countdown__timer > span {
    min-width: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px;
    border: 1px solid #eceef1;
    border-radius: 11px;
    background: rgba(255, 255, 255, .94);
}

.sp-sale-countdown__timer strong {
    color: #34364c;
    font-size: 14px;
    line-height: 1;
    font-weight: 950;
}

.sp-sale-countdown__timer small {
    color: #999da5;
    font-size: 8px;
    line-height: 1;
    font-weight: 700;
}

@media (max-width: 767px) {
    .sp-sale-countdown {
        padding: 10px;
        border-radius: 14px;
    }

    .sp-sale-countdown__head {
        align-items: flex-start;
    }

    .sp-sale-countdown__label {
        max-width: 62%;
        text-align: left;
    }

    .sp-sale-countdown__timer {
        gap: 5px;
    }

    .sp-sale-countdown__timer > span {
        min-height: 45px;
        flex-direction: column;
        gap: 2px;
    }

    .sp-sale-countdown__timer strong {
        font-size: 13px;
    }
}

