/* === WhatsApp Button Styling (Simplified – removed gradient) === */
.cwl-screen-reader-text {
    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;
}

.cwl-whatsapp-button {
    background:#25D366 !important;
    border-radius:6px !important;
    color:#ffffff !important;
    border:none !important;
    padding:10px 18px !important;
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    text-decoration:none !important;
    font-weight:600;
    transition:background .25s ease, box-shadow .25s ease, transform .25s ease;
    box-shadow:0 2px 4px rgba(0,0,0,0.12);
}

.cwl-whatsapp-button:hover {
    background:#1ebe5d !important;
    box-shadow:0 3px 8px rgba(0,0,0,0.18);
    transform:translateY(-2px);
}

/* WhatsApp Icon */
.cwl-whatsapp-button::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="white"><path d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.8 0-65.7-10.8-94-31.5l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.8-16.2-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* === "Notify Me" Button Styling (Simplified – no gradient) === */
.cwl-back-in-stock-form .cwl-notify-button {
    background:#111 !important; /* default neutral; variant classes override */
    color:#ffffff !important;
    border-radius:6px !important;
    border:none !important;
    padding:12px 20px !important;
    font-weight:600;
    transition:background .25s ease, box-shadow .25s ease, transform .25s ease;
    box-shadow:0 2px 4px rgba(0,0,0,0.12);
    width:100%;
}

.cwl-back-in-stock-form .cwl-notify-button:hover {
    background:#000 !important;
    box-shadow:0 3px 8px rgba(0,0,0,0.18);
    transform:translateY(-2px);
}

.cwl-back-in-stock-form .cwl-notify-button:disabled {
    background-color: #cccccc !important;
    background-image: none !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* === "Back in Stock" Form Styling === */
/* Legacy dark style (now opt-in via .cwl-style-dark) */
.cwl-back-in-stock-container.cwl-style-dark {
    margin: 20px 0;
    padding: 24px;
    background: #1f2937;
    border-radius: 12px;
    border: 1px solid #374151;
    color: #e5e7eb;
}

.cwl-back-in-stock-form .cwl-form-title {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222; /* updated from #fff after removal of dark background */
}

.cwl-back-in-stock-form .cwl-form-description {
    margin-bottom: 15px;
    color: #9ca3af;
}

.cwl-back-in-stock-form .cwl-form-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

/* Scope dark input styling to .cwl-style-dark to avoid overriding clean light style */
.cwl-style-dark .cwl-back-in-stock-form input[type="text"],
.cwl-style-dark .cwl-back-in-stock-form input[type="tel"],
.cwl-style-dark .cwl-back-in-stock-form input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #374151;
    color: #e5e7eb;
}

.cwl-style-dark .cwl-back-in-stock-form input[type="text"]:focus,
.cwl-style-dark .cwl-back-in-stock-form input[type="tel"]:focus,
.cwl-style-dark .cwl-back-in-stock-form input[type="email"]:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* === Validation Error States === */
.cwl-back-in-stock-form .cwl-field-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 1px #dc2626 !important;
}

