/*
 * Liquid Markets Single Product Preview
 * Version 0.6.0
 */

body.lmsr-single-preview {
    --lmsr-bg: #050b1c;
    --lmsr-panel: #10273a;
    --lmsr-border: #294c60;
    --lmsr-accent: #56efc7;
    --lmsr-text: #f2f8ff;
    --lmsr-muted: #a8bfd0;
}

/* Product layout */

body.lmsr-single-preview .summary.entry-summary {
    position: relative;
}

body.lmsr-single-preview .summary.entry-summary > .price {
    margin-bottom: 20px;
}

body.lmsr-single-preview .woocommerce-product-gallery img {
    border-radius: 18px;
    max-height: 470px;
    width: 100%;
    object-fit: contain;
}

/* Feature cards */

body.lmsr-single-preview .lmsr-product-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0 24px;
}

body.lmsr-single-preview .lmsr-product-feature {
    padding: 18px;
    border: 1px solid var(--lmsr-border);
    border-radius: 14px;
    background: var(--lmsr-panel);
}

body.lmsr-single-preview .lmsr-product-feature span {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    color: var(--lmsr-muted);
}

body.lmsr-single-preview .lmsr-product-feature strong {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--lmsr-accent);
}

/* Variation selectors */

body.lmsr-single-preview .lmsr-choice-group {
    margin: 12px 0 20px;
}

body.lmsr-single-preview .lmsr-choice-title {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--lmsr-text);
}

body.lmsr-single-preview .lmsr-choice-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.lmsr-single-preview .lmsr-choice {
    min-height: 56px;
    padding: 12px;
    border: 1px solid #35596e;
    border-radius: 12px;
    background: #132c40;
    color: #edf9ff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all .2s ease;
}

body.lmsr-single-preview .lmsr-choice:hover {
    border-color: var(--lmsr-accent);
    background: #173e4a;
}

body.lmsr-single-preview .lmsr-choice.is-selected {
    background: #11564a;
    border-color: var(--lmsr-accent);
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--lmsr-accent);
}

body.lmsr-single-preview .lmsr-choice:focus-visible {
    outline: 3px solid var(--lmsr-accent);
    outline-offset: 3px;
}

body.lmsr-single-preview .lmsr-choice:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/*
 * Hide native variation rows visually only after JS
 * successfully enhances the form.
 */

body.lmsr-single-preview
.lmsr-enhanced-form
.lmsr-native-variation-row {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.lmsr-single-preview
.lmsr-custom-variation-row td {
    padding: 0 !important;
    border: 0 !important;
}

body.lmsr-single-preview
.lmsr-custom-variation-row {
    background: transparent;
}

/* Selected price */

body.lmsr-single-preview .lmsr-selected-price {
    margin: 20px 0;
    padding: 20px 22px;
    border: 1px solid #31746b;
    border-radius: 14px;
    background: #0d332f;
}

body.lmsr-single-preview .lmsr-selected-price-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    color: #b8d7d0;
}

body.lmsr-single-preview .lmsr-selected-price-value {
    font-size: 30px;
    line-height: 1.3;
    font-weight: 800;
    color: var(--lmsr-accent);
}

body.lmsr-single-preview
.lmsr-enhanced-form
.woocommerce-variation-price {
    display: none;
}

/* Purchase CTA */

body.lmsr-single-preview
.lmsr-enhanced-form
.single_add_to_cart_button {
    min-height: 56px;
    padding: 15px 28px;
    border-radius: 12px;
    background: #42c9aa;
    color: #062b2a;
    font-weight: 800;
    font-size: 15px;
    text-transform: uppercase;
}

body.lmsr-single-preview
.lmsr-enhanced-form
.single_add_to_cart_button:hover {
    background: #6af2d1;
}

body.lmsr-single-preview
.lmsr-enhanced-form
.single_add_to_cart_button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* Short description repositioned after purchase form */

body.lmsr-single-preview .lmsr-introduction {
    margin-top: 28px;
    padding: 22px;
    border: 1px solid #203c4e;
    border-radius: 14px;
    background: #0b1b2c;
    color: var(--lmsr-muted);
    font-size: 14px;
    line-height: 1.8;
}

body.lmsr-single-preview .lmsr-introduction p {
    margin-bottom: 12px;
}

/* Responsive */

