/* ================================================
   OPC Aflah Elementor Widget Styles - EXACT COPY OF ORIGINAL
   ================================================ */

/* Container styles - EXACT from original template */
.opc-form-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Form styles - EXACT from original */
#opc-order-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Offers section - EXACT from original */
.opc-offers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.opc-offers .offer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.opc-offers .offer-item:hover {
    border-color: #f5a623;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.2);
}

.opc-offers .offer-item.selected {
    border-color: var(--opc-submit-bg, #f5a623);
    background-color: #fff8e1;
}

.opc-offers .offer-item input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
    accent-color: #f5a623;
}

/* صورة العرض في Widget */
.opc-offers .offer-image {
    flex-shrink: 0;
    display: var(--opc-show-offer-image, block) !important;
}
.opc-offers .offer-product-image {
    width: var(--opc-offer-image-size, 60px);
    height: var(--opc-offer-image-size, 60px);
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #ddd;
}

/* محتوى العرض في Widget */
.opc-offers .offer-content {
    flex: 1;
}
.opc-offers .offer-item .offer-title {
    font-weight: bold;
    font-size: var(--opc-offer-title-size, 16px);
    display: block;
    margin-bottom: 4px;
}

.opc-offers .offer-item .opc-offer-discount {
    background: #ff4757;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 10px;
}

.opc-offers .offer-item .offer-price {
    color: #333;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.opc-offers .offer-item .old-price {
    text-decoration: line-through;
    color: #e74c3c !important;
    font-size: 14px;
}
.opc-offers .offer-item .old-price .woocommerce-Price-amount {
    color: #e74c3c !important;
}
.opc-offers .offer-item .old-price .amount {
    color: #e74c3c !important;
}

.opc-offers .offer-item .current-price {
    font-weight: bold;
    color: #333;
    font-size: 18px;
}

/* تأكيد لون السعر الحالي في جميع الحالات */
.opc-offers .offer-item .offer-price,
.opc-offers .offer-item .offer-price span:not(.old-price) {
    color: #333 !important;
}

/* تأكيد لون السعر القديم */
.opc-offers .offer-item .old-price,
.opc-offers .offer-item .old-price .amount,
.opc-offers .offer-item .old-price .woocommerce-Price-amount {
    color: #e74c3c !important;
}

