/* Easy Lead Frontend Styles */

:root {
    --cl-primary: var(--codleade-btn-bg, #000000);
    --cl-primary-hover: var(--codleade-btn-bg, #000000);
    --cl-bg-overlay: rgba(0, 0, 0, 0.5);
    --cl-modal-bg: var(--cl-modal-bg, #ffffff);
    --cl-text-main: var(--cl-text-primary, #1e293b);
    --cl-text-sub: #64748b;
    --cl-input-bg: #ffffff;
    --cl-input-border: #e2e8f0;
    --cl-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body.codleade-no-scroll {
    overflow: hidden !important;
}

.codleade-modal, 
.codleade-modal *,
.codleade-btn-wrapper,
.codleade-btn-wrapper * {
    box-sizing: border-box !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    list-style: none;
    text-transform: none;
}

/* Ensure buttons don't inherit theme button shadows/borders */
.codleade-btn {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

/* Hide original WooCommerce button and variations form */
.single-product .cart .single_add_to_cart_button,
.single-product .variations_form.cart {
    display: none !important;
}

/* Ensure our button wrapper is visible */
.codleade-btn-wrapper {
    display: flex !important;
}

/* Custom Button - High specificity to override theme .button.alt */
#codleade-trigger.codleade-btn,
.codleade-btn {
    background-color: var(--cl-primary, #000000) !important;
    color: var(--codleade-btn-text, #ffffff) !important;
    padding: 16px 28px !important;
    border-radius: 14px !important;
    border: none !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    line-height: 1.3 !important;
    font-weight: 600;
    box-sizing: border-box !important;
    margin: 0 !important;
    height: auto !important;
    text-transform: none !important;
}

.codleade-btn:hover {
    color: var(--codleade-btn-text, #ffffff) !important;
}

.codleade-btn-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.codleade-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.codleade-btn-texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.codleade-btn-main {
    font-size: 18px !important;
    font-weight: 700 !important;
    display: block;
    line-height: 1.1;
}

.codleade-btn-sub {
    font-size: 12px !important;
    font-weight: 400 !important;
    display: block;
    opacity: 0.8;
}

/* Quantity input hidden when custom button is active */
.cart .quantity {
    display: none !important;
}

.codleade-button-wrapper {
    display: block;
    width: 100% !important;
}

@media (max-width: 480px) {
    .codleade-button-wrapper {
        width: 100%;
        margin-top: 10px;
    }
}

/* Modal Styling */
.codleade-modal {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex; /* Robust flex-based scroll */
    align-items: flex-start; /* Start from top to allow scrolling */
    justify-content: center;
    overflow-y: auto; 
    padding: 60px 15px; /* Ample space for float effect and scroll */
    -webkit-overflow-scrolling: touch;
}

.codleade-checkout-container {
    background: var(--cl-form-bg, #ffffff) !important;
    padding: 0;
    width: 100% !important;
    max-width: 480px !important;
    margin: 0 auto !important;
    border: 2px solid var(--cl-primary) !important; 
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
    position: relative;
    overflow: hidden;
    display: block !important;
    box-sizing: border-box !important;
}

.codleade-modal-content {
    background: transparent !important;
    padding: 0;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    animation: elFadeIn 0.3s ease-out;
    display: block;
    overflow: visible;
}

.codleade-modal-content .codleade-checkout-container {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

/* Embedded (inline) form wrapper — keep it same size as popup */
.cl-embedded-form-wrapper {
    max-width: 480px !important;
    width: 100% !important;
    margin: 30px 0 !important;
}

.codleade-inline-form {
    max-width: 480px !important;
    width: 100% !important;
    margin: 0 auto !important;
    display: block;
}

.codleade-inline-form .codleade-checkout-container {
    max-width: 100% !important;
    width: 100% !important;
}

@media (max-width: 520px) {
    .cl-embedded-form-wrapper,
    .codleade-inline-form {
        max-width: 100% !important;
    }
}

@keyframes elFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.codleade-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--cl-text-muted);
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.codleade-close:hover {
    color: var(--cl-text-main);
}

/* Ensure header and footer stay while scrolling if needed */
.codleade-header {
    background: transparent;
    padding: 8px 15px 12px; 
    border-bottom: 1px solid rgba(var(--cl-primary-rgb), 0.1);
    text-align: center;
    position: relative;
}

.codleade-header h2 {
    margin: 0;
    font-size: 19px; 
    font-weight: 700;
    color: var(--cl-text-primary);
}

.codleade-header-sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--cl-text-sub);
}

.codleade-form {
    padding: 10px 15px 15px; 
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow: hidden;
}

.codleade-order-form {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

.codleade-footer {
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.codleade-form-group {
    margin-bottom: 8px; 
}

.codleade-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--cl-text-main);
    font-size: 0.9rem;
}

.codleade-form-group input,
.codleade-form-group textarea {
    width: 100%;
    padding: 12px 16px 12px 45px; /* Added padding for icon */
    border: none; /* Border moved to wrapper */
    border-radius: 0; /* Border radius moved to wrapper */
    background: var(--cl-input-bg);
    color: var(--cl-text-main);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.codleade-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px !important;
    overflow: hidden;
    transition: all 0.2s ease;
}

.codleade-input-wrapper:focus-within {
    border-color: var(--codleade-btn-bg);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.codleade-input-wrapper input:focus {
    border-color: var(--cl-input-border-focus, #2563eb);
    outline: none;
    box-shadow: 0 0 0 3px var(--cl-primary-10, rgba(37, 99, 235, 0.1));
}

/* Inline Error State Styling */
.codleade-input-wrapper.cl-wrapper-error {
    animation: cl-shake 0.4s ease-in-out;
}
.codleade-input-wrapper.cl-wrapper-error input {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}
.codleade-input-wrapper.cl-wrapper-error input::placeholder {
    color: #ef4444 !important;
    opacity: 0.8;
}
.codleade-input-wrapper.cl-wrapper-error .codleade-input-icon {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

@keyframes cl-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.codleade-form-group input:focus {
    border-color: transparent; /* Focus border handled by wrapper */
    box-shadow: none; /* Focus shadow handled by wrapper */
    outline: none;
    background: #fff;
}

.codleade-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    background-color: var(--cl-primary-10, #f1f5f9);
    border-right: 1px solid #d1d5db;
    color: var(--cl-primary, #1e293b);
}

.codleade-form-grid {
    display: block; /* Removed grid for stacked layout */
}

.codleade-form input[type="text"],
.codleade-form input[type="tel"],
.codleade-form input[type="email"] {
    flex: 1;
    border: none !important;
    padding: 0 15px !important;
    margin: 0 !important;
    height: 40px !important;
    line-height: 40px !important;
    font-size: 14px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #1e293b !important;
}

.codleade-form input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* Submit Button & Loading */
.codleade-submit-btn {
    position: relative;
    overflow: hidden;
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: cl-spin 0.8s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -10px;
    margin-top: -10px;
    z-index: 5;
}

@keyframes cl-spin {
    to { transform: rotate(360deg); }
}

.is-loading .loading-spinner {
    display: block;
}

.is-loading .codleade-btn-content {
    opacity: 0;
    visibility: hidden;
}

#codleade-message {
    padding: 0;
    margin: 5px 0 0; /* Minimal margin */
    text-align: center;
    font-weight: 600;
}

.codleade-success {
    color: #10b981;
}

.codleade-error {
    color: #ef4444;
}

/* Animations with pauses */
.shake-horizontal {
    animation: cl-shake-horizontal 5s ease-in-out infinite;
}

.shake-vertical {
    animation: cl-shake-vertical 5s ease-in-out infinite;
}

.shake-bottom {
    animation: cl-shake-bottom 5s ease-in-out infinite;
}

@keyframes cl-shake-horizontal {
    0%, 25%, 100% { transform: translateX(0); }
    2.5%, 7.5%, 12.5%, 17.5%, 22.5% { transform: translateX(-5px); }
    5%, 10%, 15%, 20% { transform: translateX(5px); }
}

@keyframes cl-shake-vertical {
    0%, 25%, 100% { transform: translateY(0); }
    2.5%, 7.5%, 12.5%, 17.5%, 22.5% { transform: translateY(-3px); }
    5%, 10%, 15%, 20% { transform: translateY(3px); }
}

@keyframes cl-shake-bottom {
    0%, 25%, 100% { transform: scale(1); transform-origin: bottom; }
    2.5%, 7.5%, 12.5%, 17.5%, 22.5% { transform: scaleY(0.95); transform-origin: bottom; }
    5%, 10%, 15%, 20% { transform: scaleY(1.05); transform-origin: bottom; }
}

.codleade-trust-image {
    width: 100%;
    max-width: 100% !important;
    display: flex;
    justify-content: center;
    border-top: 1px solid #f1f5f9;
    padding: 10px 0;
    margin: 10px 0 0 !important;
    background: transparent !important;
    box-sizing: border-box !important;
    overflow: hidden; /* Safety against child overflow */
}

.codleade-trust-image img {
    height: auto !important;
    object-fit: contain !important;
    max-width: 100% !important; /* Ensure it never leaves the frame */
    display: block;
    margin: 0 auto;
}

/* Product Preview Box */
.cl-product-preview-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f1f5f9;
    border: 1px solid var(--cl-primary-20) !important;
    border-radius: 12px !important;
    margin: 0 0 20px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box !important;
}

.cl-product-image-wrapper {
    position: relative;
    width: 44px; /* Smaller image */
    height: 44px;
    flex-shrink: 0;
}

.cl-product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px !important;
}

.cl-product-qty-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #000;
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 1.5px solid #fff;
    z-index: 10;
}

.cl-product-preview-name {
    flex-grow: 1;
    font-weight: 600;
    color: var(--cl-text-primary, #1e293b);
    font-size: 13px;
}

.cl-product-preview-selected-variations {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
    font-weight: 500;
}

.cl-product-preview-price {
    font-weight: 600;
    color: var(--cl-text-primary, #1e293b);
    font-size: 13px; /* Smaller font */
}

/* Order Summary Box */
.cl-order-summary-box {
    background: #f1f5f9;
    border: 1px solid var(--cl-primary-20) !important;
    border-radius: 12px !important;
    padding: 10px 12px;
    margin: 8px 0 15px 0; 
    width: 100%;
    max-width: 100%;
    box-sizing: border-box !important;
}

.cl-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 12px; /* Smaller font */
}

.cl-summary-row span:last-child {
    font-weight: 600;
    color: var(--cl-text-primary, #1e293b);
}

.cl-shipping-row span:last-child {
    color: #059669 !important; /* Green for shipping line */
}

.cl-summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
    font-weight: 700;
    color: var(--cl-text-primary, #1e293b);
    font-size: 14px; /* Smaller font */
}

/* WhatsApp Button Settings */
.codleade-whatsapp-btn {
    background-color: var(--cl-whatsapp-bg) !important;
    color: #ffffff !important;
}
.codleade-whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Online Payment Button Settings */
.codleade-payment-btn {
    background-color: var(--cl-payment-bg) !important;
    color: #ffffff !important;
}
.codleade-payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Button wrapper spacing */
.codleade-btn-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 450px; /* Exact size matching standard buttons */
    margin: 0; /* Align with other content on left */
}
/* Coupon Code Section */
.cl-coupon-field-wrapper {
    display: flex;
    align-items: stretch;
}

.cl-coupon-input-flex {
    display: flex;
    flex: 1;
    align-items: center;
    position: relative;
}

.cl-coupon-input-flex input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding-right: 90px !important; /* Space for the absolute button */
}

.cl-apply-coupon-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 12px !important;
    background: var(--cl-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: background 0.2s;
    height: 32px !important;
    line-height: 32px !important;
    z-index: 5;
    margin: 0 !important;
    min-width: 60px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Removed hover bg from coupon button */

.cl-coupon-status {
    font-size: 13px;
    margin-top: 5px;
    font-weight: 500;
}

.cl-coupon-success {
    color: #10b981;
}

.cl-coupon-error {
    color: #ef4444;
}

.cl-discount-row span:last-child {
    color: #ef4444 !important;
}

/* Quantity Control Styled */
.cl-quantity-control {
    display: flex;
    align-items: stretch;
    height: 36px; /* Reduced height from 48px */
    width: 100%;
    max-width: 110px; /* Reduced width from 140px */
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: none;
}

.cl-qty-btn {
    width: 32px; /* Reduced from 45px */
    background: #f1f5f9 !important; /* Light gray from form icons */
    border: none !important;
    color: #1e293b !important; /* Dark text/icons color */
    font-size: 18px !important; /* Reduced from 24px */
    font-weight: 600 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0 !important;
    line-height: 1 !important;
}

/* removed fixed borders to prevent conflicts in RTL/LTR */

/* Removed hover bg from quantity button */

.cl-qty-btn:active {
    background: #cbd5e1 !important;
}

.cl-quantity-control input {
    flex: 1;
    width: 40px !important;
    border: none !important;
    border-left: 1px solid #d1d5db !important;
    border-right: 1px solid #d1d5db !important;
    background: #ffffff !important;
    color: #1e293b !important;
    text-align: center !important;
    font-size: 14px !important; /* Reduced from 18px */
    font-weight: 700 !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

.cl-quantity-control input::-webkit-outer-spin-button,
.cl-quantity-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Variation Swatches in Modal */
.cl-product-variations {
    margin: 15px 0 20px;
    padding: 0;
}

.cl-variation-attribute {
    margin-bottom: 15px;
}

.cl-variation-attribute-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--cl-text-main);
    text-align: left;
}

.cl-swatches-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.cl-swatch {
    cursor: pointer;
    border: 1px solid #e2e8f0;
    border-radius: 8px !important;
    padding: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: #fff;
    position: relative;
    box-sizing: border-box !important;
}

.cl-swatch:hover {
    border-color: var(--codleade-btn-bg);
    transform: translateY(-2px);
}

.cl-swatch.selected {
    border: 2px solid var(--codleade-btn-bg);
    background: #fff;
    padding: 1px;
    box-shadow: none;
}

.cl-swatch-color {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: block;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.cl-swatch-image {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
}

.cl-swatch-text {
    font-size: 13px;
    font-weight: 600;
    padding: 0 10px;
    color: #475569;
    white-space: nowrap;
}

.cl-swatch.selected .cl-swatch-text {
    color: var(--codleade-btn-bg);
}

.cl-swatch-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    z-index: 100;
}

.cl-swatch:hover .cl-swatch-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}


/* --- Quantity Offers V2 (Premium Design) --- */
.cl-offers-list-container {
    margin: 8px 0;
}

.cl-offers-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--cl-text-main, #1e293b);
    display: none; /* Let the container handle title if needed */
}

.cl-offers-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cl-offer-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.cl-offer-card:hover {
    border-color: var(--cl-primary);
    background: rgba(var(--cl-primary-rgb), 0.02);
}

.cl-offer-card.selected {
    border: 2px solid var(--cl-primary);
    background: rgba(var(--cl-primary-rgb), 0.05) !important;
    box-shadow: 0 4px 15px rgba(var(--cl-primary-rgb), 0.1);
}

/* Three Column Header - Enhanced Responsiveness */
.cl-offer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
}

/* 1. Price Column (Now on the Left in RTL) */
.cl-offer-price-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Aligns to left in RTL */
    flex-shrink: 0;
    min-width: 75px;
}

.cl-offer-total-price-large {
    font-size: 16px;
    font-weight: 800;
    color: #000;
    line-height: 1.1;
}

.cl-offer-reg-price-small {
    font-size: 11px;
    color: #f43f5e;
    text-decoration: line-through;
    margin-top: -1px;
}

/* 2. Info Column (In the middle) */
.cl-offer-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligns to right in RTL */
    text-align: right;
    padding: 0 10px;
}

.cl-offer-badge-pill {
    background: #f43f5e;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
    white-space: nowrap;
}

.cl-offer-label-main {
    font-size: 15px;
    font-weight: 800;
    color: #000;
    line-height: 1.2;
}

.cl-offer-subtitle {
    font-size: 10px;
    color: #94a3b8;
    line-height: 1.3;
}

/* 3. Image Column (Now on the Right in RTL) */
.cl-offer-image-col img {
    width: 60px; /* Refined size */
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
    flex-shrink: 0;
}

/* Variation Grid Section - Optimized for compact space */
.cl-offer-items-selections {
    display: none; /* Hide if not selected */
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.cl-offer-card.selected .cl-offer-items-selections {
    display: flex;
}

.cl-items-sel-header {
    display: flex;
    gap: 8px;
    margin-bottom: 1px;
}

.cl-attr-header-label {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    color: #cbd5e1;
    text-align: center;
}

.cl-attr-header-empty {
    width: 32px;
}

.cl-offer-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cl-item-select-v2 {
    flex: 1;
    height: 30px; /* Reduced for ultra-compact look */
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0 4px 0 18px; /* Compact padding */
    font-size: 11px; /* Smaller font */
    font-weight: 600;
    background: #fff;
    color: #334155;
    cursor: pointer;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 6px center;
}

.cl-item-index-pill {
    width: 30px;
    height: 30px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

/* Hide global variations and preview box if quantity offers are present */
.cl-offers-active .cl-product-preview-box,
.cl-offers-active .cl-product-variations {
    display: none !important;
}

@media screen and (max-width: 420px) {
    .cl-offer-image-col {
        display: flex; /* Keep visible for all sizes as requested */
    }
    .cl-offer-price-col {
        min-width: 65px;
    }
}
.cl-qty-offer-pricing {
    text-align: right;
    display: flex;
    flex-direction: column;
}
.cl-qty-offer-price {
    font-weight: 800;
    font-size: 16px;
    color: var(--cl-text-main);
}
.cl-qty-compare-price {
    font-size: 13px;
    color: #ef4444;
    text-decoration: line-through;
}
.cl-qty-offer-body {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}
.cl-qty-variation-group .cl-swatches-container {
    gap: 5px;
}
.cl-qty-variation-group .cl-variation-attribute {
    margin-bottom: 10px;
}

/* RTL Support */
.cl-rtl {
    direction: rtl;
    text-align: right;
}

.cl-rtl .codleade-btn-texts {
    align-items: flex-start;
    text-align: right;
}

.cl-rtl .codleade-close {
    right: auto;
    left: 20px;
}

.cl-rtl .codleade-input-icon {
    border-right: none;
    border-left: 1px solid #d1d5db;
}

.cl-rtl .cl-coupon-input-flex input {
    padding-right: 15px !important;
    padding-left: 95px !important;
}

.cl-rtl .cl-apply-coupon-btn {
    right: auto;
    left: 5px;
    transform: translateY(-50%);
}

.cl-rtl .cl-variation-attribute-label {
    text-align: right;
}

.cl-rtl .cl-swatches-container {
    justify-content: flex-start;
}

.cl-rtl .cl-product-qty-badge {
    left: auto;
    right: -6px;
}

.cl-rtl .cl-product-preview-box {
    text-align: right;
}

.cl-rtl .codleade-btn-icon svg {
    transform: scaleX(-1);
}

.cl-rtl .codleade-header-sub {
   text-align: center;
}

@media (max-width: 480px) {
    .cl-rtl .codleade-btn-texts {
        align-items: center;
        text-align: center;
    }
}
/* --- Sticky Bar Styles --- */
.cl-sticky-bar {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #ffffff !important;
    z-index: 100000 !important; /* Ensure it's above almost everything */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box !important;
    margin: 0 !important;
    height: auto !important;
    
    /* Force Boxy Floating style */
    bottom: 12px !important;
    width: calc(100% - 24px) !important;
    max-width: 600px !important;
    padding: 6px 15px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 10px !important;
}

/* Hide Sticky Bar when Modal is Open to avoid overlap */
body.codleade-no-scroll .cl-sticky-bar {
    display: none !important;
}

.cl-sticky-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 auto;
}

.cl-sticky-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.cl-sticky-img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.cl-sticky-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50% !important;
    display: block;
}

.cl-sticky-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cl-sticky-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1e293b;
    line-height: 1.2;
}

.cl-sticky-meta {
    font-size: 9px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
}

.cl-sticky-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cl-sticky-price {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
    white-space: nowrap;
}

.cl-sticky-btn {
    background: var(--codleade-btn-bg, #000000) !important;
    color: var(--codleade-btn-text, #ffffff) !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border: none !important;
    width: auto !important;
    max-width: 180px !important;
    min-width: 100px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .cl-sticky-bar {
        width: calc(100% - 20px) !important;
        padding: 4px 10px; /* Extra thin for mobile */
        bottom: 10px;
    }
    .cl-sticky-container {
        gap: 8px;
    }
    .cl-sticky-img {
        width: 32px;
        height: 32px;
    }
    .cl-sticky-title {
        font-size: 11px;
        max-width: 110px;
    }
    .cl-sticky-price {
        font-size: 12px;
    }
    .cl-sticky-btn {
        padding: 8px 16px !important;
        font-size: 11px !important;
        background: var(--codleade-btn-bg, #000000) !important;
        color: var(--codleade-btn-text, #ffffff) !important;
    }
    .cl-sticky-meta {
         display: none;
    }
}
/* --- Mobile Responsiveness for Quantity Offers --- */
@media (max-width: 480px) {
    .codleade-form {
        padding: 10px 12px 20px !important; /* Tighter general form padding */
    }
    .cl-offers-grid {
        gap: 8px !important;
    }
    .cl-offer-card {
        border-radius: 10px !important;
        padding: 6px 8px !important; /* Tighter padding */
    }
    .cl-offer-card-header {
        padding: 0 !important;
        gap: 6px !important;
    }
    .cl-offer-image-col img {
        width: 44px !important; /* Compact but visible */
        height: 44px !important;
    }
    .cl-offer-label-main {
        font-size: 13px !important;
        line-height: 1.1 !important;
    }
    .cl-offer-subtitle {
        font-size: 9px !important;
        margin-top: 2px !important;
    }
    .cl-offer-total-price-large {
        font-size: 14px !important;
    }
    .cl-offer-reg-price-small {
        font-size: 10px !important;
    }
    .cl-offer-badge-pill {
        font-size: 8px !important;
        padding: 1px 4px !important;
        margin-bottom: 2px !important;
    }
    
    /* Variations inside card */
    .cl-offer-items-selections {
        padding: 6px !important;
        margin: 0 !important;
        margin-top: 6px !important;
    }
    .cl-items-sel-header {
        display: none !important;
    }
    .cl-offer-item-row {
        gap: 4px !important;
        margin-bottom: 4px !important;
    }
    .cl-item-select-v2 {
        font-size: 13px !important;
        height: 38px !important; /* Better touch target */
        padding: 0 10px 0 28px !important; 
        line-height: 1.2 !important;
        text-align-last: center; /* Better for selects */
    }
    .cl-item-index-pill {
        width: 28px !important;
        height: 28px !important;
        font-size: 9px !important;
    }
}

/* Embedded Form Styles */
.cl-embedded-form-wrapper {
    width: 100%;
    display: block !important;
    clear: both;
}


.cl-embedded-form-wrapper .codleade-checkout-container {
    margin: 0 auto !important;
    max-width: 100% !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
    border: 2px solid var(--cl-primary) !important; /* Match Pop-up border */
    background: var(--cl-form-bg, #ffffff) !important;
}

/* If embedded, hide modal-specific elements if they exist */
.cl-embedded-form-wrapper .codleade-close {
    display: none !important;
}

@media (max-width: 782px) {
    .cl-embedded-form-wrapper {
        margin: 20px 0;
    }
}
