/**
 * Dynamic Pricing CSS
 * Estilos para sistema de preços dinâmicos avançado
 * Superior ao TM Extra Product Options
 */

/* ==========================================================================
   Price Display Container
   ========================================================================== */

.eep-price-calculator {
    background: var(--eep-surface, #fff);
    border: 1px solid var(--eep-border, #e5e7eb);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.eep-price-calculator.calculating {
    opacity: 0.7;
    pointer-events: none;
}

.eep-price-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Main price display */
.eep-final-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--eep-final-bg, #f9fafb);
    border-radius: 8px;
    border-left: 4px solid var(--eep-accent, #1095F3);
}

.eep-final-price-label { font: inherit; font-weight: 600; color: var(--eep-text-strong, #111827); }

.eep-final-price-value { font-size: 1.125rem; font-weight: 700; color: var(--eep-accent, #1095F3); transition: color .2s ease; }

.eep-final-price-value.updating {
    animation: priceUpdate 0.5s ease;
}

/* ==========================================================================
   Price Breakdown
   ========================================================================== */

.eep-price-breakdown { border: 1px solid var(--eep-border, #e5e7eb); border-radius: 8px; overflow: hidden; margin: 8px 0; }

.eep-breakdown-toggle { background: var(--eep-muted, #f3f4f6); padding: 10px 14px; border: none; width: 100%; text-align: left; font: inherit; font-size: .9375rem; font-weight: 500; color: var(--eep-text, #374151); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background .2s ease; }

.eep-breakdown-toggle:hover { background: var(--eep-muted-strong, #e5e7eb); }

.eep-breakdown-toggle .eep-toggle-icon {
    transition: transform 0.3s ease;
}

.eep-breakdown-toggle.expanded .eep-toggle-icon {
    transform: rotate(180deg);
}

.eep-breakdown-content { display: none; padding: 0; background: var(--eep-surface, #fff); }

.eep-breakdown-content.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.eep-breakdown-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--eep-border-light, #f3f4f6); font-size: .9375rem; }

.eep-breakdown-item:last-child {
    border-bottom: none;
}

.eep-breakdown-item.base-price { color: var(--eep-text-muted, #6b7280); }
.eep-breakdown-item.extras { color: var(--eep-success, #059669); }
.eep-breakdown-item.discount { color: var(--eep-danger, #b91c1c); }

.eep-breakdown-item.discount .eep-breakdown-value::before {
    content: '-';
}

.eep-breakdown-label {
    flex: 1;
    margin-right: 12px;
}

.eep-breakdown-value {
    font-weight: 600;
    white-space: nowrap;
}

/* ==========================================================================
   Savings Indicator
   ========================================================================== */

.eep-savings-badge { background: var(--eep-success-bg, rgba(5,150,105,.08)); color: var(--eep-success, #059669); padding: 4px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }

.eep-savings-badge::before { content: '💰'; font-size: 13px; }

.eep-savings-badge.hidden {
    display: none;
}

/* ==========================================================================
   Price Modifiers Display
   ========================================================================== */

.eep-price-modifiers { margin-top: 8px; }

.eep-modifier-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.eep-modifier-item:last-child {
    margin-bottom: 0;
}

.eep-modifier-item.discount { background: rgba(185, 28, 28, 0.06); color: #b91c1c; border-left: 3px solid #b91c1c; }

.eep-modifier-item.surcharge { background: rgba(217, 119, 6, 0.08); color: #b45309; border-left: 3px solid #f59e0b; }

.eep-modifier-item.combo-discount { background: rgba(5, 150, 105, 0.06); color: #059669; border-left: 3px solid #059669; }

.eep-modifier-item.time-based {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-left: 3px solid #3498db;
}

.eep-modifier-description {
    flex: 1;
    margin-right: 8px;
}

.eep-modifier-amount {
    font-weight: 600;
    white-space: nowrap;
}

/* ==========================================================================
   Quantity-based Pricing
   ========================================================================== */

.eep-quantity-pricing {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin: 12px 0;
}

.eep-quantity-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.eep-quantity-tiers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.eep-quantity-tier {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.eep-quantity-tier.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
    transform: scale(1.05);
}

.eep-quantity-tier:hover {
    border-color: #3498db;
    color: #3498db;
}

/* ==========================================================================
   Real-time Price Updates
   ========================================================================== */

.eep-price-loading {
    position: relative;
    overflow: hidden;
}

.eep-price-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(52, 152, 219, 0.2),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

.eep-price-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 14px;
}

.eep-price-spinner::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #dee2e6;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   Promotional Badges
   ========================================================================== */

.eep-promotional-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.eep-promo-badge {
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.eep-promo-badge::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: shine 2s infinite;
}

.eep-promo-badge.combo {
    background: #28a745;
}

.eep-promo-badge.bulk {
    background: #17a2b8;
}

.eep-promo-badge.time {
    background: #ffc107;
    color: #212529;
}

/* ==========================================================================
   Comparison Pricing
   ========================================================================== */

.eep-price-comparison {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.eep-original-price {
    font-size: 16px;
    color: #6c757d;
    text-decoration: line-through;
    opacity: 0.7;
}

.eep-current-price {
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
}

.eep-price-arrow {
    color: #28a745;
    font-size: 14px;
    animation: bounce 1s infinite;
}

/* ==========================================================================
   Mobile Price Sticky Bar
   ========================================================================== */

.eep-mobile-price-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #dee2e6;
    padding: 12px 20px;
    display: none;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.eep-mobile-price-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.eep-mobile-price-total {
    font-size: 18px;
    font-weight: 700;
    color: #3498db;
}

.eep-mobile-add-to-cart {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.eep-mobile-add-to-cart:hover {
    background: #2980b9;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes priceUpdate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 300px;
        opacity: 1;
    }
}

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

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

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

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(0); }
    40% { transform: translateX(-3px); }
    60% { transform: translateX(3px); }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

/* Escopo claro por padrão: Dark mode desativado neste componente */

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .eep-price-calculator {
        padding: 16px;
        margin: 16px 0;
        border-radius: 8px;
    }
    
    .eep-final-price {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .eep-final-price-value {
        font-size: 20px;
    }
    
    .eep-breakdown-item {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .eep-modifier-item {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .eep-quantity-tiers {
        justify-content: center;
    }
    
    .eep-mobile-price-bar {
        display: block;
    }
    
    .eep-promotional-badges {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .eep-price-calculator {
        padding: 12px;
        margin: 12px 0;
    }
    
    .eep-final-price-value {
        font-size: 18px;
    }
    
    .eep-breakdown-toggle {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .eep-breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .eep-breakdown-value {
        align-self: flex-end;
    }
    
    .eep-price-comparison {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .eep-price-calculator {
        border-width: 2px;
        border-color: currentColor;
    }
    
    .eep-final-price {
        border-left-width: 6px;
    }
    
    .eep-modifier-item.discount {
        border-left-width: 4px;
    }
    
    .eep-modifier-item.surcharge {
        border-left-width: 4px;
    }
    
    .eep-modifier-item.combo-discount {
        border-left-width: 4px;
    }
    
    .eep-modifier-item.time-based {
        border-left-width: 4px;
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .eep-price-calculator,
    .eep-final-price-value,
    .eep-breakdown-toggle,
    .eep-modifier-item,
    .eep-quantity-tier,
    .eep-mobile-add-to-cart {
        transition: none;
        animation: none;
    }
    
    .eep-savings-badge,
    .eep-price-arrow {
        animation: none;
    }
    
    .eep-price-loading::after,
    .eep-promo-badge::before {
        animation: none;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .eep-price-calculator {
        border: 2px solid #000;
        box-shadow: none;
        background: white;
        break-inside: avoid;
    }
    
    .eep-breakdown-toggle {
        display: none;
    }
    
    .eep-breakdown-content {
        display: block !important;
    }
    
    .eep-mobile-price-bar {
        display: none;
    }
    
    .eep-promotional-badges {
        filter: grayscale(100%);
    }
}
