/* CODCP V7.2 PRO - styles */

/* root variable: primary color will be set by inline JS via CSS variable on body */
:root {
    --codcp-primary: #007bff; /* fallback */
    --codcp-primary-contrast: #fff;
}

/* Container */
.codcp-form-container {
    max-width: 680px;
    margin: 18px auto;
    padding: 18px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #ebeff3;
    /* ✅ تحسين الهالة لتكون أكثر وضوحاً ونبضاً بتدرج اللون الأساسي للمتجر */
    box-shadow: 0 0 35px rgba(0, 123, 255, 0.35);
    animation: codcp-glowPulse 4s ease-in-out infinite;
    direction: rtl;
}

@keyframes codcp-glowPulse {
    0% {
        box-shadow: 0 0 28px rgba(0, 123, 255, 0.25);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 48px rgba(0, 123, 255, 0.45);
        transform: scale(1.012);
    }
    100% {
        box-shadow: 0 0 28px rgba(0, 123, 255, 0.25);
        transform: scale(1);
    }
}

/* Title */
.codcp-form-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--codcp-primary);
    color: #1a1a1a;
}

/* Grid of inputs */
.codcp-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.codcp-input-group { display: block; }
.codcp-input-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}
.codcp-input-group input[type="text"],
.codcp-input-group input[type="tel"],
.codcp-input-group input[type="number"],
.codcp-input-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    background: #fff;
}

/* Summary box */
.codcp-summary-wrapper {
    margin-top: 14px;
    padding: 14px;
    border-radius: 10px;
    background: #f7fbff;
    border: 1px solid #e6f1fb;
}

/* ✅ زر الطلب خارج حاوية الملخص */
.codcp-submit-button-outside {
    display: block;
    width: 100%;
    margin-top: 20px !important;
    text-align: center;
}

/* Header */
.codcp-summary-header {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--codcp-primary);
    margin: 0 0 10px 0;
}