@media (max-width: 767px) {

    body.lmsr-single-preview .lmsr-product-features {
        gap: 9px;
    }

    body.lmsr-single-preview .lmsr-product-feature {
        padding: 13px;
    }

    body.lmsr-single-preview .lmsr-product-feature strong {
        font-size: 17px;
    }

    body.lmsr-single-preview .lmsr-choice {
        min-height: 52px;
        font-size: 14px;
    }

    body.lmsr-single-preview
    .lmsr-enhanced-form
    .single_add_to_cart_button {
        width: 100%;
        margin-top: 12px;
    }
}

/* ===================================================
   Liquid Markets Product Finalization v0.7.0
   Administrator-only staging preview
   =================================================== */

body.lmsr-single-preview .lmsr-compact-overview {
    margin: 12px 0 20px;
    padding: 0;
    color: #b8cad8;
    font-size: 14px;
    line-height: 1.7;
}

body.lmsr-single-preview .lmsr-compact-overview p {
    margin: 0;
}

body.lmsr-single-preview .lmsr-terms-notice {
    margin: 18px 0;
    font-size: 13px;
    line-height: 1.7;
    color: #b6cad8;
}

body.lmsr-single-preview .lmsr-terms-notice a {
    color: #65f2cd;
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.lmsr-single-preview .lmsr-staging-notice {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 14px 0 20px;
    padding: 13px 16px;
    border: 1px solid #4c6575;
    border-radius: 11px;
    background: #142537;
    color: #c4d5df;
    font-size: 12px;
    line-height: 1.6;
}

body.lmsr-single-preview .lmsr-staging-notice strong {
    color: #f0f7fc;
    font-size: 13px;
}

/* Selected price */

body.lmsr-single-preview
.lmsr-finalized-form
.lmsr-selected-price {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
}

body.lmsr-single-preview
.lmsr-finalized-form
.lmsr-selected-price-value {
    overflow-wrap: anywhere;
}

/* Purchase controls */

body.lmsr-single-preview
.lmsr-finalized-form
.woocommerce-variation-add-to-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

body.lmsr-single-preview
.lmsr-finalized-form
.variation-shop-perched-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
}

body.lmsr-single-preview
.lmsr-finalized-form
.single_add_to_cart_button {
    min-width: 200px;
    min-height: 54px;
    padding: 14px 22px;
    font-weight: 800;
    border-radius: 11px;
}

/*
 * Disabled controls must remain visibly unavailable.
 * The staging safety plugin continues to block purchases.
 */

body.lmsr-single-preview
.lmsr-finalized-form
.single_add_to_cart_button.disabled,
body.lmsr-single-preview
.lmsr-finalized-form
.single_add_to_cart_button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Mobile layout */

@media (max-width: 767px) {

    body.lmsr-single-preview
    .woocommerce-product-gallery img {
        max-height: 260px;
        width: 100%;
        object-fit: contain;
    }

    body.lmsr-single-preview
    .lmsr-product-features {
        margin: 14px 0 18px;
        gap: 8px;
    }

    body.lmsr-single-preview
    .lmsr-product-feature {
        padding: 12px;
        min-width: 0;
    }

    body.lmsr-single-preview
    .lmsr-product-feature strong {
        font-size: 16px;
        overflow-wrap: anywhere;
    }

    body.lmsr-single-preview
    .lmsr-choice-group {
        margin: 10px 0 16px;
    }

    body.lmsr-single-preview
    .lmsr-choice-options {
        gap: 8px;
    }

    body.lmsr-single-preview
    .lmsr-choice {
        min-width: 0;
        min-height: 48px;
        padding: 10px 8px;
        font-size: 13px;
    }

    body.lmsr-single-preview
    .lmsr-selected-price {
        padding: 16px;
    }

    body.lmsr-single-preview
    .lmsr-selected-price-value {
        font-size: 25px;
    }

    body.lmsr-single-preview
    .lmsr-finalized-form
    .variation-shop-perched-info {
        flex-direction: column;
        align-items: stretch;
    }

    body.lmsr-single-preview
    .lmsr-finalized-form
    .single_add_to_cart_button {
        width: 100%;
        min-width: 0;
        margin: 0;
    }
}

@media (max-width: 359px) {

    body.lmsr-single-preview
    .lmsr-product-feature strong {
        font-size: 14px;
    }

    body.lmsr-single-preview
    .lmsr-choice {
        font-size: 12px;
    }
}

/* ============================================================
   LMSR_MOBILE_REFINEMENT_V071
   Version 0.7.1
   Administrator-only staging product preview
   ============================================================ */

