/* ============================================================================
   NV Conversion Booster — Frontend Styles
   Version: 1.2.11
   ============================================================================ */

/* ── Countdown Bar ───────────────────────────────────────────────────────── */

.nvcb-countdown-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f0fdf9;
    border: 1px solid #99f6e4;
    border-radius: 6px;
    font-size: 14px;
    color: #0f766e;
    font-weight: 500;
    margin: 0 0 10px;
}

.nvcb-countdown-bar.nvcb-urgent {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.nvcb-countdown-bar__label {
    flex: 1;
}

.nvcb-countdown-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
    min-width: 42px;
    text-align: right;
}

/* ── Viewer Count ────────────────────────────────────────────────────────── */

.nvcb-viewer-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    margin: 0 0 10px;
    transition: opacity 0.3s ease;
}

.nvcb-viewer-icon {
    font-size: 15px;
}

.nvcb-viewer-number {
    font-weight: 700;
    color: #0f766e;
}

.nvcb-viewer-label {
    color: #6b7280;
}

/* ── Review Stars ────────────────────────────────────────────────────────── */

.nvcb-review-stars {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    font-size: 13px;
    color: #6b7280;
}

.nvcb-stars-display {
    position: relative;
    display: inline-block;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.nvcb-stars-empty {
    color: #d1d5db;
}

.nvcb-stars-filled {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    white-space: nowrap;
    color: #f59e0b;
}

.nvcb-review-rating {
    font-weight: 700;
    color: #111827;
    font-size: 14px;
}

.nvcb-review-count {
    color: #6b7280;
    font-size: 12px;
}

/* ── Urgency Copy ────────────────────────────────────────────────────────── */

.nvcb-urgency-copy {
    font-size: 13px;
    color: #0f766e;
    font-weight: 500;
    margin: 0 0 12px;
    padding: 6px 10px;
    background: #f0fdf9;
    border-left: 3px solid #0f766e;
    border-radius: 0 4px 4px 0;
}

.nvcb-stock-scarcity {
    font-size: 13px;
    color: #b45309;
    font-weight: 700;
    margin: 0 0 12px;
    padding: 6px 10px;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 0 4px 4px 0;
}

/* ── Sticky Add-to-Cart Bar ──────────────────────────────────────────────── */

#nvcb-sticky-atc {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 9999;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.10);
    padding: 10px 16px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}

/* Keep element in DOM so CSS transition can fire, but hide it visually */
#nvcb-sticky-atc[hidden] {
    display: block !important;
    visibility: hidden;
    pointer-events: none;
}

#nvcb-sticky-atc.is-visible {
    transform: translateY(0);
    visibility: visible;
    pointer-events: all;
}

body.nvcb-sticky-atc-active .elementor-widget-wc-add-to-cart[data-settings*="sticky"],
body.nvcb-sticky-atc-active .elementor-sticky--active.elementor-widget-wc-add-to-cart,
body.nvcb-sticky-atc-active [data-nvcb-suppressed-sticky-atc="1"] {
    display: none !important;
}

#nvcb-sticky-atc a.added_to_cart,
#nvcb-sticky-atc a.wc-forward {
    display: none !important;
}

.nvcb-sticky-atc__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.nvcb-sticky-atc__img {
    width: 40px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f3f4f6;
}

.nvcb-sticky-atc__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nvcb-sticky-atc__name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.nvcb-sticky-atc__savings {
    font-size: 12px;
    color: #0f766e;
    font-weight: 500;
    display: block;
}

/* WooCommerce wraps prices in <ins> inside wc_price() output */
.nvcb-sticky-atc__savings ins,
.nvcb-sticky-atc__price ins {
    text-decoration: none;
}

.nvcb-sticky-atc__price {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    flex-shrink: 0;
    white-space: nowrap;
}

.nvcb-sticky-atc__variants {
    display: none;
    flex-shrink: 0;
}

.nvcb-sticky-atc--with-variants .nvcb-sticky-atc__variants {
    display: block;
}

.nvcb-sticky-atc__variant-select {
    appearance: none;
    min-width: 120px;
    max-width: 170px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    padding: 8px 30px 8px 10px;
    background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position: calc(100% - 14px) calc(50% - 1px), calc(100% - 10px) calc(50% - 1px);
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
}

.nvcb-sticky-atc__variant-select:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
}

.nvcb-sticky-atc__variant-control {
    position: relative;
    display: none;
    width: 100%;
}

.nvcb-sticky-atc__variant-button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2;
    padding: 10px 12px;
    cursor: pointer;
}

.nvcb-sticky-atc__variant-button:hover {
    background: #ffffff !important;
    color: #111827 !important;
}

.nvcb-sticky-atc__variant-button:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.nvcb-sticky-atc__variant-button-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nvcb-sticky-atc__variant-button-icon {
    width: 0;
    height: 0;
    flex: 0 0 auto;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #6b7280;
}

