/**
 * Emirates Gifts Enhanced English Currency Fix CSS v20251101
 * Ensures proper AED currency display, formatting, and user experience
 * Author: Emirates Gifts Development Team
 */

/* Root Variables for Currency Styling */
:root {
    --price-primary: #27ae60;
    --price-original: #e74c3c;
    --price-currency: #D4AF37;
    --price-savings: #e74c3c;
    --price-background: rgba(212, 175, 55, 0.1);
    --price-shadow: rgba(39, 174, 96, 0.2);
}

/* Base Currency Display Fixes for English Version */
.current-price,
.product-price,
.cart-total,
.checkout-total,
.order-total,
.summary-price,
.item-price,
.final-amount,
.subtotal-amount,
.vat-amount,
.shipping-amount {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    direction: ltr !important;
    text-align: left !important;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

/* Enhanced Price Display */
.current-price {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--price-primary);
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    background: var(--price-background);
    padding: 8px 16px;
    border-radius: 25px;
    border: 2px solid var(--price-currency);
    box-shadow: 0 4px 15px var(--price-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.current-price::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.current-price:hover::before {
    left: 100%;
}

.current-price::after {
    content: ' AED';
    font-size: 0.8em;
    font-weight: 700;
    color: var(--price-currency);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Original Price Styling */
.original-price {
    font-size: 1.1rem;
    color: var(--price-original);
    text-decoration: line-through;
    font-weight: 600;
    opacity: 0.8;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.original-price::after {
    content: ' AED';
    font-size: 0.9em;
    font-weight: 600;
    color: var(--price-original);
    opacity: 0.7;
}

/* Remove any conflicting currency symbols */
.price-no-symbol::after {
    content: '' !important;
    display: none !important;
}

/* Enhanced Product Pricing Container */
.product-pricing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
    margin: 16px 0;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(39, 174, 96, 0.05));
    border-radius: 12px;
    flex-wrap: wrap;
}

/* Savings Display */
.savings-amount {
    color: var(--price-savings);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 6px 12px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(231, 76, 60, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.savings-amount::before {
    content: '💵 Save ';
    font-weight: 600;
    opacity: 0.8;
}

.savings-amount::after {
    content: ' AED';
    font-size: 0.9em;
    opacity: 0.8;
}

/* Enhanced Discount Badge */
.discount-badge {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 3px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
    }
}

/* Cart and Checkout Enhancements */
.cart-item .item-price,
.cart-item .item-total {
    font-weight: 800;
    color: var(--price-primary);
    background: var(--price-background);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--price-currency);
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

.cart-summary .total-row {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--price-primary);
    background: linear-gradient(135deg, var(--price-background), rgba(39, 174, 96, 0.1));
    padding: 20px;
    border-radius: 15px;
    border: 3px solid var(--price-currency);
    margin: 20px 0;
    box-shadow: 0 6px 25px var(--price-shadow);
    text-align: center;
    position: relative;
}

.cart-summary .total-row::before {
    content: '💰';
    font-size: 1.5rem;
    margin-right: 12px;
}

/* Checkout Summary Styling */
.checkout-summary .summary-item-price {
    font-weight: 700;
    color: var(--price-primary);
    background: var(--price-background);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.checkout-totals .total-amount {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--price-primary);
    background: linear-gradient(135deg, var(--price-background), rgba(39, 174, 96, 0.2));
    padding: 16px 24px;
    border-radius: 20px;
    border: 3px solid var(--price-currency);
    box-shadow: 0 6px 25px var(--price-shadow);
    text-align: center;
    margin: 20px 0;
}

.checkout-totals .total-amount::before {
    content: '⭐ Total: ';
    font-size: 0.9em;
    opacity: 0.8;
}

/* Product Card Price Enhancements */
.product-card .product-pricing {
    background: linear-gradient(135deg, 
        rgba(212, 175, 55, 0.08) 0%, 
        rgba(39, 174, 96, 0.05) 50%, 
        rgba(212, 175, 55, 0.08) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
    padding: 20px 16px;
    margin: 16px 0;
    position: relative;
    overflow: hidden;
}

.product-card .product-pricing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--price-currency), var(--price-primary), var(--price-currency));
}

/* Loading States */
.price-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    height: 2rem;
    width: 120px;
    display: inline-block;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Error States */
.price-error {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(231, 76, 60, 0.3);
    font-weight: 600;
}