.cwl-back-in-stock-form .cwl-form-message {
    display: none;
    margin-top: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

.cwl-back-in-stock-form .cwl-form-message.error {
    background: #ef4444;
    color: #fff;
    border: 1px solid #dc2626;
}

.cwl-back-in-stock-form .cwl-form-message.success {
    background: #10b981;
    color: #fff;
    border: 1px solid #059669;
}

.cwl-back-in-stock-form .cwl-error-list {
    margin: 0;
    padding-left: 20px;
}

.cwl-back-in-stock-form .cwl-error-list li {
    list-style: disc;
}

.cwl-back-in-stock-form .cwl-consent-field {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.cwl-back-in-stock-form .cwl-consent-field input[type="checkbox"] {
    margin-right: 10px;
    flex-shrink: 0;
    margin-top: 3px;
}

.cwl-back-in-stock-form .cwl-consent-field label {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

/* Hide original Add to Cart button when custom button is active */
.cwl-button-active .single_add_to_cart_button:not(.cwl-custom-button) {
    display: none !important;
}

/* === Elementor Back in Stock Enhancements === */
.elementor-add-to-cart .cwl-back-in-stock-container { margin: 10px 0 0; max-width: 320px; }
.elementor-add-to-cart .cwl-back-in-stock-form .cwl-form-fields { gap: 8px; }
.elementor-add-to-cart .cwl-back-in-stock-form input[type="text"],
.elementor-add-to-cart .cwl-back-in-stock-form input[type="tel"] { max-width: 100%; font-size: 14px; padding: 10px; }
.elementor-add-to-cart .cwl-back-in-stock-form button { width: 100%; margin-top: 4px; }

/* Prevent duplicate stock messaging clutter when form is present */
.elementor-add-to-cart .stock.out-of-stock + .cwl-back-in-stock-container .cwl-form-title,
.elementor-add-to-cart .cwl-back-in-stock-container + .stock.out-of-stock { display:none; }

/* Reduce duplicate out-of-stock message near our form in common layouts */
.product .stock.out-of-stock + .cwl-back-in-stock-container .cwl-form-title { display: none; }
.product .cwl-back-in-stock-container + .stock.out-of-stock { display: none; }

/* Legacy themes: if two identical containers appear back-to-back, hide the following to avoid visual duplicates */
.product .cwl-back-in-stock-container + .cwl-back-in-stock-container { display: none; }

/* RTL adjustments if site is RTL */
body.rtl .cwl-back-in-stock-form .cwl-consent-field input[type="checkbox"] { margin-right:0; margin-left:10px; }
body.rtl .cwl-back-in-stock-form input[type="text"],
body.rtl .cwl-back-in-stock-form input[type="tel"] { direction: rtl; }

/* === Out-of-Stock Swatch Styling (NASA Edition) === */

/* --- 1. Initial State: Out-of-Stock --- */
/* This applies to any swatch our JS has marked as unavailable. */
div.product .cwl-oos-x {
    position: relative;
    color: #9b9b9b !important;
    filter: grayscale(0.5) saturate(0.6) brightness(1.05);
}

div.product li.variable-item.cwl-oos-x {
    border: 1px solid #c8c8c8 !important;
    cursor: not-allowed !important;
    background-color: transparent !important;
}

/* Target the text inside the out-of-stock swatch */
div.product li.variable-item.cwl-oos-x .variable-item-span {
    color: #9b9b9b !important;
}

/* --- 2. Hover State: Disabled --- */
/* Remove any special hover effects for out-of-stock items. */
div.product li.variable-item.cwl-oos-x:hover {
    background-color: transparent !important; /* Prevent background color change */
    border-color: #ccc !important; /* Keep the gray border */
    box-shadow: none !important; /* Remove any hover shadow */
}

div.product li.variable-item.cwl-oos-x:hover .variable-item-span {
    color: #ccc !important; /* Keep the text gray */
}

/* Force-hide any pseudo-elements (like arrows/circles) for OOS/disabled items in ALL states */
div.product li.variable-item.cwl-oos-x::before,
div.product li.variable-item.cwl-oos-x::after,
div.product li.variable-item.cwl-oos-x .variable-item-span::before,
div.product li.variable-item.cwl-oos-x .variable-item-span::after,
div.product .variable-item.disabled::before,
div.product .variable-item.disabled::after,
div.product .variable-item.disabled .variable-item-span::before,
div.product .variable-item.disabled .variable-item-span::after,
div.product .button-variable-item.disabled::before,
div.product .button-variable-item.disabled::after,
div.product .swatch.disabled::before,
div.product .swatch.disabled::after,
div.product .swatch-item.disabled::before,
div.product .swatch-item.disabled::after,
div.product .woo-variation-item.disabled::before,
div.product .woo-variation-item.disabled::after,
div.product .woo-variation-item-button.disabled::before,
div.product .woo-variation-item-button.disabled::after,
div.product .woo-variation-item-image.disabled::before,
div.product .woo-variation-item-image.disabled::after,
div.product li.variable-item.cwl-oos-x.selected::before,
div.product li.variable-item.cwl-oos-x.selected::after {
    content: none !important;
    display: none !important;
    background: none !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    opacity: 0 !important;
}

/* --- 3. Active/Selected State: Out-of-Stock --- */
/* This applies when an out-of-stock swatch is clicked/selected. */
/* It remains visually disabled, just with a thicker border to indicate selection. */
div.product li.variable-item.cwl-oos-x.selected {
    background-color: transparent !important; /* NO background color */
    border-width: 2px !important; /* Make border thicker to show it's 'selected' */
    border-color: #b0b0b0 !important; /* A slightly darker gray for the selected border */
}

/* Keep the text gray for contrast when selected */
div.product li.variable-item.cwl-oos-x.selected .variable-item-span {
    color: #b0b0b0 !important; /* Keep text gray */
}

/* Defensive: hide any third‑party out-of-stock markers (icons/dots/X) */
div.product li.variable-item[data-wvstooltip-out-of-stock],
div.product .variable-item[aria-disabled="true"],
div.product .button-variable-item[aria-disabled="true"],
div.product .swatch[aria-disabled="true"],
div.product .swatch-item[aria-disabled="true"],
div.product .variation-swatches .swatch.disabled,
div.product .woo-variation-swatches .swatch.disabled,
div.product .wcvs-term.disabled,
div.product .wcvs-attribute-item.disabled,
div.product .variable-item.disabled,
div.product .button-variable-item.disabled,
div.product .swatch.disabled,
div.product .swatch-item.disabled {
    background-color: transparent !important;
    border: 1px solid #e0e0e0 !important;
    color: #b5b5b5 !important;
    box-shadow: none !important;
}

div.product li.variable-item[data-wvstooltip-out-of-stock]::before,
div.product li.variable-item[data-wvstooltip-out-of-stock]::after,
div.product .variable-item[aria-disabled="true"]::before,
div.product .variable-item[aria-disabled="true"]::after,
div.product .button-variable-item[aria-disabled="true"]::before,
div.product .button-variable-item[aria-disabled="true"]::after,
div.product .swatch[aria-disabled="true"]::before,
div.product .swatch[aria-disabled="true"]::after,
div.product .swatch-item[aria-disabled="true"]::before,
div.product .swatch-item[aria-disabled="true"]::after,
div.product .variation-swatches .swatch.disabled::before,
div.product .variation-swatches .swatch.disabled::after,
div.product .woo-variation-swatches .swatch.disabled::before,
div.product .woo-variation-swatches .swatch.disabled::after,
div.product .wcvs-term.disabled::before,
div.product .wcvs-term.disabled::after,
div.product .wcvs-attribute-item.disabled::before,
div.product .wcvs-attribute-item.disabled::after {
    content: none !important;
    display: none !important;
    background: none !important;
    background-image: none !important;
}

/* Highest-specificity overrides for known plugin selectors adding a red X */
.variable-items-wrapper li.cwl-oos-x .variable-item-span::after,
ul.variable-items-wrapper li.variable-item.cwl-oos-x .variable-item-span::after,
.wvs-style-rounded li.variable-item.cwl-oos-x .variable-item-span::after {
    content: none !important;
    display: none !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

/* === Clear In-Stock vs Out-of-Stock Frames === */
/* In-Stock: black border + black text (never faded) */
div.product li.variable-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]):not([disabled]):not([data-wvstooltip-out-of-stock]),
div.product .button-variable-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]):not([disabled]):not([data-wvstooltip-out-of-stock]),
div.product .swatch:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]):not([disabled]):not([data-wvstooltip-out-of-stock]),
div.product .swatch-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]):not([disabled]):not([data-wvstooltip-out-of-stock]),
div.product .woo-variation-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]):not([disabled]):not([data-wvstooltip-out-of-stock]),
div.product .woo-variation-item-button:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]):not([disabled]):not([data-wvstooltip-out-of-stock]),
div.product .woo-variation-item-image:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]):not([disabled]):not([data-wvstooltip-out-of-stock]) {
    border: 1px solid #000 !important;
    /* do not force background-color to avoid breaking color swatches */
    color: #000 !important;
    opacity: 1 !important;
    filter: none !important;
}

