/*
Theme Name: CODWO Express Pro Ultimate Styles
Version: 7.8.8
*/

/* =========================================
   1. Admin Panel Styles (Professional UI)
   ========================================= */
.cod-admin-wrapper { direction: rtl; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f0f1; margin: 0; padding: 0 0 50px; max-width: 1100px; margin-right: auto; margin-left: auto; }
.cod-admin-wrapper * { box-sizing: border-box; }

.cod-admin-header { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); padding: 15px 25px; border-radius: 0 0 12px 12px; border: 1px solid #c3c4c7; border-top: none; margin-bottom: 25px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 32px; z-index: 1000; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.cod-admin-header h1 { margin: 0; font-size: 20px; font-weight: 700; color: #1d2327; display: flex; align-items: center; gap: 8px; }
.cod-header-desc { margin: 5px 0 0 0; font-size: 13px; color: #646970; }
.cod-badge { background: #2271b1; color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 11px; margin-right: 10px; }

.cod-layout { display: flex; gap: 25px; align-items: flex-start; padding: 0 10px; }
.cod-sidebar { width: 250px; flex-shrink: 0; background: #fff; border: 1px solid #d1d5db; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.cod-nav { list-style: none; padding: 0; margin: 0; }
.cod-nav-item { padding: 14px 20px; cursor: pointer; border-bottom: 1px solid #f3f4f6; font-size: 14px; color: #4b5563; display: flex; align-items: center; gap: 10px; font-weight: 500; transition: all 0.2s ease; }
.cod-nav-item:last-child { border-bottom: none; }
.cod-nav-item:hover { background: #f9fafb; color: #2563eb; padding-right: 15px; }
.cod-nav-item.active { background: #eff6ff; color: #1d4ed8; font-weight: 700; border-right: 4px solid #3b82f6; padding-right: 16px; }
.cod-nav-item .dashicons { font-size: 18px; width: 18px; height: 18px; opacity: 0.8; }
.cod-nav-item.active .dashicons { opacity: 1; }

.cod-content { flex-grow: 1; min-width: 0; }
.cod-section { display: none; }
.cod-section.active { display: block; animation: codFadeIn 0.3s; }

/* Dashboard Cards & Accordion Styles */
.cod-card { background: #fff; border: 1px solid #d1d5db; border-radius: 12px; padding: 25px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); transition: all 0.3s ease; }
.cod-card-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding-bottom: 15px; border-bottom: 1px solid #f3f4f6; margin-bottom: 20px; user-select: none; transition: 0.2s; }
.cod-card-header h2 { margin: 0; padding: 0; border: none; font-size: 17px; color: #111827; font-weight: 700; transition: color 0.2s; }
.cod-card-header:hover h2 { color: #2563eb; }
.cod-card-header .dashicons { color: #6b7280; transition: transform 0.3s ease; }

/* Collapsed State */
.cod-card.collapsed .cod-card-header { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.cod-card.collapsed .cod-card-header .dashicons { transform: rotate(180deg); }

.cod-settings-group { background: #f9fafb; border: 1px solid #e5e7eb; padding: 20px; border-radius: 8px; margin-bottom: 15px; }
.cod-settings-group h4 { margin-top: 0; margin-bottom: 15px; color: #374151; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.cod-divider { border: 0; border-bottom: 1px dashed #d1d5db; margin: 20px 0; }
.cod-mt-15 { margin-top: 15px !important; }
.cod-mb-15 { margin-bottom: 15px !important; }

.cod-label { display: block; font-weight: 600; margin-bottom: 6px; color: #374151; font-size: 13px; }
.cod-row { margin-bottom: 15px; }
.cod-admin-wrapper input[type="text"], .cod-admin-wrapper input[type="number"], .cod-admin-wrapper select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; color: #111827; transition: border-color 0.2s; box-shadow: inset 0 1px 2px rgba(0,0,0,0.02); }
.cod-admin-wrapper input[type="text"]:focus, .cod-admin-wrapper input[type="number"]:focus, .cod-admin-wrapper select:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.cod-admin-wrapper input[type="color"] { height: 40px; padding: 2px; width: 100%; cursor: pointer; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; }

.cod-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cod-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

.cod-toggle-row { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid #e5e7eb; padding: 12px 15px; margin-bottom: 12px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.cod-toggle-row .cod-label { margin-bottom: 0; }
.cod-toggle { position: relative; display: inline-block; width: 44px; height: 24px; margin: 0; }
.cod-toggle input { opacity: 0; width: 0; height: 0; }
.cod-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .3s; border-radius: 34px; }
.cod-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .cod-slider { background-color: #10b981; }
input:checked + .cod-slider:before { transform: translateX(20px); }

.cod-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.cod-table th { text-align: right; background: #f9fafb; padding: 12px 15px; border-bottom: 1px solid #e5e7eb; font-size: 13px; font-weight: 600; color: #374151; }
.cod-table td { padding: 12px 15px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; background: #fff; }
.cod-table tr:last-child td { border-bottom: none; }

.cod-btn-save { background: #3b82f6; color: #fff; border: none; padding: 10px 24px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 14px; transition: 0.2s; display: flex; align-items: center; gap: 8px; box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3); }
.cod-btn-save:hover { background: #2563eb; transform: translateY(-1px); }

/* --- Pixels UI Layout (Professional SVGs) --- */
.cod-pixel-list { display: flex; flex-direction: column; gap: 15px; margin-top: 15px; }
.cod-pixel-item { display: flex; align-items: center; gap: 15px; background: #f9fafb; border: 1px solid #e5e7eb; padding: 15px; border-radius: 8px; transition: 0.2s; }
.cod-pixel-item:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); background: #fff; }
.cod-pixel-icon { width: 45px; height: 45px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.cod-pixel-input { flex-grow: 1; }
.cod-pixel-input label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.cod-pixel-input input { width: 100%; border: 1px solid #d1d5db; border-radius: 6px; height: 36px; padding: 0 12px; }

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

/* =========================================
   2. Frontend Styles
   ========================================= */
.cep-wrapper { opacity: 0; animation: codFadeIn 0.5s forwards; margin: 20px auto; font-size: 14px; line-height: 1.5; text-align: center; }
.cep-input.error { border-color: #ef4444 !important; background-color: #fff5f5 !important; }
.cep-var-section-title { font-size: 14px; color: #111827; margin-bottom: 8px; font-weight: 700; display: flex; justify-content: space-between; }
.cep-variations-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; justify-content: center; }
.cep-var-item-label { position: relative; cursor: pointer; transition: all 0.2s ease; box-sizing: border-box; }
.cep-var-item-label input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.cep-var-item-label:hover { opacity: 0.8; }

@keyframes cepPulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); } }

@media (max-width: 480px) {
    .cod-layout { flex-direction: column; padding: 0; }
    .cod-sidebar { width: 100%; margin-bottom: 15px; }
    .cod-grid-2, .cod-grid-3 { grid-template-columns: 1fr; gap: 15px; }
    .cep-field-wrapper-outer { flex: 1 1 100% !important; }
}

/* --- Loading State --- */
@keyframes cepSpinner { to { transform: rotate(360deg); } }
.cep-submit-btn.loading { position: relative; pointer-events: none; cursor: wait; }
.cep-submit-btn.loading:before { content: ''; display: inline-block; width: 1em; height: 1em; border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 50%; border-top-color: #ffffff; animation: cepSpinner 0.6s linear infinite; margin-left: 0.5em; vertical-align: middle; }

/* --- NEW WIDGET STYLES --- */
.cep-wa-btn-el { width: 60px; height: 60px; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.2); transition: transform 0.3s; cursor: pointer; }
.cep-wa-btn-el:hover { transform: scale(1.1); }
.cep-wa-btn-el svg { width: 60%; height: 60%; }
.cep-wa-btn-el.cep-wa-fixed { z-index: 99999; }

/* Sales Pop Notifications */
#cep-sales-popup-container { position: fixed; z-index: 9999; max-width: 300px; }
#cep-sales-popup-container.bottom-right { bottom: 20px; right: 20px; }
.cep-sales-pop { background: #ffffff; padding: 12px 15px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); font-size: 13px; opacity: 0; visibility: hidden; transition: opacity 0.3s, transform 0.3s; transform: translateY(20px); display: flex; align-items: center; gap: 10px; }
.cep-sales-pop.show { opacity: 1; visibility: visible; transform: translateY(0); }
.cep-sales-pop-icon { flex-shrink: 0; width: 20px; height: 20px; background: #4F46E5; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }

/* =========================================
   3. Split Variations Styles
   ========================================= */
.cep-attribute-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 15px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed #e5e7eb; }
.cep-attribute-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.cep-split-variations-wrapper { margin-bottom: 30px !important; }
.cep-var-section-title { display: flex; align-items: center; margin: 0 !important; padding: 0; line-height: 1; font-weight: 700; color: #1d2327; white-space: nowrap; flex-shrink: 0; }
.cep-selected-term { display: none !important; }
.cep-split-option { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 40px; padding: 0 12px; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; line-height: 1.2; color: #374151; transition: all 0.2s ease-in-out; box-sizing: border-box; position: relative; margin: 0; }
.cep-split-option:hover { border-color: #9ca3af; background-color: #f9fafb; transform: translateY(-1px); }
.cep-split-option.active { background-color: #000; color: #fff; border-color: #000; font-weight: 700; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transform: translateY(-1px); }
.cep-split-option img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; display: block; }
.cep-split-option .cep-var-text-only { pointer-events: none; white-space: nowrap; }
.cep-error-msg { color: #ef4444; font-size: 12px; margin-top: 6px; text-align: right; display: block; font-weight: 600; padding-right: 5px; animation: codFadeIn 0.3s forwards; }

/* =========================================
   4. الأزرار العائمة (Sticky Bar & WhatsApp)
   ========================================= */

.cep-sticky-bar {
    position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
    z-index: 99999 !important; 
    transform: translateY(150%) !important; transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    animation: none !important;
}
.cep-sticky-bar.cep-sticky-visible { transform: translateY(0) !important; }

/* --- Style 1: الافتراضي (الاحترافي) --- */
.cep-sticky-style_1 { padding: 12px 15px !important; box-shadow: 0 -5px 25px rgba(0,0,0,0.1) !important; border-top-left-radius: 20px; border-top-right-radius: 20px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cep-sticky-style_1 .cep-sticky-content { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 12px; max-width: 600px; margin: 0 auto; }
.cep-sticky-style_1 .cep-sticky-prod-detail { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.cep-sticky-style_1 .cep-sticky-img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; box-shadow: 0 2px 6px rgba(0,0,0,0.08); flex-shrink: 0; border: 1px solid rgba(0,0,0,0.05); }
.cep-sticky-style_1 .cep-sticky-info { display: flex !important; flex-direction: column; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cep-sticky-style_1 .cep-sticky-title { font-size: 13px !important; font-weight: 600; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cep-sticky-style_1 .cep-sticky-price { font-weight: 800 !important; font-size: 16px !important; margin-top: 2px; }
.cep-sticky-style_1 .cep-sticky-btn-action { width: auto !important; flex-shrink: 0; padding: 10px 24px !important; border-radius: 50px !important; display: flex !important; align-items: center; justify-content: center; position: relative; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important; transition: transform 0.2s ease !important; border: none; }

/* --- Style 2: الزر العريض فقط (بدون أي تفاصيل إضافية) --- */
.cep-sticky-style_2 { padding: 10px 15px !important; box-shadow: 0 -2px 10px rgba(0,0,0,0.08) !important; }
.cep-sticky-style_2 .cep-sticky-content { display: flex !important; max-width: 600px; margin: 0 auto; width: 100%; }
.cep-sticky-style_2 .cep-sticky-prod-detail { display: none !important; } /* الإخفاء التام للصورة والسعر */
.cep-sticky-style_2 .cep-sticky-btn-action { width: 100% !important; flex: 1; padding: 16px !important; border-radius: 8px !important; display: flex !important; align-items: center; justify-content: center; position: relative; overflow: hidden; border: none; font-weight: bold; }
.cep-sticky-style_2 .cep-sticky-icon { display: none !important; } /* إخفاء أيقونة السلة ليكون زراً نصياً نظيفاً */

/* --- Style 3: الكبسولة العائمة (Floating Pill) --- */
.cep-sticky-style_3 { bottom: 20px !important; width: calc(100% - 40px) !important; left: 20px !important; right: 20px !important; max-width: 500px !important; margin: 0 auto; border-radius: 100px !important; padding: 8px 8px 8px 20px !important; box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important; transform: translateY(200%) !important; }
.cep-sticky-style_3.cep-sticky-visible { transform: translateY(0) !important; }
.cep-sticky-style_3 .cep-sticky-content { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 10px; width: 100%; }
.cep-sticky-style_3 .cep-sticky-prod-detail { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; }
.cep-sticky-style_3 .cep-sticky-img { width: 40px; height: 40px; border-radius: 50px; object-fit: cover; flex-shrink: 0; }
.cep-sticky-style_3 .cep-sticky-info { display: flex !important; flex-direction: column; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cep-sticky-style_3 .cep-sticky-title { font-size: 12px !important; font-weight: 500; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cep-sticky-style_3 .cep-sticky-price { font-weight: 800 !important; font-size: 15px !important; }
.cep-sticky-style_3 .cep-sticky-btn-action { width: auto !important; flex-shrink: 0; padding: 10px 20px !important; border-radius: 50px !important; display: flex !important; align-items: center; justify-content: center; position: relative; overflow: hidden; border: none; }

/* تأثير اللمعان للأزرار */
.cep-sticky-btn-action:active { transform: scale(0.95) !important; }
.cep-sticky-btn-action::after { content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%; background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%); transform: skewX(-25deg); animation: cepShine 3s infinite; }
@keyframes cepShine { 0% { left: -100%; } 20% { left: 200%; } 100% { left: 200%; } }

/* الواتساب العائم */
.cep-sticky-wa {
    position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px;
    background: #25D366; color: #ffffff; border-radius: 50%; z-index: 999999 !important;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(0,0,0,0.2); text-decoration: none;
    animation: cepPulse 2s infinite; cursor: pointer; transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), bottom 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}
.cep-sticky-wa:hover { transform: scale(1.1); opacity: 0.9; }
.cep-sticky-wa svg { width: 60%; height: 60%; fill: currentColor; }

/* رفع زر الواتساب عند ظهور الشريط */
body.cep-sticky-bar-visible .cep-sticky-wa { bottom: 105px !important; }

@media (min-width: 768px) { .cep-hide-desktop { display: none !important; } }