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

/* =========================================
   1. Admin Panel Styles
   ========================================= */
.cod-admin-wrapper { direction: rtl; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f0f1; margin: 0; padding: 20px 0 50px; max-width: 1100px; margin-right: auto; margin-left: auto; }
.cod-admin-wrapper * { box-sizing: border-box; }
.cod-admin-header { background: #fff; padding: 15px 20px; border-radius: 8px; border: 1px solid #c3c4c7; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.cod-admin-header h1 { margin: 0; font-size: 18px; font-weight: 700; color: #1d2327; }
.cod-badge { background: #2271b1; color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 11px; }
.cod-layout { display: flex; gap: 20px; align-items: flex-start; }
.cod-sidebar { width: 220px; flex-shrink: 0; background: #fff; border: 1px solid #c3c4c7; border-radius: 8px; overflow: hidden; }
.cod-nav { list-style: none; padding: 0; margin: 0; }
.cod-nav-item { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #f0f0f1; font-size: 13px; color: #50575e; display: flex; align-items: center; gap: 8px; font-weight: 500; transition: 0.2s; }
.cod-nav-item:hover { background: #f6f7f7; color: #2271b1; }
.cod-nav-item.active { background: #f0f6fc; color: #2271b1; border-right: 3px solid #2271b1; font-weight: 700; }
.cod-nav-item .dashicons { font-size: 16px; width: 16px; height: 16px; }
.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 #c3c4c7; border-radius: 8px; padding: 20px; margin-bottom: 15px; }
.cod-card h2 { margin-top: 0; padding-bottom: 12px; border-bottom: 1px solid #f0f0f1; font-size: 16px; color: #1d2327; margin-bottom: 20px; }
.cod-label { display: block; font-weight: 600; margin-bottom: 5px; color: #2c3338; 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: 36px; padding: 0 10px; border: 1px solid #8c8f94; border-radius: 4px; }
.cod-admin-wrapper input[type="color"] { height: 36px; padding: 3px; width: 100%; cursor: pointer; border: 1px solid #8c8f94; border-radius: 4px; }
.cod-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.cod-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
.cod-toggle-row { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid #c3c4c7; padding: 10px; margin-bottom: 10px; border-radius: 4px; }
.cod-toggle { position: relative; display: inline-block; width: 36px; height: 20px; }
.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: #ccc; transition: .4s; border-radius: 34px; }
.cod-slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .cod-slider { background-color: #2271b1; }
input:checked + .cod-slider:before { transform: translateX(16px); }
.cod-table { width: 100%; border-collapse: collapse; }
.cod-table th { text-align: right; background: #f6f7f7; padding: 10px; border-bottom: 1px solid #c3c4c7; font-size: 13px; }
.cod-table td { padding: 10px; border-bottom: 1px solid #f0f0f1; vertical-align: middle; }
.cod-btn-save { background: #2271b1; color: #fff; border: none; padding: 8px 20px; border-radius: 4px; cursor: pointer; font-weight: 600; }
@keyframes codFadeIn { from { opacity:0; transform:translateY(5px); } 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; }
    .cod-sidebar { width: 100%; margin-bottom: 15px; }
    .cep-field-wrapper-outer { flex: 1 1 100% !important; }
}

/* --- COD Countdown Widget Styles --- */
.cep-countdown-widget-wrapper { display: block; width: 100%; box-sizing: border-box; }
.cep-countdown-title { font-weight: bold; font-size: 16px; margin-bottom: 10px; color: #333; text-align: center; }
.cep-countdown-widget { display: flex; align-items: center; justify-content: center; gap: 8px; direction: ltr; }
.cep-timer-item { display: flex; flex-direction: column; align-items: center; }
.cep-timer-box { background: #000; color: #fff; width: 60px; height: 60px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 24px; line-height: 1; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.cep-timer-digit { font-family: monospace, sans-serif; }
.cep-timer-label { font-size: 11px; color: #666; margin-top: 5px; text-transform: uppercase; font-weight: 600; }
.cep-timer-sep { font-size: 20px; font-weight: bold; color: #333; margin-bottom: 20px; }

/* --- 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.top-right { top: 20px; right: 20px; }
#cep-sales-popup-container.bottom-right { bottom: 20px; right: 20px; }
#cep-sales-popup-container.top-left { top: 20px; left: 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;
}
.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; }

/* =========================================
   شريط "اطلب الآن" العائم الاحترافي والدائم الظهور (Sticky Bar)
   ========================================= */
.cep-sticky-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99999 !important; /* لضمان بقائه فوق كل شيء عدا زر الواتساب */
    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);
    
    /* مخفي مبدئياً خارج الشاشة من الأسفل */
    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; 
}

.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-prod-detail { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.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-info { display: flex !important; flex-direction: column; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cep-sticky-title { font-size: 13px !important; font-weight: 600; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cep-sticky-price { font-weight: 800 !important; font-size: 16px !important; margin-top: 2px; }
.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;
}
.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%; } }

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