/* In-Stock text inside typical span */
div.product li.variable-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]) .variable-item-span,
div.product .button-variable-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]) .variable-item-span,
div.product .swatch:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]) .variable-item-span,
div.product .swatch-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]) .variable-item-span,
div.product li.variable-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]) a,
div.product .button-variable-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]) a {
    color: #000 !important;
    opacity: 1 !important;
}

/* In-Stock selected: stronger black frame */
div.product li.variable-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]).selected,
div.product .button-variable-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]).selected,
div.product .swatch:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]).selected,
div.product .swatch-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]).selected {
    border-color: #000 !important;
    border-width: 1px !important;
    opacity: 1 !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55);
}

div.product li.variable-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]).selected .variable-item-span,
div.product .button-variable-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]).selected .variable-item-span,
div.product .swatch-item:not(.cwl-oos-x):not(.disabled):not([aria-disabled="true"]).selected .variable-item-span {
    font-weight: 600;
}

div.product .cwl-oos-x .variable-item-span,
div.product .cwl-oos-x a {
    color: #9b9b9b !important;
}

/* === Clean Light Style Variant (cwl-style-clean) === */
.cwl-back-in-stock-container.cwl-style-clean {
    background:#fff;
    border:1px solid #d9dfe5;
    border-radius:8px;
    padding:16px 18px;
    color:#222;
    box-shadow:0 1px 2px rgba(0,0,0,0.04);
}
.cwl-style-clean .cwl-form-title { color:#222; font-size:1.05rem; margin:0 0 6px; font-weight:600; }
.cwl-style-clean .cwl-form-description { color:#444; font-size:.875rem; margin:0 0 14px; }
.cwl-style-clean .cwl-form-fields { gap:10px; }
.cwl-style-clean input[type=text],
.cwl-style-clean input[type=tel],
.cwl-style-clean input[type=email] { background:#fff; border:1px solid #c8ced4; border-radius:6px; padding:10px 12px; font-size:14px; color:#222; }
.cwl-style-clean input[type=text]:focus,
.cwl-style-clean input[type=tel]:focus,
.cwl-style-clean input[type=email]:focus { outline:none; border-color:#3b82f6; box-shadow:0 0 0 2px rgba(59,130,246,.25); }
.cwl-style-clean .cwl-consent-field { margin:8px 0 12px; }
.cwl-style-clean .cwl-form-message { font-size:13px; }
.cwl-style-clean .cwl-form-message.error {
    background:#fdecec !important;
    color:#a52620 !important;
    border:1px solid #efb4b1 !important;
}
.cwl-style-clean .cwl-form-message.success {
    background:#ecfdf5 !important;
    color:#05623b !important;
    border:1px solid #a7f3d0 !important;
}
.cwl-style-clean .cwl-field-error { border-color:#dc2626 !important; box-shadow:0 0 0 1px #dc2626 !important; }

/* Width helpers */
/* 100%: span full container */
.cwl-width-100 { width:100%; max-width:100%; }
/* 50%: true half width on wide layouts, capped for readability, centered by default */
.cwl-width-50 { width:50%; max-width:560px; min-width:320px; }
.cwl-back-in-stock-container.cwl-width-50 { margin-left:auto; margin-right:auto; }
@media (max-width: 900px) {
    .cwl-width-50 { width:100%; max-width:100%; }
}

/* Button variants */
.cwl-btn-whatsapp { background:#25D366 !important; color:#fff !important; border:none; border-radius:6px !important; font-weight:600; padding:12px 20px !important; }
.cwl-btn-whatsapp:hover { background:#1ebe5d !important; }
.cwl-btn-black { background:#111 !important; color:#fff !important; border:none; border-radius:6px !important; font-weight:600; padding:12px 20px !important; }
.cwl-btn-black:hover { background:#000 !important; }


/* === Light Theme Variant (Added) === */
.cwl-back-in-stock-container.cwl-theme-light {
    background:#ffffff;
    color:#222;
    border:1px solid #e2e8f0;
    box-shadow:0 1px 2px rgba(0,0,0,0.04);
}
.cwl-back-in-stock-container.cwl-theme-light .cwl-form-title { color:#1a1a1a; }
.cwl-back-in-stock-container.cwl-theme-light .cwl-form-description { color:#555; }
.cwl-back-in-stock-container.cwl-theme-light input[type=text],
.cwl-back-in-stock-container.cwl-theme-light input[type=tel],
.cwl-back-in-stock-container.cwl-theme-light input[type=email] {
    background:#fff;
    color:#222;
    border:1px solid #cbd5e1;
    box-shadow:none;
}
.cwl-back-in-stock-container.cwl-theme-light input[type=text]:focus,
.cwl-back-in-stock-container.cwl-theme-light input[type=tel]:focus,
.cwl-back-in-stock-container.cwl-theme-light input[type=email]:focus {
    border-color:#3b82f6;
    box-shadow:0 0 0 2px rgba(59,130,246,.25);
}
.cwl-back-in-stock-container.cwl-theme-light .cwl-notify-button {
    background:#111 !important; /* light theme inherits neutral button; variants override */
    box-shadow:0 2px 4px rgba(0,0,0,.08);
}
.cwl-back-in-stock-container.cwl-theme-light .cwl-notify-button:hover {
    background:#000 !important;
    transform:translateY(-1px);
}
.cwl-back-in-stock-container.cwl-theme-light .cwl-form-message.error {
    background:#fdecec !important;
    color:#b42318 !important;
    border:1px solid #f5c2c0 !important;
}
.cwl-back-in-stock-container.cwl-theme-light .cwl-form-message.success {
    background:#ecfdf5 !important;
    color:#065f46 !important;
    border:1px solid #a7f3d0 !important;
}
.cwl-back-in-stock-container.cwl-theme-light .cwl-field-error {
    border-color:#dc2626 !important;
    box-shadow:0 0 0 1px #dc2626 !important;
}

/* WhatsApp default brand styling override when using light theme */
.cwl-theme-light .cwl-whatsapp-button {
    background:#25D366 !important;
    background-image:none !important;
    color:#fff !important;
}
.cwl-theme-light .cwl-whatsapp-button:hover {
    background:#1ebe5d !important;
    box-shadow:0 4px 10px rgba(0,0,0,0.15) !important;
}

div.product .cwl-oos-x .cwl-oos-mark {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

div.product .cwl-oos-x .cwl-oos-mark::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

div.product .cwl-oos-x .cwl-oos-mark::after {
    content: '×';
    position: relative;
    font-size: 1.1em;
    line-height: 1;
    color: #b1b1b1;
    font-weight: 600;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.75);
}

div.product .cwl-oos-x .cwl-oos-mark.cwl-oos-mark--no-icon::after {
    content: '';
}

div.product .cwl-oos-x .cwl-oos-mark.cwl-oos-mark--no-icon::before {
    inset: 1px;
}
