/* ===== GLOBAL SMOOTH EXPERIENCE ===== */

/* Scroll suave global */
html {
    scroll-behavior: smooth;
}

/* Transição global em tudo que é clicável */
*, *::before, *::after {
    -webkit-tap-highlight-color: transparent;
}

a, button, input, select, .product-card, .moment-card, .brand-item, .hero-dot, .carousel-arrow {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== PAGE LOAD ANIMATION ===== */
body {
    opacity: 0;
    animation: pageLoad 0.6s ease forwards;
}

@keyframes pageLoad {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Staggered delay for cards */
.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.1s; }
.stagger-3 { transition-delay: 0.15s; }
.stagger-4 { transition-delay: 0.2s; }
.stagger-5 { transition-delay: 0.25s; }
.stagger-6 { transition-delay: 0.3s; }
.stagger-7 { transition-delay: 0.35s; }

/* ===== HERO SLIDER TRANSITIONS ===== */
.hero-slider {
    position: relative;
    overflow: hidden;
}

/* Dots animation */
.hero-dot {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.hero-dot:hover {
    transform: scale(1.3);
}

.hero-dot.active {
    transform: scale(1.2);
}

/* Progress bar on active dot */
.hero-dot.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
    animation: dotProgress 15s linear;
    border-radius: 1px;
}

@keyframes dotProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Arrow hover */
.carousel-arrow, .hero-arrow {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.carousel-arrow:hover, .hero-arrow:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.carousel-arrow:active, .hero-arrow:active {
    transform: scale(0.95);
}

/* ===== PRODUCT CARD ANIMATIONS ===== */
.product-card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform;
}

.product-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
}

.product-card:active {
    transform: translateY(-2px) scale(0.99) !important;
}

/* Product image zoom on hover */
.product-img-wrap {
    overflow: hidden;
    border-radius: 8px;
}

.product-img-wrap img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform;
}

.product-card:hover .product-img-wrap img {
    transform: scale(1.08) !important;
}

/* Favorite button pulse */
.fav-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fav-btn:hover {
    transform: scale(1.2) !important;
}

.fav-btn:active {
    transform: scale(0.85) !important;
}

.fav-btn.liked {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(0.9); }
    45% { transform: scale(1.2); }
    60% { transform: scale(1); }
}

/* ===== BUTTON ANIMATIONS ===== */
.btn-add-cart, .btn-add-cart-detail, .btn-checkout, .btn-continue {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-add-cart:active {
    transform: translateY(0) scale(0.97);
}

.btn-add-cart-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    filter: brightness(1.05);
}

.btn-add-cart-detail:active {
    transform: translateY(0) scale(0.98);
}

/* Ripple effect on buttons */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== MOMENT CARDS ===== */
.moment-card {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform;
}

.moment-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15) !important;
}

.moment-card img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.moment-card:hover img {
    transform: scale(1.06) !important;
}

/* ===== BRAND ITEMS ===== */
.brand-item {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease !important;
}

.brand-item:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    filter: brightness(1.05);
}

/* ===== CAROUSEL SMOOTH SCROLL ===== */
.product-carousel-track {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    transition: scroll-left 0.5s ease;
}

/* ===== HEADER ANIMATIONS ===== */
.main-header {
    transition: box-shadow 0.4s ease, background 0.4s ease !important;
}

.main-header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Nav links hover */
.main-nav a {
    position: relative;
    transition: color 0.3s ease !important;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #4CAF50;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1px;
}

.main-nav a:hover::after {
    width: 100%;
    left: 0;
}

/* Top bar links */
.top-bar a {
    transition: opacity 0.3s ease !important;
}

.top-bar a:hover {
    opacity: 0.8;
}

/* Search input focus */
.search-input {
    transition: box-shadow 0.3s ease, border-color 0.3s ease !important;
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* Cart icon hover */
.cart-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.cart-icon:hover {
    transform: scale(1.1) !important;
}

/* ===== SECTION TITLES ===== */
.section-title, h2 {
    position: relative;
}

/* ===== FOOTER ANIMATIONS ===== */
.main-footer a {
    transition: color 0.3s ease, padding-left 0.3s ease !important;
}

.main-footer a:hover {
    padding-left: 4px;
    color: #4CAF50 !important;
}

.social-links a {
    transition: transform 0.3s ease, background 0.3s ease !important;
}

.social-links a:hover {
    transform: translateY(-3px) scale(1.1) !important;
}

.pay-badge {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.pay-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ===== NEWSLETTER ===== */
.newsletter-form button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.newsletter-form input {
    transition: box-shadow 0.3s ease, border-color 0.3s ease !important;
}

.newsletter-form input:focus {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

/* ===== PRICE ANIMATIONS ===== */
.discount-badge {
    animation: subtlePulse 2s ease-in-out infinite;
}

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

/* ===== QUANTITY BUTTONS ===== */
.qty-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.qty-btn:hover {
    background: #f0ebe7 !important;
    transform: scale(1.1);
}

.qty-btn:active {
    transform: scale(0.9);
}

/* ===== PRODUCT PAGE SPECIFIC ===== */
.product-detail-img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-detail-img:hover {
    transform: scale(1.03);
}

/* ===== SMOOTH PAGE TRANSITIONS ===== */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ===== LOADING SKELETON ===== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* ===== TOOLTIP ===== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
}

[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ===== SMOOTH IMAGE LOADING ===== */
img {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img.loaded, img[src] {
    opacity: 1;
}

/* Override for already visible images */
.hero-slide img, .hero-slider img, .logo img, img[alt], .slide img, .slide-img,
.logo-white, .logo-color, .product-card img, .moment-card img, .brand-item img {
    opacity: 1;
}

/* ===== BOTTOM BANNER SLIDER ===== */

/* ===== RESPONSIVE TOUCH FEEDBACK ===== */
@media (hover: none) {
    .product-card:active {
        transform: scale(0.98) !important;
        transition-duration: 0.1s !important;
    }
    
    .btn-add-cart:active, .btn-add-cart-detail:active {
        transform: scale(0.96) !important;
        transition-duration: 0.1s !important;
    }
    
    .moment-card:active {
        transform: scale(0.97) !important;
    }
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}
