/* ==============================
   CFP – MODERN V3.1 (WITH SWATCHES + PARENT FILTERING)
   ============================== */

/* ==============================
   HARD FIX FOR STICKY HEADERS
   ============================== */

body,
html,
.site,
.site-header,
header,
#page,
#wrapper,
.main-wrapper {
    transform: none !important;
}

.cfp-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999999 !important;
    isolation: isolate;
    pointer-events: all;
}

.cfp-modal {
    position: relative;
    z-index: 9999999999 !important;
}

body.cfp-open .site-header,
body.cfp-open header,
body.cfp-open .sticky-header,
body.cfp-open .floating-header {
    pointer-events: none;
}

/* Overlay */
.cfp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 40, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
}

/* Modal */
.cfp-modal {
    width: 100%;
    max-width: 560px;
    background: linear-gradient(180deg, #000028, #02023f);
    border-radius: 18px;
    box-shadow: 0 35px 90px rgba(0,0,0,0.75);
    animation: cfpPop 0.3s ease;
    color: #fff;
    position: relative;
}

/* Header */
.cfp-modal-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cfp-close-modal-btn {
    background: transparent;
    border: 1px solid #00ffb9;
    color: #00ffb9;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    cursor: pointer;
}

/* Body */
.cfp-modal-body {
    padding: 18px;
}

/* Product strip */
.cfp-prod-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed rgba(255,255,255,0.15);
}

.cfp-prod-img {
    width: 156px;
    height: 156px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #00ffb9;
}

.cfp-prod-heading span {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

/* Labels */
#cfp-form label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
    color: #9aa0b5;
}

/* Inputs */
#cfp-form input,
#cfp-form select,
#cfp-form textarea {
    width: 100%;
    background: #0a0a35;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 13px;
    color: #fff;
    height: 40px;
    box-sizing: border-box;
    appearance: none;
}

#cfp-form textarea {
    min-height: 90px;
    height: auto;
    resize: none;
}

#cfp-form input:focus,
#cfp-form select:focus,
#cfp-form textarea:focus {
    outline: none;
    border-color: #00ffb9;
    box-shadow: 0 0 0 2px rgba(0,255,185,0.22);
}

/* Grid */
.cfp-responsive-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0px !important;
}

@media (max-width: 600px) {
    .cfp-modal {
        max-width: 92%;
    }
    .cfp-responsive-fields {
        grid-template-columns: 1fr;
    }
}

/* Submit */
#cpf-form-btn {
    margin-top: 14px;
    width: 100%;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #00ffb9, #2cffd0);
    color: #000028;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding: 5px 12px;
    height: auto;
}

#cpf-form-btn:hover {
    box-shadow: 0 2px 4px rgba(0,255,185,0.45);
}

#cpf-form-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animation */
@keyframes cfpPop {
    from { transform: scale(0.96) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0);       opacity: 1; }
}

/* ==============================
   FORCE TRUE MODAL BEHAVIOR
   ============================== */

body.cfp-open {
    overflow: hidden;
}

.cfp-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,40,0.9);
    z-index: 99999999 !important;
    transform: none !important;
}

.cfp-modal {
    position: relative !important;
    max-width: 520px;
    width: calc(100% - 32px);
    margin: auto !important;
    z-index: 100000000 !important;
    isolation: isolate;
    transform: none !important;
}

/* Kill theme stacking contexts */
header,
.site-header,
.sticky-header,
.floating-header,
.elementor-sticky,
[class*="sticky"],
[class*="fixed"] {
    z-index: 1 !important;
}

.cfp-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999999 !important;
}

header,
.site-header,
.sticky-header,
.floating-header,
.elementor-sticky {
    z-index: 5 !important;
}

.buttonwemadefor {
    border: 1px solid #00cb9b;
    background-color: transparent;
    border-radius: 8px;
    padding: 5px 15px;
    color: #00cb9b;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.buttonwemadefor:hover {
    background-color: #00cb9b;
    color: #000028;
}

.site-header,
header,
.sticky-header,
.floating-header {
    position: relative;
    z-index: 1000;
}

.woocommerce div.product div.images .woocommerce-product-gallery__trigger {
    background: #fff;
    border: none;
    box-sizing: content-box;
    border-radius: 100%;
    cursor: pointer;
    font-size: 2em;
    height: 36px;
    padding: 0;
    position: absolute;
    right: .5em;
    text-indent: -9999px;
    bottom: .5em !important;
    width: 36px;
    z-index: 99;
}

