/* ===========================================
   COMPONENTES UI
   Catálogo Digital - Notas Fácil
   =========================================== */

/* ========== SKELETON LOADING ========== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.skeleton-text {
    height: 0.875rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.skeleton-text-sm {
    height: 0.625rem;
    width: 60%;
    border-radius: 0.25rem;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

/* ========== LAZY LOADING (nativo com loading="lazy") ========== */
img[loading="lazy"] {
    transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

.img-placeholder {
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== BUSCA DE PRODUTOS ========== */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.search-results-dropdown.active {
    display: block;
}

.search-highlight {
    background-color: rgba(234, 88, 12, 0.15);
    border-radius: 2px;
    padding: 0 2px;
}

/* ========== WHATSAPP FLUTUANTE ========== */
.whatsapp-float {
    position: fixed;
    bottom: 9rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 45;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-float svg {
    width: 1.5rem;
    height: 1.5rem;
}

@media (min-width: 768px) {
    .whatsapp-float {
        bottom: 7rem;
        right: 2rem;
        width: 3.5rem;
        height: 3.5rem;
    }
    .whatsapp-float svg {
        width: 1.75rem;
        height: 1.75rem;
    }
}

/* ========== COUNTDOWN TIMER ========== */
.countdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    animation: pulseGlow 2s infinite;
}

.countdown-badge i {
    width: 0.75rem;
    height: 0.75rem;
}

/* ========== FAVORITOS ========== */
.favorite-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    padding: 0;
}

/* Favorito sobreposto na imagem (destaques) */
.favorite-btn.fav-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.favorite-btn:hover {
    transform: scale(1.15);
}

.favorite-btn.active {
    background: #fef2f2;
}

.favorite-btn.active svg {
    fill: #ef4444;
    color: #ef4444;
    animation: heartBeat 0.5s ease;
}

.favorite-btn svg {
    width: 1rem;
    height: 1rem;
    color: #6b7280;
    transition: all 0.2s ease;
}

/* ========== PROVA SOCIAL ========== */
.social-proof-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(234, 88, 12, 0.1);
    color: var(--primary);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

/* ========== COMPARTILHAMENTO ========== */
.share-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    padding: 0;
}

.share-btn:hover {
    transform: scale(1.15);
    background: rgba(234, 88, 12, 0.1);
}

.share-btn svg {
    width: 0.875rem;
    height: 0.875rem;
    color: #6b7280;
}

/* ========== PWA INSTALL BANNER ========== */
.pwa-install-banner {
    position: fixed;
    bottom: 5rem;
    left: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--primary), #c2410c);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(234, 88, 12, 0.3);
    z-index: 55;
    display: none;
    align-items: center;
    gap: 0.75rem;
    animation: slideUp 0.4s ease-out;
}

@media (min-width: 768px) {
    .pwa-install-banner {
        max-width: 400px;
        left: auto;
        right: 2rem;
        bottom: 6rem;
    }
}

.pwa-install-banner.show {
    display: flex;
}

.pwa-install-banner .pwa-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-install-banner .pwa-text {
    flex: 1;
}

.pwa-install-banner .pwa-text h4 {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.pwa-install-banner .pwa-text p {
    font-size: 0.75rem;
    opacity: 0.9;
}

.pwa-install-banner .pwa-btn {
    background: white;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s;
}

.pwa-install-banner .pwa-btn:hover {
    transform: scale(1.05);
}

.pwa-install-banner .pwa-close {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    padding: 0;
}

.pwa-install-banner .pwa-close svg {
    width: 0.75rem;
    height: 0.75rem;
    color: #6b7280;
}

/* ========== TOAST TYPES ========== */
.toast-success .toast-icon {
    background-color: #16a34a;
}

.toast-error .toast-icon {
    background-color: #ef4444;
}

.toast-warning .toast-icon {
    background-color: #f59e0b;
}

.toast-info .toast-icon {
    background-color: #3b82f6;
}

/* ========== CROSS-SELLING ========== */
.suggestion-card {
    flex-shrink: 0;
    width: 8rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========== PULL TO REFRESH ========== */
.pull-indicator {
    position: fixed;
    top: -3rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2.5rem;
    height: 2.5rem;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 55;
    transition: top 0.3s ease;
}

.pull-indicator.visible {
    top: 1rem;
}

.pull-indicator svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--primary);
}

/* ========== REORDENAR PEDIDO ========== */
.reorder-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reorder-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}