/* Highlight ribbon - مطابق للكود الأصلي */
.opc-highlight-ribbon {
    position: absolute;
    top: -1px;
    right: -1px;
    background-color: var(--opc-submit-bg, #f5a623);
    color: var(--opc-submit-text, #ffffff);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    border-bottom-left-radius: 10px;
    line-height: 1;
    z-index: 1;
}



/* Upsells section - EXACT from original */
.opc-upsells-container {
    margin: 20px 0;
}

.opc-upsells-container h4 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.opc-upsell-item-wrapper {
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #ffffff;
}

.opc-upsell-item-wrapper:hover {
    border-color: #f5a623;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.2);
}

.opc-upsell-item-wrapper.selected {
    border-color: #f5a623;
    background: #fff8e7;
    box-shadow: 0 3px 12px rgba(245, 166, 35, 0.3);
}

.opc-upsell-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.opc-upsell-checkbox {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.4em;
    height: 1.4em;
    border: 0.15em solid #aaa;
    border-radius: 0.25em;
    transform: translateY(-0.075em);
    display: grid;
    place-content: center;
    margin-left: 10px;
    cursor: pointer;
}

.opc-upsell-item-content img {
    width: var(--opc-upsell-image-size, 45px) !important;
    height: var(--opc-upsell-image-size, 45px) !important;
    min-width: var(--opc-upsell-image-size, 45px) !important;
    border-radius: 6px !important;
    object-fit: cover !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.opc-upsell-info {
    flex-grow: 1;
}

.opc-upsell-checkbox::before {
    content: "";
    width: 0.75em;
    height: 0.75em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--opc-submit-bg, #f5a623);
    transform-origin: bottom left;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.opc-upsell-checkbox:checked::before {
    transform: scale(1);
}

.opc-upsell-title {
    font-weight: bold !important;
    font-size: var(--opc-upsell-title-size, 13px) !important;
    color: #333;
    margin-bottom: 5px;
}

.opc-upsell-price {
    display: flex;
    gap: 10px;
    align-items: center;
}

.opc-upsell-old-price {
    text-decoration: line-through;
    color: #e74c3c !important;
    font-size: 12px;
}
.opc-upsell-old-price .woocommerce-Price-amount {
    color: #e74c3c !important;
}
.opc-upsell-old-price .amount {
    color: #e74c3c !important;
}

.opc-upsell-new-price {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* تأكيد لون السعر الجديد للمنتجات الإضافية */
.opc-upsell-new-price,
.opc-upsell-new-price .amount,
.opc-upsell-new-price .woocommerce-Price-amount {
    color: #333 !important;
}

/* Checkout form section - EXACT from original */
.opc-checkout-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.opc-checkout-form h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    font-weight: bold;
}

/* Form groups - EXACT from original */
.opc-form-group {
    position: relative;
    margin-bottom: 20px;
}

.opc-form-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.opc-form-group input:focus {
    outline: none;
    border-color: #f5a623;
    box-shadow: 0 0 10px rgba(245, 166, 35, 0.2);
}

.opc-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    z-index: 2;
}

.opc-input-icon svg {
    width: 16px;
    height: 16px;
}

/* Phone validation - EXACT from original */
.opc-phone-error {
    display: none;
    color: #ff4757;
    font-size: 12px;
    margin-top: 5px;
    text-align: right;
}

.opc-phone-error.show {
    display: block;
}

/* Submit button - يستخدم المتغيرات الديناميكية */
.opc-submit-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--opc-submit-bg, #f5a623) !important;
    color: var(--opc-submit-text, #ffffff) !important;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.opc-submit-btn:hover:not(:disabled) {
    background-color: var(--opc-submit-hover-bg, #e09520) !important;
}

.opc-submit-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.opc-submit-btn.loading .opc-loader {
    display: inline-block;
}

/* Loader - EXACT from original */
.opc-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* WhatsApp button - EXACT from original */
.opc-whatsapp-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #25d366, #20b358);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    margin: 15px 0;
    transition: all 0.3s ease;
}

.opc-whatsapp-btn:hover {
    background: linear-gradient(45deg, #20b358, #1da851);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    color: white;
    text-decoration: none;
}

.opc-whatsapp-btn i {
    margin-left: 10px;
    font-size: 18px;
}

/* Trust icons - EXACT from original */
.opc-trust-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.opc-trust-icons .opc-aflah-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.opc-trust-icons .opc-aflah-icon-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.2);
}

.opc-trust-icons .opc-aflah-icon-item svg {
    width: 24px;
    height: 24px;
    color: #f5a623;
    margin-bottom: 8px;
}

.opc-trust-icons .opc-aflah-icon-item span {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Sticky Footer - زر الشراء اللاصق */
.opc-sticky-footer { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background-color: #fff; 
    padding: 15px; 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1); 
    z-index: 1000; 
    transform: translateY(150%); 
    transition: transform 0.4s ease-in-out; 
}
.opc-sticky-footer.visible { 
    transform: translateY(0); 
}
.opc-sticky-footer .opc-submit-btn { 
    margin: 0; 
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border-radius: 8px;
}
}

/* Success message - EXACT from original */
.opc-success-message {
    text-align: center;
    padding: 40px 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    color: #155724;
}

.opc-success-message h3 {
    color: #155724;
    margin-bottom: 15px;
    font-size: 24px;
}

.opc-success-message p {
    font-size: 16px;
    margin: 0;
}

/* Product info section (when enabled) */
.opc-product-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.opc-product-image {
    flex-shrink: 0;
}

.opc-product-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.opc-product-details {
    flex: 1;
}

.opc-product-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.opc-product-price {
    font-size: 18px;
    color: #f5a623;
    font-weight: bold;
    margin-bottom: 10px;
}

.opc-product-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive design - EXACT from original */
@media (max-width: 768px) {
    .opc-form-container {
        padding: 15px;
        margin: 10px;
    }
    
    /* تحسين العروض للهاتف - مع الصور */
    .opc-offers .offer-item {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 12px !important;
        margin-bottom: 8px !important;
    }
    
    .opc-offers .offer-product-image {
        width: calc(var(--opc-offer-image-size, 60px) * 0.83) !important;
        height: calc(var(--opc-offer-image-size, 60px) * 0.83) !important;
    }
    
    .opc-offers .offer-title {
        font-size: 14px !important;
    }
    
    .opc-offers .offer-price {
        color: #d0021b !important;
        font-weight: bold !important;
        font-size: 16px !important;
        flex-shrink: 0;
    }
    
    /* تحسين المنتجات الإضافية للهاتف - أفقي مثل الصورة */
    .opc-upsell-item-wrapper {
        padding: 8px !important;
        margin-bottom: 8px;
        border-radius: 8px;
    }
    
    .opc-upsell-item-content {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 0 !important;
        flex-direction: row !important;
        text-align: right !important;
    }
    
    .opc-upsell-item-content img {
        width: 45px !important;
        height: 45px !important;
        min-width: 45px !important;
        flex-shrink: 0 !important;
        border-radius: 6px;
        object-fit: cover;
        margin: 0;
    }
    
    .opc-upsell-info {
        flex: 1 !important;
        text-align: right;
    }
    
    .opc-upsell-title {
        font-size: 13px !important;
        margin-bottom: 3px;
        line-height: 1.3;
        font-weight: bold;
    }
    
    .opc-upsell-price {
        font-size: 12px !important;
        display: flex;
        align-items: baseline;
        gap: 4px;
    }
    
    .opc-upsell-checkbox {
        width: 1.2em !important;
        height: 1.2em !important;
        margin: 0 !important;
        margin-left: 8px !important;
        flex-shrink: 0 !important;
    }
    
    .opc-trust-icons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .opc-product-info {
        flex-direction: column;
        text-align: center;
    }
    
    .opc-product-image {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .opc-form-container {
        padding: 10px;
        margin: 5px;
    }
    
    .opc-trust-icons {
        grid-template-columns: 1fr;
    }
    
    .opc-highlight-ribbon {
        font-size: 10px;
        padding: 3px 10px;
        right: 10px;
    }
}



/* Animation classes for enhanced UX */
.opc-fade-in {
    animation: fadeIn 0.5s ease-in;
}

.opc-slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ===== Countdown Timer Styles for Widget - عريض مثل الأزرار ===== */
.opc-countdown-timer {
    background: var(--opc-submit-bg, #f5a623);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    margin: 10px 0;
    font-size: 18px;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.opc-countdown-timer .opc-timer-hours,
.opc-countdown-timer .opc-timer-minutes,
.opc-countdown-timer .opc-timer-seconds {
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 0 3px;
    min-width: 30px;
    display: inline-block;
    font-size: 20px;
    font-weight: bold;
}