/**
 * EEP Modules CSS
 * Estilos para os módulos reutilizáveis
 */

/* ===== TOAST NOTIFICATIONS ===== */
.eep-toast-container {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    padding: 20px;
}

.eep-toast-container.top-right {
    top: 0;
    right: 0;
}

.eep-toast-container.top-left {
    top: 0;
    left: 0;
}

.eep-toast-container.bottom-right {
    bottom: 0;
    right: 0;
}

.eep-toast-container.bottom-left {
    bottom: 0;
    left: 0;
}

.eep-toast {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 16px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.eep-toast:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.eep-toast-icon {
    flex-shrink: 0;
    margin-right: 12px;
}

.eep-toast-content {
    flex: 1;
}

.eep-toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.eep-toast-message {
    color: #666;
    font-size: 14px;
}

.eep-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    margin-left: 12px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.eep-toast-close:hover {
    color: #333;
}

/* Toast Types */
.eep-toast-success {
    border-left: 4px solid #28a745;
}

.eep-toast-success .eep-toast-icon {
    color: #28a745;
}

.eep-toast-error {
    border-left: 4px solid #dc3545;
}

.eep-toast-error .eep-toast-icon {
    color: #dc3545;
}

.eep-toast-warning {
    border-left: 4px solid #ffc107;
}

.eep-toast-warning .eep-toast-icon {
    color: #ffc107;
}

.eep-toast-info {
    border-left: 4px solid #17a2b8;
}

.eep-toast-info .eep-toast-icon {
    color: #17a2b8;
}

/* ===== LOADING OVERLAY ===== */
.eep-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999998;
}

.eep-loading-content {
    text-align: center;
    color: #fff;
}

.eep-loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: eep-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes eep-spin {
    to { transform: rotate(360deg); }
}

.eep-loading-message {
    font-size: 16px;
}

