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

/* =========================================
   1. Admin Panel Styles
   ========================================= */
.cod-admin-wrapper { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f0f1; margin: 0; padding: 0 0 50px; max-width: 1100px; margin-inline: 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-inline-start: 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-inline-end: 15px; }
.cod-nav-item.active { background: #eff6ff; color: #1d4ed8; font-weight: 700; border-inline-start: 4px solid #3b82f6; padding-inline-end: 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; }
.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; }
.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; text-align: start; }
.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); text-align: start; }
.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; inset-inline-start: 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); }
:dir(rtl) 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: start; 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-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); }
.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; text-align: start; }
.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-error-msg { color: #ef4444; font-size: 12px; margin-top: 6px; text-align: start; display: block; font-weight: 600; padding-inline-end: 5px; animation: codFadeIn 0.3s forwards; }

@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); } }
@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-inline-start: 0.5em; vertical-align: middle; }

/* Sticky WhatsApp & Popups */
.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; }

#cep-sales-popup-container { position: fixed; z-index: 9999; max-width: 300px; }
#cep-sales-popup-container.bottom-right { bottom: 20px; right: 20px; }
#cep-sales-popup-container.bottom-left { bottom: 20px; left: 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; text-align: start; }
.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. Floating Buttons (Sticky Bar)
   ========================================= */
.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; }
.cep-sticky-bar.cep-sticky-visible { transform: translateY(0) !important; }

.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; text-align: start; }
.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; }

.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; }

.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; text-align: start; }
.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; 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; }

/* =========================================
   4. Smart Variations System (Pills, Squares, Images, Alerts, Colors)
   ========================================= */
.cep-modern-variations-wrapper { background: #fdfdfd; padding: 20px; border-radius: 12px; border: 1px solid #e5e7eb; margin-bottom: 20px; text-align: start; box-shadow: 0 2px 10px rgba(0,0,0,0.02); transition: border-color 0.3s ease, background-color 0.3s ease; }

@keyframes cepShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.cep-modern-variations-wrapper.cep-var-error { border-color: #fca5a5 !important; background-color: #fff1f2 !important; animation: cepShake 0.6s; }
.cep-var-main-title { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed #e5e7eb; text-align: start; }
.cep-var-dynamic-preview { text-align: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px dashed #e5e7eb; }
.cep-var-dynamic-preview img { transition: transform 0.3s ease; }
.cep-var-dynamic-preview img:hover { transform: scale(1.05); }
.cep-modern-attr-row { margin-bottom: 18px; text-align: start; }
.cep-modern-attr-row:last-child { margin-bottom: 0; }
.cep-modern-attr-title { font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cep-modern-selected-label { color: #3b82f6; font-weight: 600; font-size: 13px; }
.cep-modern-attr-options { display: flex; flex-wrap: wrap; gap: 10px; }
.cep-modern-option { padding: 10px 18px; background: #ffffff; border: 2px solid #e5e7eb; cursor: pointer; transition: all 0.2s ease-in-out; font-size: 14px; color: #4b5563; font-weight: 600; user-select: none; display: flex; align-items: center; justify-content: center; min-width: 50px; position: relative; }

/* الأشكال الهندسية */
.cep-modern-variations-wrapper[data-style="pills"] .cep-modern-option { border-radius: 50px !important; }
.cep-modern-variations-wrapper[data-style="rounded"] .cep-modern-option { border-radius: 8px !important; }
.cep-modern-variations-wrapper[data-style="squares"] .cep-modern-option { border-radius: 0px !important; }

.cep-modern-option:hover:not(.disabled):not(.cep-color-swatch) { border-color: #9ca3af; color: #111827; transform: translateY(-1px); }
.cep-modern-option.selected:not(.cep-color-swatch) { border-color: #000000; background: #000000; color: #ffffff; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transform: translateY(-1px); }
.cep-modern-option.disabled:not(.cep-color-swatch) { opacity: 0.4; background: #f3f4f6; color: #9ca3af; cursor: not-allowed; text-decoration: line-through; border-color: #f3f4f6; }

/* Color Swatches Smart Engine */
.cep-color-swatch { width: 45px !important; height: 45px !important; min-width: auto !important; padding: 0 !important; color: transparent !important; border: 2px solid #e5e7eb !important; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.cep-color-swatch span.cep-swatch-tooltip { display: block !important; opacity: 0; visibility: hidden; position: absolute; bottom: 115%; left: 50%; transform: translateX(-50%) translateY(10px); background: #111827; color: #ffffff !important; font-size: 12px !important; font-weight: normal !important; padding: 4px 8px !important; border-radius: 4px; white-space: nowrap; transition: all 0.2s ease; pointer-events: none; z-index: 10; }
.cep-color-swatch span.cep-swatch-tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: #111827 transparent transparent transparent; }
.cep-color-swatch:hover span.cep-swatch-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.cep-color-swatch.selected { border-color: #000000 !important; box-shadow: 0 0 0 3px #ffffff inset, 0 0 0 2px #000000 !important; transform: scale(1.1) !important; }
.cep-color-swatch.disabled { position: relative; opacity: 0.3 !important; cursor: not-allowed !important; border-color: #e5e7eb !important; }
.cep-color-swatch.disabled::after { content: ''; position: absolute; top: 50%; left: -10%; width: 120%; height: 2px; background: rgba(0,0,0,0.5); transform: rotate(-45deg); z-index: 1; }

/* =========================================
   5. Mobile Responsiveness
   ========================================= */
@media (max-width: 768px) {
    .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; }
    .cep-hide-desktop { display: block !important; }
    .cep-modern-variations-wrapper { padding: 15px; }
    .cep-modern-attr-options { gap: 8px; }
    .cep-modern-option:not(.cep-color-swatch) { padding: 8px 12px !important; font-size: 13px !important; min-width: 40px !important; }
    .cep-color-swatch { width: 38px !important; height: 38px !important; }
    .cep-var-dynamic-preview img { width: 100px !important; height: 100px !important; }
}