/* rows */
.codcp-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}
.codcp-product-row { border-bottom: 1px dashed #e8eef6; padding-bottom: 10px; margin-bottom: 10px; }

/* shipping options */
.codcp-shipping-row-container { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.codcp-shipping-option {
    border: 1px solid #e6ecf5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.codcp-shipping-option input[type="radio"] { display: none; }
.codcp-shipping-option label {
    display:flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
}
.codcp-shipping-option label .shipping-cost-label { font-weight: 800; color: var(--codcp-primary); }

.codcp-shipping-option input[type="radio"]:checked + label {
    border-left: 4px solid var(--codcp-primary);
    background: color-mix(in srgb, var(--codcp-primary) 8%, white);
    color: #0b2b4a;
}

/* total row */
.codcp-summary-total { font-size: 1.15rem; font-weight: 800; color: #c82333; margin-top: 12px; border-top: 1px dashed #e1e7ef; padding-top: 12px; }

/* Action bar */
.codcp-action-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: nowrap;
}

/* Submit button */
.codcp-submit-button {
    background: linear-gradient(180deg, var(--codcp-primary), color-mix(in srgb, var(--codcp-primary) 85%, black));
    color: var(--codcp-primary-contrast);
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 140px;
    box-shadow: 0 6px 18px rgba(12,60,140,0.12);
    position: relative;
    overflow: hidden;
    animation: codcp-pulse 2.5s infinite ease-in-out;
}
.codcp-submit-button::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: rgba(255,255,255,0.4);
    transform: skewX(-25deg);
    animation: codcp-shine 3s infinite;
}
@keyframes codcp-shine { 0%{left:-100%;} 50%{left:120%;} 100%{left:120%;} }
@keyframes codcp-pulse { 0%,100%{box-shadow:0 0 0 rgba(0,0,0,0);} 50%{box-shadow:0 0 12px rgba(0,123,255,0.35);} }

.codcp-submit-button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Loading overlay */
.codcp-loading-spinner-overlay {
    position: absolute;
    inset: 0;
    display:flex;
    align-items:center;
    justify-content:center;
    background: rgba(255,255,255,0.7);
    border-radius: 10px;
    z-index: 30;
}
.codcp-loading-spinner-small {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #f3f3f3;
    border-top-color: var(--codcp-primary);
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* messages */
.codcp-error-message { background: #ffe6e6; color: #8b0000; padding: 10px; border-radius: 8px; font-weight:600; }
.codcp-success-message { background: #e6ffed; color: #115c26; padding: 14px; border-radius: 8px; font-weight:700; text-align:center; }

/* Responsive */
@media (max-width: 520px) {
    .codcp-input-grid { grid-template-columns: 1fr; }
}

/* small cosmetic */
.required { color: #d93025; margin-left:6px; font-weight:900; }

/* ✅ تنسيق احترافي جديد للعداد - تم تعديله ليصبح مطابقاً للصورة المرفقة */
.codcp-quantity-section {
    margin: 18px 0 10px;
    padding: 14px;
    border: 1px solid #e5eaf1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(3, 24, 66, 0.05);
    /* التعديل 1: لجعل العنوان والعداد على سطر واحد مع تباعد */
    display: flex;
    flex-direction: row; /* جعل العناصر أفقية */
    align-items: center;
    justify-content: space-between; /* توزيع المحتوى بين الطرفين (العنوان في اليمين والعداد في اليسار) */
    gap: 10px; /* تقليل المسافة العمودية غير المستخدمة هنا */
}

.codcp-quantity-label {
    font-weight: 800;
    color: #333;
    font-size: 1.05rem;
    margin-bottom: 0; /* إزالة المسافة السفلية للعنوان */
}

.codcp-quantity-control {
    /* التعديل: لجعل العناصر على سطر واحد، وإبقاء الترتيب (الناقص في اليمين، الزائد في اليسار) */
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    /* width: fit-content; */ /* تمت إزالتها للسماح لـ space-between بالعمل */
    margin-top: 0; /* إزالة المسافة العلوية */
    /* الترتيب: جعل الناقص (-) في اليمين والزائد (+) في اليسار */
    flex-direction: row-reverse; 
    gap: 8px; /* المسافة بين الأزرار والرقم */
}

/* الأزرار - تم التعديل لتصغير الحجم ومطابقة التنسيق المربع الفاتح مع الظل الناعم (المواصفات الجديدة) */
.codcp-qty-btn {
    width: 38px; /* تصغير الأبعاد لتناسب الشكل الموضح */
    height: 38px;
    border: none;
    /* اللون الأساسي: أبيض مائل للرمادي الفاتح جدًا */
    background: #f7f7f7; 
    /* لون الأيقونة: أسود نقي أو رمادي داكن جدًا */
    color: #222; 
    font-size: 1.3em;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 6px; /* حواف مربعة ناعمة */
    /* الظل الناعم لرفع الزر */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06); 
}
.codcp-qty-btn:hover {
    background: #ebebeb; /* لون أغمق قليلاً عند التحويم */
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
}
.codcp-qty-btn:active {
    background: #dfdfdf;
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* حقل الكمية - تم التعديل ليطابق الصورة (فقط الرقم بدون حدود) */
.codcp-quantity-control input[type="number"] {
    width: 25px; 
    height: 38px; /* مطابقة ارتفاع الأزرار */
    text-align: center;
    /* إزالة الحدود والمقومات البصرية لتظهر فقط القيمة */
    border: none;
    outline: none;
    font-weight: 700;
    font-size: 1.1em; 
    color: #111;
    background: transparent;
    appearance: textfield;
}
.codcp-quantity-control input::-webkit-outer-spin-button,
.codcp-quantity-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* تحسين على الشاشات الصغيرة */
@media (max-width: 520px) {
    .codcp-qty-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
    }
    .codcp-quantity-control input[type="number"] {
        width: 22px;
        height: 36px;
        font-size: 1em;
    }
}
/* ======================================== */
/* 🎨 قسم خيارات الألوان والأحجام (منتج متغير) */
/* ======================================== */
.codcp-variations-section {
    margin: 16px 0;
    padding: 14px;
    background: #fff;
    border: 1px solid #e7ebf2;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(3,24,66,0.05);
}

.codcp-attribute-row {
    margin-bottom: 14px;
}

.codcp-attribute-label {
    font-weight: 800;
    color: #333;
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

/* ألوان */
.codcp-color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.codcp-color-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.codcp-color-circle:hover { transform: scale(1.08); }
.codcp-color-circle.selected {
    border-color: var(--codcp-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--codcp-primary) 40%, white), 0 0 12px rgba(0,0,0,0.15);
    animation: codcp-glow 0.6s ease;
}

/* أحجام */
.codcp-size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.codcp-size-box {
    padding: 8px 14px;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #fff;
}
.codcp-size-box:hover {
    border-color: var(--codcp-primary);
    color: var(--codcp-primary);
}
.codcp-size-box.selected {
    background: var(--codcp-primary);
    color: #fff;
    border-color: var(--codcp-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--codcp-primary) 40%, white), 0 0 12px rgba(0,0,0,0.15);
    animation: codcp-glow 0.6s ease;
}

@keyframes codcp-glow {
    from { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
    to   { box-shadow: 0 0 0 4px color-mix(in srgb, var(--codcp-primary) 40%, white), 0 0 12px rgba(0,0,0,0.15); }
}

/* ======================================== */
/* 🧩 قسم الموديلات (قائمة عمودية احترافية) */
/* ======================================== */
.codcp-models-section {
    margin: 18px 0;
    padding: 14px;
    border: 1px solid #e6eaf1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(3, 24, 66, 0.05);
}

.codcp-models-toggle {
    width: 100%;
    background: var(--codcp-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 12px;
    transition: background 0.2s ease;
    position: relative;
    overflow: hidden;
    animation: codcp-pulse 2.5s infinite ease-in-out;
}
.codcp-models-toggle::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: rgba(255,255,255,0.4);
    transform: skewX(-25deg);
    animation: codcp-shine 3s infinite;
}
.codcp-models-toggle:hover {
    background: color-mix(in srgb, var(--codcp-primary) 85%, black);
}

.codcp-models-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.codcp-model-card {
    /* **1. إبقاء البطاقة قابلة للضغط كبديل للـ Checkbox** */
    cursor: pointer; 
    
    /* التنسيقات الأساسية */
    display: flex;
    align-items: center;
    /* توزيع العناصر: الصورة والعنوان في البداية (يسار)، والعداد في النهاية (يمين) */
    justify-content: space-between; 
    border: 1px solid #e3e7ef;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fafbfc;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.codcp-model-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* **❌ 2. إخفاء مربع الاختيار بالكامل** */
.codcp-model-checkbox {
    display: none !important; 
    visibility: hidden !important; 
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0;
}

/* **✅ 3. تغيير لون الخلفية والإطار عند اختيار الكارت** */
/* يستخدم محدد :has لاستهداف الـ card عندما يكون Checkbox الداخلي محددًا */
.codcp-model-card:has(input[type="checkbox"]:checked) {
    background: color-mix(in srgb, var(--codcp-primary) 8%, white); /* خلفية فاتحة بلون القالب */
    border-color: var(--codcp-primary); /* إطار بلون القالب */
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--codcp-primary) 20%, white); /* تأثير ظل إضافي */
}

/* تعديل العنوان داخل الكارت المحدد */
.codcp-model-card:has(input[type="checkbox"]:checked) .codcp-model-title {
    color: #1a1a1a; /* تثبيت لون العنوان ليكون واضحًا على الخلفية الفاتحة */
}

/* تعديل أيقونة الصورة داخل الكارت المحدد */
.codcp-model-card:has(input[type="checkbox"]:checked) .codcp-model-thumb img {
    border-color: var(--codcp-primary); /* إطار الصورة بلون القالب */
}

/* **4. ترتيب الصورة والعنوان ليكونوا على خط واحد** */
.codcp-model-thumb {
    /* تجميع الصورة في حاوية لضبط الهامش والترتيب */
    display: flex;
    align-items: center;
    flex-shrink: 0; 
    /* إزالة الهامش الأيسر (حيث كان مربع الاختيار) */
    margin-right: 0; 
}
.codcp-model-thumb img {
    /* لا تغيير هنا */
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
    /* إزالة الهامش الأيسر الذي كان للـ Checkbox وإضافة مسافة بين الصورة والعنوان */
    margin-left: 10px; 
    flex-shrink: 0;
}
.codcp-model-meta {
    /* السماح للعنوان باحتلال المساحة المتبقية */
    flex: 1;
    text-align: right;
    margin-right: 10px; /* مسافة يمين العنوان */
    margin-left: 10px; /* مسافة يسار العنوان (من الصورة) */
    min-width: 0; /* مهم لكسر النص عند الحاجة */
}
.codcp-model-title {
    /* لضمان ظهور الاسم على خط واحد والاختصار إذا كان طويلاً */
    font-weight: 700;
    color: #222;
    font-size: 1rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* **5. العداد (إعادة تفعيل العداد المربع العادي بجانب العنوان)** */
.codcp-model-qty {
    /* تطبيق نفس شكل عداد الكمية الأفقية والمربعة */
    display: flex;
    align-items: center;
    /* الترتيب: جعل الناقص (-) في اليمين والزائد (+) في اليسار */
    flex-direction: row-reverse; 
    gap: 8px; /* تقليل المسافة */
    flex-shrink: 0; /* منع تقلص العداد */
}

/* إعادة تفعيل أزرار الزيادة والنقصان */
.codcp-model-plus, .codcp-model-minus {
    width: 38px;
    height: 38px;
    border-radius: 6px; /* حواف مربعة ناعمة */
    border: none;
    background: #f7f7f7; /* اللون الأساسي: أبيض مائل للرمادي الفاتح جدًا */
    color: #222; /* لون الأيقونة: أسود نقي */
    font-size: 1.3em;
    font-weight: 900;
    cursor: pointer;
    display: flex; /* إعادة التفعيل */
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06); /* الظل الناعم */
}
.codcp-model-plus:hover, .codcp-model-minus:hover {
    transform: translateY(-1px);
    background: #ebebeb; /* لون أغمق قليلاً عند التحويم */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
}
.codcp-model-plus:active, .codcp-model-minus:active {
    transform: translateY(0);
    background: #dfdfdf;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* إعادة تنسيق حقل الكمية ليكون مربعاً ومخفياً الحدود كما في عداد المنتج الرئيسي */
.codcp-model-qty-input {
    width: 25px;
    height: 38px; /* مطابقة لارتفاع الأزرار الجديدة */
    border: none; /* إزالة الحدود */
    text-align: center;
    font-weight: 700;
    font-size: 1.1em; 
    color: #111;
    background: transparent;
    appearance: textfield;
    padding: 0; /* إزالة البادينغ الداخلي */
    box-shadow: none; /* إزالة أي ظل قديم */
    border-radius: 0; /* إزالة الحدود الدائرية السابقة */
}
.codcp-model-qty-input::-webkit-outer-spin-button,
.codcp-model-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* إزالة التعديلات التي كانت للـ Checkbox المُخفى */
.codcp-model-card:has(input[type="checkbox"]:checked) .codcp-model-qty-input {
    color: #111 !important; /* إعادة اللون الأصلي */
    border-color: transparent !important; /* إعادة الحدود الشفافة */
    background: transparent !important; /* إعادة الخلفية الشفافة */
}


.codcp-note {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

/* Responsive */
@media (max-width: 520px) {
    .codcp-variations-section,
    .codcp-models-section {
        padding: 12px;
    }
    .codcp-model-card {
        /* إبقاء العناصر أفقية على الجوال لتحقيق التصميم المطلوب */
        flex-direction: row; 
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .codcp-model-thumb img {
        width: 48px;
        height: 48px;
        margin-left: 8px; /* مسافة يمين الصورة */
    }
    .codcp-model-meta {
        /* إبقاء flex: 1 لضمان الاسم يحتل بقية المساحة */
        flex: 1;
        margin-right: 8px; 
        margin-left: 8px;
        text-align: right;
    }
    /* تحسين على الشاشات الصغيرة للموديلات */
    .codcp-model-plus, .codcp-model-minus {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
    }
    .codcp-model-qty-input {
        width: 22px;
        height: 36px;
        font-size: 1em;
    }
}
/* ======= CODCP: force small circular qty buttons + model buttons override ======= */

/* ensure our vars exist */
:root { --codcp-primary: var(--codcp-primary, #007bff); --codcp-primary-contrast: #fff; }

/* reset box-sizing locally inside our widget to avoid theme weirdness */
#codcp-checkout-form-container, 
#codcp-checkout-form-container * {
  box-sizing: border-box !important;
}

/* Target quantity and model controls specifically with high specificity */
#codcp-checkout-form-container .codcp-quantity-control,
#codcp-checkout-form-container .codcp-quantity-box,
#codcp-checkout-form-container .codcp-model-qty {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* التعديل 1.2: إضافة تنسيق لضمان أن القسم الرئيسي لكمية المنتج يكون موزّعًا أفقيًا */
#codcp-checkout-form-container .codcp-quantity-section {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-top: 14px !important; /* للحفاظ على البادينغ الداخلي */
    padding-bottom: 14px !important; /* للحفاظ على البادينغ الداخلي */
    margin-top: 18px !important; /* للحفاظ على المسافات الخارجية */
    margin-bottom: 10px !important; /* للحفاظ على المسافات الخارجية */
}
#codcp-checkout-form-container .codcp-quantity-label {
    margin-bottom: 0 !important;
}


/* Square light buttons (+ and -) - OVERRIDE TO NEW STYLE */
#codcp-checkout-form-container button.codcp-qty-btn,
#codcp-checkout-form-container .codcp-model-plus,
#codcp-checkout-form-container .codcp-model-minus {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  line-height: 38px !important;
  padding: 0 !important;
  border-radius: 6px !important; /* SQUARE */
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  font-size: 18px !important; /* LARGER + / - SYMBOL */
  font-weight: 800 !important;
  color: #222 !important; /* DARK COLOR */
  background: #f7f7f7 !important; /* LIGHT GREY/WHITE */
  border: none !important;
  /* Shadow for lift effect - تم تصفير الظل هنا لضمان أن الكود الأقدم لا يطغى على الجديد */
  box-shadow: 0 0 0 0 rgba(0,0,0,0) !important;
  vertical-align: middle !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}
/* **✅ إعادة تفعيل أزرار العداد في قسم الـ Override** */
#codcp-checkout-form-container .codcp-model-plus,
#codcp-checkout-form-container .codcp-model-minus {
    display: inline-flex !important;
}


/* Hover and Active states for Square Light Buttons */
#codcp-checkout-form-container button.codcp-qty-btn:hover,
#codcp-checkout-form-container .codcp-model-plus:hover,
#codcp-checkout-form-container .codcp-model-minus:hover {
  transform: translateY(-1px) !important;
  background: #ebebeb !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}
#codcp-checkout-form-container button.codcp-qty-btn:active,
#codcp-checkout-form-container .codcp-model-plus:active,
#codcp-checkout-form-container .codcp-model-minus:active {
    background: #dfdfdf !important;
    transform: translateY(0) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}


/* Middle number: make it invisible border and transparent background */
#codcp-checkout-form-container .codcp-quantity-control input[type="number"],
#codcp-checkout-form-container .codcp-model-qty-input {
  /* **✅ إعادة تنسيق العداد ليكون مربعاً/مستطيلاً بدون حدود** */
  width: 25px !important; /* narrower width for just the number */
  height: 38px !important;
  min-width: 25px !important;
  min-height: 38px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important; /* REMOVE BORDER RADIUS */
  text-align: center !important;
  background: transparent !important;
  border: none !important; /* REMOVE BORDER */
  font-weight: 700 !important;
  font-size: 16px !important; /* SLIGHTLY LARGER FONT FOR NUMBER */
  color: #111 !important;
  -webkit-appearance: none !important;
  -moz-appearance: textfield !important;
  appearance: none !important;
  box-shadow: none !important;
}


/* إزالة التعديل الذي كان للـ Checkbox المُخفى */
#codcp-checkout-form-container .codcp-model-card:has(input[type="checkbox"]:checked) .codcp-model-qty-input {
    color: #111 !important; 
    border-color: transparent !important; 
    background: transparent !important; 
}


/* remove theme padding/line-height that may inflate button sizes */
#codcp-checkout-form-container button.codcp-qty-btn * , 
#codcp-checkout-form-container button.codcp-qty-btn {
  padding: 0 !important;
  line-height: 1 !important;
}

