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

/* =========================================
   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; }

/* Swatches (Old Logic - Kept for fallback) */
.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; }

/* Upsell Popup */
.cep-upsell-popup-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 99999; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; }
.cep-upsell-popup-visible { opacity: 1; visibility: visible; }
.cep-upsell-popup { background: #fff; padding: 25px; border-radius: 16px; width: 90%; max-width: 380px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.2); transform: scale(0.9); transition: 0.3s; position: relative; }
.cep-upsell-popup-visible .cep-upsell-popup { transform: scale(1); }
.cep-upsell-content h3 { margin-top: 0; font-size: 18px; color: #111827; }
.cep-upsell-content p { color: #6b7280; margin-bottom: 20px; font-size: 14px; }
.cep-upsell-img-wrapper { position: relative; margin-bottom: 15px; display: inline-block; }
.cep-upsell-img-wrapper img { width: 100%; max-width: 200px; border-radius: 8px; display: block; margin: 0 auto; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.cep-upsell-badge { position: absolute; top: -10px; right: -10px; background: #ef4444; color: #fff; font-size: 12px; font-weight: bold; padding: 4px 8px; border-radius: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.cep-upsell-prices { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 18px; }
.cep-upsell-prices del { color: #9ca3af; font-size: 0.9em; text-decoration: line-through; }
.cep-upsell-prices ins { color: #16a34a; font-weight: bold; text-decoration: none; font-size: 1.1em; }
.cep-upsell-accept { background: #10b981; color: #fff; border: none; padding: 12px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; width: 100%; margin-bottom: 10px; font-size: 15px; }
.cep-upsell-skip { background: transparent; color: #9ca3af; border: none; cursor: pointer; text-decoration: underline; font-size: 13px; }

/* Sticky Elements Animations */
@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 cepSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Helper Class for Sticky Auto-Hide */
.cep-sticky-hidden-overlap {
    transform: translateY(100%) !important;
}

@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 --- */
/* Elementor WA Button Pro */
.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; }