/*
 * OPC Aflah Frontend Styles
 * Version: 5.1.5
 */

/* ==== Variable Product Styles ==== */
.opc-variable-attributes {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.opc-variable-attributes h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.opc-attribute-group {
    margin-bottom: 15px;
}

.opc-attribute-label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.opc-attribute-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Color Swatches */
.opc-attribute-color .opc-color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.opc-color-swatch:hover {
    transform: scale(1.1);
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.opc-color-swatch.selected {
    border-color: #007cba;
    border-width: 3px;
    transform: scale(1.15);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

.opc-color-swatch.selected::after {
    content: "✓";
    position: absolute;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.opc-color-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.opc-color-swatch:hover .opc-color-label {
    opacity: 1;
}

/* Size/Attribute Buttons */
.opc-attribute-button {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    min-width: 45px;
    text-align: center;
}

.opc-attribute-button:hover {
    border-color: #007cba;
    background: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.opc-attribute-button.selected {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 124, 186, 0.3);
}

.opc-attribute-button:disabled {
    background: #f5f5f5;
    border-color: #ccc;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Variation Info Display */
.opc-variation-info {
    margin-top: 15px;
    padding: 12px;
    background: #e8f4f8;
    border: 1px solid #b8dce8;
    border-radius: 6px;
}

.opc-variation-price {
    font-size: 16px;
    margin-bottom: 5px;
}

.opc-variation-stock {
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .opc-variable-attributes {
        padding: 15px;
        margin: 15px 0;
    }
    
    .opc-variable-attributes h4 {
        font-size: 16px;
    }
    
    .opc-color-swatch {
        width: 35px;
        height: 35px;
    }
    
    .opc-attribute-button {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 40px;
    }
    
    .opc-attribute-options {
        gap: 6px;
    }
}

/* RTL Support */
[dir="rtl"] .opc-variable-attributes,
.rtl .opc-variable-attributes {
    text-align: right;
}

/* Animation for selection feedback */
@keyframes selection-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.opc-color-swatch.selected,
.opc-attribute-button.selected {
    animation: selection-pulse 0.3s ease-out;
}

/* Disabled state for out of stock variations */
.opc-color-swatch.out-of-stock,
.opc-attribute-button.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    position: relative;
}

.opc-color-swatch.out-of-stock::before,
.opc-attribute-button.out-of-stock::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #ff4444;
    transform: translateY(-50%) rotate(-45deg);
}

/* Variation error messages */
.opc-variation-error {
    color: #d0021b;
    font-size: 12px;
    margin-top: 5px;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* ==== End Variable Product Styles ====*/

.opc-offers .offer-item, .opc-upsell-item-wrapper {
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.opc-offers .offer-item:hover,
.opc-upsell-item-wrapper:hover {
    border-color: var(--opc-submit-bg, #f5a623);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.opc-offers .offer-item:focus-within,
.opc-upsell-item-wrapper:focus-within {
    border-color: var(--opc-submit-bg, #f5a623);
    outline: none;
}
.opc-offers .offer-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.opc-offers .offer-item.selected {
    border-color: var(--opc-submit-bg, #f5a623);
    background-color: #fff8e1;
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
}

/* محتوى العرض */
.opc-offers .offer-content {
    flex: 1;
}
.opc-offers .offer-item input[type="radio"] { display: none; }
.opc-offers .offer-title { 
    font-weight: bold; 
    font-size: var(--opc-offer-title-size, 16px);
    display: block;
    margin-bottom: 4px;
}

/* سعر العرض - ENHANCED FOR BETTER COLOR CONTROL */
.opc-offers .offer-price { 
    color: #333; 
    font-weight: bold; 
    font-size: var(--opc-offer-price-size, 18px); 
    display: flex; 
    align-items: baseline; 
    flex-wrap: wrap; 
    justify-content: flex-end;
    flex-shrink: 0;
}

/* السعر الحالي - ENHANCED FOR BETTER COLOR CONTROL */
.opc-offers .offer-price .current-price {
    color: #333 !important;
    font-weight: bold;
    font-size: var(--opc-offer-current-price-size, 18px);
}

/* السعر القديم - RED WITH STRIKE-THROUGH */
.opc-offers .old-price { 
    text-decoration: line-through; 
    color: #e74c3c !important; 
    font-size: var(--opc-offer-old-price-size, 14px); 
    margin-left: 8px; 
    font-weight: normal;
}

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

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

/* Force override any theme conflicts for current price */
.opc-offers .offer-price .current-price,
.opc-offers .offer-price .current-price .amount,
.opc-offers .offer-price .current-price .woocommerce-Price-amount {
    color: #333 !important;
    text-decoration: none !important;
}

/* Force override any theme conflicts for old price */
.opc-offers .old-price,
.opc-offers .old-price .amount,
.opc-offers .old-price .woocommerce-Price-amount {
    color: #e74c3c !important;
    text-decoration: line-through !important;
}

/* Additional rules to ensure consistency */
.opc-offers .offer-price .current-price,
.opc-offers .offer-price .current-price .amount,
.opc-offers .offer-price .current-price .woocommerce-Price-amount,
.opc-offers .offer-price .current-price .woocommerce-Price-currencySymbol {
    color: #333 !important;
    text-decoration: none !important;
}

.opc-offers .old-price,
.opc-offers .old-price .amount,
.opc-offers .old-price .woocommerce-Price-amount,
.opc-offers .old-price .woocommerce-Price-currencySymbol {
    color: #e74c3c !important;
    text-decoration: line-through !important;
}

/* ENHANCED: Force red color for ALL elements within old price */
.opc-offers .old-price *,
.opc-offers .old-price .amount,
.opc-offers .old-price .woocommerce-Price-amount,
.opc-offers .old-price .woocommerce-Price-currencySymbol,
.opc-offers .old-price bdi,
.opc-offers .old-price span,
.opc-offers .old-price ins,
.opc-offers .old-price del {
    color: #e74c3c !important;
    text-decoration: line-through !important;
}

/* ENHANCED: Ensure current price elements are NOT red */
.opc-offers .offer-price .current-price *,
.opc-offers .offer-price .current-price .amount,
.opc-offers .offer-price .current-price .woocommerce-Price-amount,
.opc-offers .offer-price .current-price .woocommerce-Price-currencySymbol,
.opc-offers .offer-price .current-price bdi,
.opc-offers .offer-price .current-price span,
.opc-offers .offer-price .current-price ins,
.opc-offers .offer-price .current-price del {
    color: #333 !important;
    text-decoration: none !important;
}

/* NEW: Custom currency symbol styling for old price */
.opc-offers .old-price,
.opc-offers .opc-upsell-old-price {
    color: #e74c3c !important;
    text-decoration: line-through !important;
}

/* NEW: Custom currency symbol styling for current price */
.opc-offers .current-price,
.opc-offers .opc-upsell-new-price {
    color: #333 !important;
    text-decoration: none !important;
}
.opc-checkout-form { margin-top: 20px; border-top: 1px solid #eee; padding-top: 20px; animation: slideInDown 0.5s ease-out; }

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.opc-form-group { margin-bottom: 15px; position: relative; transition: transform 0.3s ease; }
.opc-form-group:focus-within { transform: scale(1.02); }
.opc-form-group input { width: 100%; padding: 12px 15px 12px 50px; border: 1px solid #ccc; border-radius: 8px; font-size: 16px; text-align: right; transition: border-color 0.3s ease; }
.opc-form-group input:focus { border-color: var(--opc-submit-bg, #f5a623); outline: none; }
.opc-form-group input.error { border-color: #d0021b; }
.opc-form-group input::placeholder { color: #999; opacity: 1; }
.opc-submit-btn, .opc-whatsapp-btn { width: 100%; padding: 15px; border-radius: 8px; border: none; font-size: 18px; font-weight: bold; text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-top: 10px; transition: all 0.3s; }
.opc-submit-btn:disabled { background-color: #ccc !important; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.opc-submit-btn.opc-loading { background-color: #ccc !important; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.opc-phone-error { color: #d0021b; font-size: 14px; margin-top: 5px; display: none; text-align: right; }
.opc-error-message { color: #d0021b; background: #ffe6e6; padding: 10px; border-radius: 5px; margin: 10px 0; text-align: center; border: 1px solid #f5c6cb; }
.opc-success-message { color: #28a745; background: #d4edda; padding: 10px; border-radius: 5px; margin: 10px 0; text-align: center; border: 1px solid #c3e6cb; }
.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; animation: bounce 2s infinite; }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-1px); }
}
.opc-input-icon { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); color: #aaa; transition: color 0.3s ease; }
.opc-form-group:focus-within .opc-input-icon { color: var(--opc-submit-bg, #f5a623); }
.opc-loader { width: 18px; height: 18px; border: 2px solid var(--opc-submit-text, #ffffff); border-bottom-color: transparent; border-radius: 50%; display: inline-block; box-sizing: border-box; animation: opc-rotation 1s linear infinite; margin-right: 10px; display: none; }
.opc-form-container.opc-loading { pointer-events: none; opacity: 0.7; }
.opc-form-container.opc-loading * { pointer-events: none; }
@keyframes opc-rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
/* Sticky Footer - Enhanced with scroll-based appearance and modern styling */
.opc-sticky-footer { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    background: rgba(255, 255, 255, 0.98); 
    padding: 15px 20px; 
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15); 
    z-index: 1000; 
    transform: translateY(100%); 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    display: none;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.1);
    opacity: 0;
    width: 100%;
    box-sizing: border-box;
}

.opc-sticky-footer.visible {
    transform: translateY(0);
    opacity: 1;
    display: block;
}

.opc-sticky-footer .opc-submit-btn {
    background: linear-gradient(135deg, var(--opc-submit-bg, #f5a623) 0%, var(--opc-submit-hover-bg, #e09520) 100%);
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.opc-sticky-footer .opc-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.opc-sticky-footer .opc-submit-btn:hover::before {
    left: 100%;
}

.opc-sticky-footer .opc-submit-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(245, 166, 35, 0.4);
    background: linear-gradient(135deg, var(--opc-submit-hover-bg, #e09520) 0%, var(--opc-submit-bg, #f5a623) 100%);
}

.opc-sticky-footer .opc-submit-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
}

/* Mobile sticky button control - Full width */
.opc-sticky-footer.mobile-enabled { 
    display: block;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    width: 100%;
}

/* Desktop sticky button control - Full width */
@media (min-width: 768px) {
    .opc-sticky-footer.desktop-enabled { 
        display: block;
        padding: 20px 30px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        border-top: 1px solid rgba(0,0,0,0.1);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        width: 100%;
    }
    
    .opc-sticky-footer.mobile-only { 
        display: none;
    }
    
    /* Desktop button styling - Full width */
    .opc-sticky-footer .opc-submit-btn {
        width: 100%;
        max-width: none;
        margin: 0;
        font-size: 20px;
        padding: 18px 32px;
        border-radius: 15px;
        box-shadow: 0 6px 20px rgba(245, 166, 35, 0.3);
    }
    
    /* Enhanced hover effect for desktop */
    .opc-sticky-footer .opc-submit-btn:hover {
        transform: translateY(-4px) scale(1.03);
        box-shadow: 0 10px 30px rgba(245, 166, 35, 0.5);
        background: linear-gradient(135deg, var(--opc-submit-hover-bg, #e09520) 0%, var(--opc-submit-bg, #f5a623) 100%);
    }
}

@media (max-width: 767px) {
    .opc-sticky-footer.desktop-only { 
        display: none;
    }
    
    .opc-sticky-footer.mobile-enabled { 
        display: block;
        padding: 15px 20px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        border-top: 1px solid rgba(0,0,0,0.1);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        width: 100%;
    }
    
    /* Mobile button styling - Full width */
    .opc-sticky-footer .opc-submit-btn {
        font-size: 16px;
        padding: 14px 20px;
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 12px;
    }
    
    /* Mobile hover effect - More subtle */
    .opc-sticky-footer .opc-submit-btn:hover {
        transform: translateY(-2px) scale(1.01);
        box-shadow: 0 6px 20px rgba(245, 166, 35, 0.4);
    }
}

/* Animation for sticky footer appearance */
@keyframes slideUp {
    from { 
        transform: translateY(100%);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.opc-sticky-footer.visible {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.opc-submit-btn { background-color: var(--opc-submit-bg, #f5a623) !important; color: var(--opc-submit-text, #ffffff) !important; }
.opc-submit-btn:hover:not(:disabled) { background-color: var(--opc-submit-hover-bg, #e09520) !important; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(245, 166, 35, 0.4); }
.opc-whatsapp-btn { background-color: var(--opc-whatsapp-bg, #25d366) !important; color: var(--opc-whatsapp-text, #ffffff) !important; }
.opc-whatsapp-btn:hover { background-color: var(--opc-whatsapp-hover-bg, #1da851) !important; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); }
.opc-offers .old-price .woocommerce-Price-amount { color: #e74c3c !important; }
.opc-offers .old-price .amount { color: #e74c3c !important; }
.opc-offer-discount { background-color: #e74c3c; color: white; padding: 2px 8px; border-radius: 5px; font-size: 12px; margin-top: 5px; display: inline-block; }
.opc-trust-icons { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 25px; flex-wrap: wrap; border-top: 1px solid #eee; padding-top: 20px; animation: fadeIn 0.5s ease-in; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.opc-trust-icons .opc-aflah-icon-item { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 13px; color: #555; transition: transform 0.3s ease; }
.opc-trust-icons .opc-aflah-icon-item:hover { transform: scale(1.1); }
.opc-trust-icons svg { width: 32px; height: 32px; margin-bottom: 8px; opacity: 0.8; transition: opacity 0.3s ease; }
.opc-trust-icons .opc-aflah-icon-item:hover svg { opacity: 1; }

/* Upsell Styles */
.opc-upsells-container { margin-top: 20px; border-top: 1px solid #eee; padding-top: 20px; animation: slideInUp 0.5s ease-out; }

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.opc-upsells-container h4 { text-align: center; font-size: 18px; margin-bottom: 15px; color: #333; font-weight: bold; }
.opc-upsell-item-wrapper { padding: 8px 12px !important; border-radius: var(--opc-offer-border-radius, 10px); }
.opc-upsell-item-content { display: flex; align-items: center; gap: 12px; width: 100%; }
.opc-upsell-item-wrapper.selected { border-color: #0073aa; transform: scale(1.02); box-shadow: 0 4px 15px rgba(0,115,170,0.3); }
/* *** الإصلاح النهائي هنا: استخدام المتغير الديناميكي لحجم الصورة *** */
.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-title { font-weight: bold !important; font-size: var(--opc-upsell-title-size, 13px) !important; }
.opc-upsell-price { display: flex; align-items: baseline; gap: 6px; }
.opc-upsell-old-price { text-decoration: line-through; color: #e74c3c !important; font-size: calc(var(--opc-upsell-price-size, 12px) - 1px) !important; }
.opc-upsell-old-price .woocommerce-Price-amount { color: #e74c3c !important; }
.opc-upsell-old-price .amount { color: #e74c3c !important; }
.opc-upsell-new-price { color: #333 !important; font-weight: bold !important; font-size: var(--opc-upsell-price-size, 12px) !important; }

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

/* Force override any theme conflicts for upsell prices */
.opc-upsell-new-price,
.opc-upsell-new-price .amount,
.opc-upsell-new-price .woocommerce-Price-amount {
    color: #333 !important;
    text-decoration: none !important;
}

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

/* ENHANCED: Force red color for ALL elements within upsell old price */
.opc-upsell-old-price *,
.opc-upsell-old-price .amount,
.opc-upsell-old-price .woocommerce-Price-amount,
.opc-upsell-old-price .woocommerce-Price-currencySymbol,
.opc-upsell-old-price bdi,
.opc-upsell-old-price span,
.opc-upsell-old-price ins,
.opc-upsell-old-price del {
    color: #e74c3c !important;
    text-decoration: line-through !important;
}

/* ENHANCED: Ensure upsell current price elements are NOT red */
.opc-upsell-new-price *,
.opc-upsell-new-price .amount,
.opc-upsell-new-price .woocommerce-Price-amount,
.opc-upsell-new-price .woocommerce-Price-currencySymbol,
.opc-upsell-new-price bdi,
.opc-upsell-new-price span {
    color: #333 !important;
    text-decoration: none !important;
}
.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-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); }

/* Countdown Timer Styles - عريض مثل الأزرار */
.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;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
    50% { box-shadow: 0 4px 25px rgba(245, 166, 35, 0.3); }
    100% { box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
}

.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;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.7; }
}

/* Mobile Improvements */
@media (max-width: 768px) {
    /* تحسين العروض للهاتف */
    .opc-offers .offer-item {
        gap: 8px;
        padding: 12px;
    }
    
    .opc-offers .offer-product-image {
        width: 50px;
        height: 50px;
    }
    
    /* هواتف صغيرة جداً */
    @media (max-width: 480px) {
        .opc-offers .offer-product-image {
            width: 45px;
            height: 45px;
        }
    }
    
    .opc-offers .offer-title {
        font-size: 14px;
    }
    
    .opc-offers .offer-price {
        font-size: 16px;
    }
    
    /* العداد الزمني للهاتف */
    .opc-countdown-timer {
        font-size: 16px;
        padding: 10px 12px;
        width: 100%;
    }
    
    .opc-countdown-timer .opc-timer-hours,
    .opc-countdown-timer .opc-timer-minutes,
    .opc-countdown-timer .opc-timer-seconds {
        padding: 3px 6px;
        margin: 0 2px;
        min-width: 25px;
        font-size: 18px;
    }
    
    #opc-global-timer-bar {
        font-size: 18px;
        padding: 10px 15px;
    }
    
    .opc-trust-icons {
        gap: 10px;
        justify-content: space-around;
    }
    .opc-trust-icons .opc-aflah-icon-item {
        font-size: 10px !important;
        flex-basis: 30%;
    }
    .opc-trust-icons .opc-aflah-icon-item svg {
        width: 24px !important;
        height: 24px !important;
        margin-bottom: 4px;
    }
}

/* Offer Styles */
.opc-offers { margin-bottom: 20px; }

/* صورة العرض - إضافة CSS للتأكد من ظهور الصور */
.opc-offers .offer-image {
    flex-shrink: 0;
    display: block !important;
    visibility: visible !important;
}

.opc-offers .offer-product-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #ddd;
    display: block !important;
    visibility: visible !important;
}

/* Product Info Section - معلومات المنتج (نص فقط بدون صورة) */
.opc-product-info {
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

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

.opc-product-details {
    width: 100%;
}

.opc-product-title {
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
    font-size: 20px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.opc-product-price {
    color: #d0021b;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(208, 2, 27, 0.2);
}

.opc-product-description {
    color: #666;
    line-height: 1.5;
    font-size: 14px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

/* Mobile Responsive for Product Info */
@media (max-width: 768px) {
    .opc-product-info {
        padding: 15px;
        margin-bottom: 15px;
    }

    .opc-product-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .opc-product-price {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .opc-product-description {
        font-size: 13px;
    }
}

/* Error and Success Message Styles */
.opc-error-message,
.opc-success-message {
    animation: slideIn 0.3s ease-out;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Enhanced success message styling */
.opc-success-message {
    position: relative;
    overflow: hidden;
}

.opc-success-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Form Validation Styles - ENHANCED for Real-time Validation */
.opc-form-group input.error {
    border-color: #d0021b !important;
    box-shadow: 0 0 0 2px rgba(208, 2, 27, 0.2);
}

.opc-form-group input.valid {
    border-color: #28a745 !important;
}

/* FIXED: Real-time validation states with better UX */
.opc-form-group input.is-valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2328a745' d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    transition: all 0.3s ease;
}

.opc-form-group input.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23dc3545' d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zM4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    transition: all 0.3s ease;
}

/* FIXED: Neutral state for untouched fields */
.opc-form-group input:not(.is-valid):not(.is-invalid) {
    border-color: #ddd !important;
    box-shadow: none;
    background-image: none;
    transition: all 0.3s ease;
}

/* FIXED: Focus states that don't interfere with validation */
.opc-form-group input:focus:not(.is-valid):not(.is-invalid) {
    border-color: #007cba !important;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
    outline: none;
}

/* Submit button disabled state - ENHANCED */
.opc-submit-btn.opc-disabled,
.opc-submit-btn:disabled {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    transform: none !important;
    box-shadow: none !important;
}

.opc-submit-btn.opc-enabled {
    background-color: var(--opc-submit-bg, #f5a623) !important;
    border-color: var(--opc-submit-bg, #f5a623) !important;
    color: var(--opc-submit-text, #ffffff) !important;
    cursor: pointer !important;
    opacity: 1 !important;
    transition: all 0.3s ease;
}

.opc-submit-btn.opc-enabled:hover {
    background-color: var(--opc-submit-hover-bg, #e09520) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.4);
}

/* Real-time validation feedback animation */
@keyframes validationSuccess {
    0% { 
        border-color: #28a745;
        box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
    }
    50% { 
        border-color: #28a745;
        box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.4);
    }
    100% { 
        border-color: #28a745;
        box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
    }
}

@keyframes validationError {
    0% { 
        border-color: #dc3545;
        box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
    }
    50% { 
        border-color: #dc3545;
        box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.4);
    }
    100% { 
        border-color: #dc3545;
        box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
    }
}

.opc-form-group input.is-valid {
    animation: validationSuccess 0.3s ease-out;
}

.opc-form-group input.is-invalid {
    animation: validationError 0.3s ease-out;
}

/* Loading State Styles */
.opc-form-container.opc-loading {
    position: relative;
}

.opc-form-container.opc-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
}

/* Network Error Styles */
.opc-network-error {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
}

/* Timeout Warning Styles */
.opc-timeout-warning {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
}

/* Additional spacing to prevent content from being hidden behind sticky footer */
.opc-form-container {
    padding-bottom: 100px; /* Space for sticky footer */
}

@media (max-width: 768px) {
    .opc-form-container {
        padding-bottom: 80px; /* Less space on mobile */
    }
}

/* Ensure sticky footer doesn't interfere with other elements */
.opc-sticky-footer {
    position: fixed !important;
    z-index: 9999 !important;
}

/* Smooth transitions for all interactive elements */
.opc-sticky-footer * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced focus states for accessibility */
.opc-sticky-footer .opc-submit-btn:focus {
    outline: 2px solid var(--opc-submit-bg, #f5a623);
    outline-offset: 2px;
}

/* Loading state for sticky button */
.opc-sticky-footer .opc-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Ensure proper text color in sticky button */
.opc-sticky-footer .opc-submit-btn {
    color: var(--opc-submit-text, #ffffff) !important;
}

/* Responsive adjustments for very small screens */
@media (max-width: 480px) {
    .opc-sticky-footer {
        padding: 12px 15px;
    }
    
    .opc-sticky-footer .opc-submit-btn {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .opc-sticky-footer {
        background: #ffffff !important;
        border-top: 2px solid #000000 !important;
    }
    
    .opc-sticky-footer .opc-submit-btn {
        border: 2px solid #000000 !important;
    }
}

/* Reduced motion support */
/* ==== Smart Sticky Button Visibility ==== */
/* Hide sticky button when form is visible on screen */
.opc-sticky-footer .opc-submit-btn.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Show sticky button when form is not visible */
.opc-sticky-footer .opc-submit-btn:not(.is-hidden) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

/* Enhanced visibility states for better UX */
.opc-sticky-footer .opc-submit-btn.is-hidden::before {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.opc-sticky-footer .opc-submit-btn:not(.is-hidden)::before {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Ensure smooth transitions on all states */
.opc-sticky-footer .opc-submit-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile optimizations for sticky button visibility */
@media (max-width: 768px) {
    .opc-sticky-footer .opc-submit-btn.is-hidden {
        transform: translateY(120%);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .opc-sticky-footer .opc-submit-btn:not(.is-hidden) {
        transform: translateY(0);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .opc-sticky-footer .opc-submit-btn.is-hidden,
    .opc-sticky-footer .opc-submit-btn:not(.is-hidden) {
        transition: opacity 0.1s ease, visibility 0.1s ease;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .opc-sticky-footer,
    .opc-sticky-footer * {
        transition: none !important;
        animation: none !important;
    }
    
    .opc-sticky-footer .opc-submit-btn:hover {
        transform: none !important;
    }
}