/* Custom Stock Message */
.stock.out-of-stock {
    color: #00ffb9 !important;
    background: rgba(0, 255, 185, 0.1) !important;
    padding: 5px 10px !important;
    border-radius: 8px;
    border: 1px dashed #00ffb9;
    margin: 10px 0 !important;
    font-size: 13px !important;
    line-height: 1.4;
}

.woocommerce-variation-availability,
.single_variation .variation-availability {
    display: block !important;
}

.variation-selection-notice .call-for-price {
    font-size: 1.25em;
    font-weight: bold;
    color: #00ffb9;
    display: block;
    margin-bottom: 10px;
}

.variation-is-unpriced .single_add_to_cart_button {
    display: none !important;
}

/* ==============================
   VARIATION SWATCHES
   (same dark theme as your modal)
   ============================== */

/* Wrapper around each attribute's swatches */
.cfp-swatch-wrapper {
    margin-bottom: 10px;
}

/* Flex row of swatch buttons */
.cfp-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

/* ── Base swatch ── */
.cfp-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, opacity 0.25s;
    user-select: none;
    position: relative;
}

.cfp-swatch:hover {
    border-color: #00ffb9;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,255,185,0.2);
}

/* Selected state — teal glow matching your theme */
.cfp-swatch.selected {
    border-color: #00ffb9;
    box-shadow: 0 0 0 3px rgba(0,255,185,0.25);
}

/* Disabled state */
.cfp-swatch.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── BLURRED state: child swatch not valid for selected parent ── */
.cfp-swatch.cfp-swatch--blurred {
    opacity: 0.2 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    filter: blur(0.6px) grayscale(60%);
    transform: none !important;
    box-shadow: none !important;
    border-color: rgba(255,255,255,0.08) !important;
}

/* ── Label swatch ── */
.cfp-swatch-label {
    padding: 7px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #cdd6f4;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.cfp-swatch-label.selected {
    background: rgba(0,255,185,0.1);
    color: #00ffb9;
}

/* ── Color swatch ── */
.cfp-swatch-color {
    width: 36px;
    height: 36px;
    padding: 3px;
    border-radius: 50%;
}

.cfp-color-dot {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.35);
}

/* "Price on Request" shown below price area */
.call-for-price {
    color: #00ffb9;
    font-weight: 600;
}

/* ── Swatch tooltip (optional enhancement) ── */
.cfp-swatch::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #000028;
    color: #00ffb9;
    border: 1px solid rgba(0,255,185,0.3);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 99;
}

.cfp-swatch:hover::after {
    opacity: 1;
}

/* Hide the real WC <select> (we drive it via JS) */
.cfp-hidden-select {
    display: none !important;
}

/* ── Add-to-cart / button visibility ── */
/* Hide WC add to cart + qty when product has no price at all */
.cfp-no-price-product .quantity,
.cfp-no-price-product .single_add_to_cart_button {
    display: none !important;
}

/* ==============================
   FIX VARIATION TABLE LAYOUT
   ============================== */

table.variations {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

table.variations tr {
    display: block;
    margin-bottom: 14px;
}

table.variations th.label {
    display: block;
    text-align: left;
    padding: 0;
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9aa0b5;
}

table.variations td.value {
    display: block;
    padding: 0;
}

/* Remove theme borders */
table.variations td,
table.variations th {
    border: none !important;
}

/* Kill WC variation price box for unpriced variations */
.single_variation .price {
    display: none !important;
}

/* Show only our styled price */
.single_variation .call-for-price {
    font-size: 20px;
    font-weight: 700;
    color: #00ffb9;
    padding: 10px 0;
    display: block;
}

span.sku_wrapper {
    display: block !important;
    margin-bottom: 5px;
    color: #00c89a;
}

.variations th {
    color: #00cb9b !important;
}

.variations .label {
    font-size: 10px !important;
    margin-top: 8px !important;
}

.reset_variations {
    color: #fff !important;
}

.product_titlesignleproduct {
    color: #fff;
    font-size: 30px !important;
    margin: 4px 0px !important;
}

.cfp-swatch-label {
    padding: 0px 10px;
}

.cfp-swatch::after {
    display: none;
}

.submitbutton {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

.price .call-for-price {
    color: #00c89a !important;
}