/* ===== PROGRESS BAR ===== */
.eep-progress-container {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.eep-progress-message {
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.eep-progress-bar {
    background: #f0f0f0;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.eep-progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eep-progress-text {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* ===== VALIDATION STATES ===== */
.eep-validation-error {
    border-color: #dc3545 !important;
}

.eep-validation-warning {
    border-color: #ffc107 !important;
}

.eep-validation-success {
    border-color: #28a745 !important;
}

.eep-validation-message {
    display: flex;
    align-items: center;
    padding: 12px;
    margin: 10px 0;
    border-radius: 6px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    font-size: 14px;
}

.eep-validation-message svg {
    margin-right: 8px;
    flex-shrink: 0;
}

.eep-validation-error .eep-validation-message {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* ===== QUANTITY CONTROLS ===== */
.eep-quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.eep-quantity-decrease,
.eep-quantity-increase {
    background: #f8f9fa;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.eep-quantity-decrease:hover,
.eep-quantity-increase:hover {
    background: #e9ecef;
}

.eep-quantity-decrease:active,
.eep-quantity-increase:active {
    background: #dee2e6;
}

.eep-quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    padding: 0 8px;
    height: 32px;
    font-size: 14px;
}

.eep-quantity-input:focus {
    outline: none;
    background: #f8f9fa;
}

/* Remove spin buttons */
.eep-quantity-input::-webkit-inner-spin-button,
.eep-quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.eep-quantity-input[type=number] {
    -moz-appearance: textfield;
}

/* ===== SELECTION STATES ===== */
.eep-selectable-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.eep-selectable-item:hover {
    transform: translateY(-2px);
}

.eep-selectable-item.selected,
.eep-selectable-item.eep-selected {
    border-color: var(--eep-primary-color, #1095F3);
    background: var(--eep-selected-bg, #f0f8ff);
}

.eep-selection-transition {
    animation: eep-pulse 0.3s ease;
}

@keyframes eep-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ===== HIGHLIGHT EFFECTS ===== */
.eep-highlight-success {
    background: #d4edda !important;
    border-color: #c3e6cb !important;
}

.eep-highlight-error {
    background: #f8d7da !important;
    border-color: #f5c6cb !important;
}

.eep-highlight-warning {
    background: #fff3cd !important;
    border-color: #ffeeba !important;
}

.eep-highlight-info {
    background: #d1ecf1 !important;
    border-color: #bee5eb !important;
}

/* ===== ANIMATIONS ===== */
.eep-shake {
    animation: eep-shake 0.5s;
}

@keyframes eep-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.eep-pulse {
    animation: eep-pulse-full 1s;
}

@keyframes eep-pulse-full {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== MAX SELECTIONS REACHED ===== */
.eep-max-reached {
    position: relative;
}

.eep-max-reached::after {
    content: 'Máximo atingido';
    position: absolute;
    top: -25px;
    right: 0;
    background: #ffc107;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    animation: eep-fadeIn 0.3s;
}

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

/* ===== SEARCH MODULE ===== */
.eep-search-container {
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.eep-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.eep-search-icon {
    position: absolute;
    left: 12px;
    color: #666;
    pointer-events: none;
}

.eep-search-input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.eep-search-input:focus {
    outline: none;
    border-color: #1095F3;
    box-shadow: 0 0 0 3px rgba(16, 149, 243, 0.1);
}

.eep-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #999;
    border-radius: 4px;
    transition: all 0.2s;
}

.eep-search-clear:hover {
    background: #f0f0f0;
    color: #666;
}

.eep-search-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.eep-results-count {
    font-weight: 500;
}

.eep-no-results {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}

.eep-search-highlight {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

/* ===== LAZY LOADING MODULE ===== */
.eep-lazy-container {
    min-height: 50px;
}

.eep-loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    margin: 10px 0;
}

.eep-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top-color: #1095F3;
    border-radius: 50%;
    animation: eep-spin 1s linear infinite;
    margin-right: 10px;
}

.eep-loading-text {
    color: #666;
    font-size: 14px;
}

.eep-load-more-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: #1095F3;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin: 15px 0;
}

.eep-load-more-btn:hover {
    background: #0d7ec4;
}

.eep-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ===== CART MODULE ===== */
.eep-cart-price {
    font-weight: 600;
    color: #1095F3;
}

.eep-cart-updated {
    animation: eep-cart-pulse 0.6s;
}

@keyframes eep-cart-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.single_add_to_cart_button.loading {
    position: relative;
    color: transparent !important;
}

.single_add_to_cart_button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: eep-spin 0.8s linear infinite;
}

.single_add_to_cart_button.added {
    background: #28a745 !important;
    border-color: #28a745 !important;
}

.single_add_to_cart_button.error {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

.single_add_to_cart_button.eep-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== PRICE UPDATES ===== */
.eep-price-updating {
    position: relative;
    color: transparent;
}

.eep-price-updating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border: 2px solid #ccc;
    border-top-color: #1095F3;
    border-radius: 50%;
    animation: eep-spin 0.6s linear infinite;
}

.eep-price-updated {
    animation: eep-price-flash 0.4s;
}

@keyframes eep-price-flash {
    0%, 100% { background: transparent; }
    50% { background: #e3f2fd; }
}

.eep-price-breakdown {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
}

.eep-price-base {
    padding: 5px 0;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 8px;
}

.eep-price-extras {
    padding: 8px 0;
}

.eep-price-extra-item {
    padding: 3px 0;
    font-size: 14px;
    color: #666;
}

.eep-price-total {
    padding: 10px 0;
    border-top: 2px solid #dee2e6;
    margin-top: 10px;
    font-size: 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .eep-toast-container {
        padding: 10px;
    }
    
    .eep-toast {
        min-width: 280px;
        max-width: calc(100vw - 20px);
    }
    
    .eep-progress-container {
        padding: 12px;
    }
    
    .eep-search-container {
        padding: 12px;
    }
    
    .eep-search-input {
        padding: 12px 40px 12px 40px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .eep-load-more-btn {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .eep-price-breakdown {
        padding: 12px;
    }
}

/* ===== COLLAPSIBLE IMPROVEMENTS ===== */
.eep-collapsible {
    transition: all 0.3s ease;
}

.eep-collapsible.eep-collapsed .eep-collapsible-content {
    display: none;
}

.eep-collapsible.eep-expanded .eep-collapsible-content {
    display: block;
}

.eep-collapsed-summary {
    display: none;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 10px;
}

.eep-collapsed .eep-collapsed-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eep-edit-selections {
    background: #1095F3;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.eep-edit-selections:hover {
    background: #0d7ec4;
}