/* Force small icons if theme uses pseudo elements */
#codcp-checkout-form-container .codcp-qty-btn::before,
#codcp-checkout-form-container .codcp-qty-btn::after {
  display: none !important;
}

/* Very important: override global button/font-size inheritance that some themes set */
#codcp-checkout-form-container,
#codcp-checkout-form-container input,
#codcp-checkout-form-container button,
#codcp-checkout-form-container select,
#codcp-checkout-form-container label {
  font-size: 14px !important;
  font-family: inherit !important;
}

/* Ensure flex shrink so nothing stretches */
#codcp-checkout-form-container .codcp-quantity-control > * {
  flex-shrink: 0 !important;
}

/* Make model qty area aligned and compact */
#codcp-checkout-form-container .codcp-model-qty {
  gap: 8px !important;
}
#codcp-checkout-form-container .codcp-model-qty-input {
  width: 25px !important;
  height: 38px !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 0 !important;
  text-align: center !important;
}

/* If theme forces .button styles (Bootstrap-like), neutralize them for our buttons */
#codcp-checkout-form-container button.codcp-qty-btn.button,
#codcp-checkout-form-container .codcp-model-plus.button,
#codcp-checkout-form-container .codcp-model-minus.button {
  padding: 0 !important;
  height: 38px !important;
  width: 38px !important;
  border-radius: 6px !important;
  font-size: 18px !important;
}

/* Mobile tweak */
@media (max-width:520px){
  /* التعديل 2.2: لضمان أن بطاقة الموديل تظل أفقية على الجوال */
  #codcp-checkout-form-container .codcp-model-card {
      flex-direction: row !important;
      justify-content: space-between !important;
      align-items: center !important;
  }
  #codcp-checkout-form-container .codcp-model-meta {
      margin-left: 8px !important; 
      margin-right: 8px !important;
      text-align: right !important;
  }
  #codcp-checkout-form-container button.codcp-qty-btn,
  #codcp-checkout-form-container .codcp-model-plus,
  #codcp-checkout-form-container .codcp-model-minus {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    font-size: 16px !important;
  }
  #codcp-checkout-form-container .codcp-quantity-control input[type="number"],
  #codcp-checkout-form-container .codcp-model-qty-input {
    width: 22px !important;
    height: 36px !important;
    min-width: 22px !important;
    font-size: 15px !important;
  }
}