.price-error::before {
    content: '⚠️ ';
    margin-right: 4px;
}

/* Animation for Price Updates */
@keyframes priceUpdate {
    0% {
        transform: scale(1);
        background: var(--price-background);
    }
    25% {
        transform: scale(1.05);
        background: rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: scale(1.08);
        background: rgba(39, 174, 96, 0.3);
    }
    75% {
        transform: scale(1.05);
        background: rgba(255, 215, 0, 0.3);
    }
    100% {
        transform: scale(1);
        background: var(--price-background);
    }
}

.price-updated {
    animation: priceUpdate 0.8s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .current-price {
        font-size: 1.3rem;
        padding: 6px 12px;
    }
    
    .original-price {
        font-size: 1rem;
        padding: 3px 8px;
    }
    
    .product-pricing {
        flex-direction: column;
        gap: 12px;
        padding: 16px 12px;
    }
    
    .cart-summary .total-row {
        font-size: 1.2rem;
        padding: 16px;
    }
    
    .checkout-totals .total-amount {
        font-size: 1.4rem;
        padding: 12px 16px;
    }
    
    .discount-badge {
        font-size: 0.7rem;
        padding: 6px 12px;
        top: 8px;
        right: 8px;
    }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .current-price {
        font-size: 1.4rem;
    }
    
    .cart-summary .total-row {
        font-size: 1.25rem;
    }
}

/* Large Screens */
@media (min-width: 1200px) {
    .current-price {
        font-size: 1.6rem;
        padding: 10px 20px;
    }
    
    .checkout-totals .total-amount {
        font-size: 1.8rem;
        padding: 20px 32px;
    }
}

/* High DPI Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .current-price,
    .original-price,
    .savings-amount {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
}

/* Print Styles */
@media print {
    .current-price,
    .original-price,
    .cart-total {
        color: #000 !important;
        background: transparent !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .discount-badge {
        background: #ccc !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    
    .current-price::after,
    .original-price::after {
        color: #000 !important;
    }
}

/* Accessibility Enhancements */
.price-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
.product-card:focus-within .current-price,
.cart-item:focus-within .item-price {
    outline: 3px solid var(--price-currency);
    outline-offset: 4px;
    border-radius: 8px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .current-price {
        border: 3px solid currentColor;
        background: white;
        color: #000;
    }
    
    .original-price {
        border: 2px solid currentColor;
        background: white;
        color: #000;
    }
    
    .discount-badge {
        border: 2px solid white;
        background: #000;
        color: white;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .current-price::before,
    .price-updated,
    .discount-badge {
        animation: none;
        transition: none;
    }
    
    .current-price:hover::before {
        left: -100%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --price-primary: #2ecc71;
        --price-original: #e67e22;
        --price-currency: #f1c40f;
        --price-background: rgba(241, 196, 15, 0.15);
        --price-shadow: rgba(46, 204, 113, 0.25);
    }
    
    .current-price {
        background: rgba(241, 196, 15, 0.2);
        color: #2ecc71;
        border-color: #f1c40f;
    }
    
    .original-price {
        background: rgba(230, 126, 34, 0.15);
        border-color: rgba(230, 126, 34, 0.4);
        color: #e67e22;
    }
}

/* Currency Symbol Utilities */
.currency-before::before {
    content: attr(data-currency) ' ';
    font-weight: 700;
    color: var(--price-currency);
}

.currency-after::after {
    content: ' ' attr(data-currency);
    font-weight: 700;
    color: var(--price-currency);
}

/* Price Container Layout */
.price-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.price-container .current-price {
    order: 1;
    flex: 0 0 auto;
}

.price-container .original-price {
    order: 2;
    flex: 0 0 auto;
}

.price-container .savings-amount {
    order: 3;
    flex: 0 0 auto;
}

/* Prevent Text Selection on Interactive Prices */
.product-card .current-price,
.product-card .original-price,
.product-card .savings-amount {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
}

/* Special Offer Indicators */
.price-special {
    position: relative;
}

.price-special::before {
    content: '🎉 Special Offer';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    z-index: 2;
}

/* Flash Sale Indicator */
.price-flash {
    animation: flashSale 1.5s infinite;
}

@keyframes flashSale {
    0%, 100% {
        background: var(--price-background);
    }
    50% {
        background: rgba(255, 215, 0, 0.3);
    }
}

/* Limited Time Offer */
.price-limited::after {
    content: '⏰ Limited Time';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff6b6b;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}