.nvcb-sticky-atc--variant-menu-open .nvcb-sticky-atc__variant-button-icon {
    transform: rotate(180deg);
}

.nvcb-sticky-atc__variant-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 10001;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.20);
}

.nvcb-sticky-atc__variant-option {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 7px;
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2;
    text-align: left;
    padding: 9px 10px;
    cursor: pointer;
}

.nvcb-sticky-atc__variant-option:hover,
.nvcb-sticky-atc__variant-option:focus,
.nvcb-sticky-atc__variant-option.is-selected {
    outline: none;
    background: #f0fdf9 !important;
    color: #0f766e !important;
}

.nvcb-sticky-atc__btn {
    flex-shrink: 0;
    background: #0f766e;
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.nvcb-sticky-atc__btn:hover {
    background: #0d6b64;
    color: #ffffff !important;
}

.nvcb-sticky-atc__btn:active {
    transform: scale(0.97);
}

.nvcb-sticky-atc__btn.is-loading {
    opacity: 0.7;
    cursor: wait;
}

.nvcb-sticky-atc__btn.is-added {
    background: #059669;
}

/* Variable product: neutral button since we scroll-to instead of direct ATC */
.nvcb-sticky-atc--variable .nvcb-sticky-atc__btn {
    background: #374151;
}

.nvcb-sticky-atc--variable .nvcb-sticky-atc__btn:hover {
    background: #1f2937;
}

/* When variant dropdown is enabled, variable products add directly from sticky bar. */
.nvcb-sticky-atc--with-variants .nvcb-sticky-atc__btn {
    background: #0f766e;
}

.nvcb-sticky-atc--with-variants .nvcb-sticky-atc__btn:hover {
    background: #0d6b64;
}

@media (max-width: 768px) {
    .nvcb-sticky-atc--with-variants .nvcb-sticky-atc__inner {
        gap: 8px;
    }

    .nvcb-sticky-atc__variant-select {
        min-width: 96px;
        max-width: 132px;
        font-size: 16px;
        padding-right: 24px;
    }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    #nvcb-sticky-atc {
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    }

    /* ── Mobile grid: thumbnail spans both rows on the left ── */
    .nvcb-sticky-atc__inner {
        width: 100%;
        max-width: none;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) minmax(130px, 0.85fr);
        grid-template-areas:
            "img info     price"
            "img variants button";
        align-items: center;
        gap: 6px 10px;
    }

    /* Show thumbnail, square-cropped, spanning both rows */
    .nvcb-sticky-atc__img {
        display: block;
        grid-area: img;
        width: 44px;
        height: 44px;
        object-fit: cover;
        border-radius: 6px;
        align-self: center;
        flex-shrink: 0;
        background: #f3f4f6;
        transition: opacity 0.2s ease;
    }

    .nvcb-sticky-atc__info {
        grid-area: info;
        min-width: 0;
    }

    /* Tighten name font slightly so it fits the narrower info column */
    .nvcb-sticky-atc__name {
        font-size: 13px;
        line-height: 1.2;
    }

    .nvcb-sticky-atc__savings {
        display: none;
    }

    .nvcb-sticky-atc__price {
        grid-area: price;
        display: flex;
        align-items: baseline;
        justify-content: flex-end;
        gap: 4px;
        min-width: 0;
        font-size: 15px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .nvcb-sticky-atc__price del {
        color: #6b7280;
        font-size: 12px;
        font-weight: 600;
    }

    .nvcb-sticky-atc__price ins {
        font-size: 16px;
        font-weight: 800;
    }

    .nvcb-sticky-atc__variants {
        grid-area: variants;
        width: 100%;
        min-width: 0;
    }

    .nvcb-sticky-atc--with-variants .nvcb-sticky-atc__variants {
        display: block;
    }

    .nvcb-sticky-atc__variant-select {
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 44px;
        font-size: 15px !important;
    }

    .nvcb-sticky-atc__variant-select--native {
        display: none !important;
    }

    .nvcb-sticky-atc__variant-control {
        display: block;
    }

    .nvcb-sticky-atc__btn {
        grid-area: button;
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        font-size: 16px;
        line-height: 1.2;
    }
}

@media (max-width: 360px) {
    #nvcb-sticky-atc {
        padding-left: 10px;
        padding-right: 10px;
    }

    .nvcb-sticky-atc__inner {
        grid-template-columns: 40px minmax(0, 1fr) minmax(120px, 0.9fr);
        gap: 6px 8px;
    }

    .nvcb-sticky-atc__img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .nvcb-review-count {
        display: none;
    }

    .nvcb-countdown-bar {
        font-size: 13px;
        padding: 7px 12px;
    }
}