@media (max-width: 767px) {

    /*
     * Keep the product gallery compact.
     * Preserve native WooCommerce gallery functionality.
     */

    body.lmsr-single-preview
    .shop-details-flex-wrap {
        margin-bottom: 18px;
    }

    body.lmsr-single-preview
    .woocommerce-product-gallery {
        max-width: 100%;
        margin-bottom: 12px;
    }

    body.lmsr-single-preview
    .woocommerce-product-gallery__wrapper {
        margin-bottom: 0;
    }

    body.lmsr-single-preview
    .woocommerce-product-gallery__image {
        text-align: center;
    }

    body.lmsr-single-preview
    .woocommerce-product-gallery img {
        display: block;
        width: 100%;
        max-height: 220px;
        height: auto;
        margin-left: auto;
        margin-right: auto;
        object-fit: contain;
        border-radius: 12px;
    }

    /*
     * Reduce unnecessary spacing in the product summary.
     */

    body.lmsr-single-preview
    .summary.entry-summary {
        margin-top: 0;
    }

    body.lmsr-single-preview
    .summary.entry-summary .product_title {
        margin-bottom: 10px;
    }

    body.lmsr-single-preview
    .summary.entry-summary > .price {
        margin-bottom: 12px;
    }

    /*
     * Keep feature cards aligned in two columns.
     */

    body.lmsr-single-preview
    .lmsr-product-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 14px;
        margin-bottom: 18px;
    }

    body.lmsr-single-preview
    .lmsr-product-feature {
        min-width: 0;
        padding: 12px;
    }

    body.lmsr-single-preview
    .lmsr-product-feature strong {
        font-size: 16px;
        line-height: 1.35;
    }

    /*
     * Keep account-size and platform choices usable.
     */

    body.lmsr-single-preview
    .lmsr-choice-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.lmsr-single-preview
    .lmsr-choice {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 10px 8px;
        font-size: 13px;
    }

    /*
     * Make the price panel and purchase controls responsive.
     */

    body.lmsr-single-preview
    .lmsr-selected-price {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.lmsr-single-preview
    .lmsr-finalized-form
    .woocommerce-variation-add-to-cart {
        width: 100%;
        max-width: 100%;
    }

    body.lmsr-single-preview
    .lmsr-finalized-form
    .single_add_to_cart_button {
        width: 100%;
        min-width: 0;
    }
}


/* ==========================================================
   LMSR_VISUAL_POLISH_V072
   Product price presentation
   ========================================================== */

body.lmsr-single-preview .lmsr-selected-price-value del,
body.lmsr-single-preview .lmsr-selected-price-value del .woocommerce-Price-amount {
    color: #8fa9b5;
    opacity: 1;
    font-size: 18px;
    font-weight: 500;
}

body.lmsr-single-preview .lmsr-selected-price-value del {
    margin-right: 10px;
}

body.lmsr-single-preview .lmsr-selected-price-value ins,
body.lmsr-single-preview .lmsr-selected-price-value ins .woocommerce-Price-amount {
    color: #56efc7;
    text-decoration: none;
    font-size: 32px;
    font-weight: 800;
}

body.lmsr-single-preview .lmsr-savings-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 10px;
    padding: 5px 12px;
    border: 1px solid #4bcba8;
    border-radius: 999px;
    background: rgba(86,239,199,.12);
    color: #56efc7;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
}

@media (max-width: 767px) {
    body.lmsr-single-preview .lmsr-selected-price {
        padding: 16px;
        margin-top: 18px;
        margin-bottom: 16px;
    }

    body.lmsr-single-preview .lmsr-selected-price-value del,
    body.lmsr-single-preview .lmsr-selected-price-value del .woocommerce-Price-amount {
        font-size: 16px;
    }

    body.lmsr-single-preview .lmsr-selected-price-value ins,
    body.lmsr-single-preview .lmsr-selected-price-value ins .woocommerce-Price-amount {
        font-size: 28px;
    }

    body.lmsr-single-preview .grecaptcha-badge {
        bottom: 8px !important;
        transform: scale(.82);
        transform-origin: bottom right;
    }
}


/* ==========================================================
   LMSR_MOBILE_GALLERY_V073
   Mobile product image presentation
   ========================================================== */

@media (max-width: 767px) {

    body.lmsr-single-preview
    .woocommerce-product-gallery img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 340px;
        margin-left: auto;
        margin-right: auto;
        object-fit: contain;
        border-radius: 12px;
    }

    body.lmsr-single-preview
    .woocommerce-product-gallery {
        max-width: 100%;
        margin-bottom: 16px;
    }

}
