/* ==============================================
   SUBTLE ANIMATIONS FOR MINDMELTPASTELS
   ============================================== */

/* Smooth fade-in for body content */
body {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Header logo gentle breathing effect */
.logo {
    animation: gentleBreath 6s ease-in-out infinite;
}

@keyframes gentleBreath {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

/* Button hover lift with shadow */
.icon-btn,
.checkout-btn,
.add-to-cart-btn,
.buy-now-btn,
.share-btn,
.zoom-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkout-btn:hover,
.add-to-cart-btn:hover,
.buy-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Menu link slide-in animation */
.menu-link {
    animation: slideInLeft 0.4s ease-out backwards;
}

.menu-link:nth-child(1) {
    animation-delay: 0.05s;
}

.menu-link:nth-child(2) {
    animation-delay: 0.1s;
}

.menu-link:nth-child(3) {
    animation-delay: 0.15s;
}

.menu-link:nth-child(4) {
    animation-delay: 0.2s;
}

.menu-link:nth-child(5) {
    animation-delay: 0.25s;
}

.menu-link:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Footer links subtle bounce on hover */
.footer-link {
    transition: all 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.footer-link:hover {
    transform: translateY(-2px);
}

/* Cart badge pulse when items added */
.cart-badge.pulse {
    animation: pulse 0.6s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Product card stagger animation (already exists, enhanced) */
.product-card {
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Search bar smooth slide down */
.search-overlay {
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Quantity controls subtle scale */
.quantity-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Zoom controls hover effect */
.zoom-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Related products gentle hover lift */
.related-product-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
}

.related-product-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Social icons rotate on hover */
.menu-icon svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.menu-link:hover .menu-icon svg {
    transform: rotate(5deg) scale(1.1);
}

/* Cart items slide in */
.cart-item {
    animation: slideInRight 0.3s ease-out backwards;
}

.cart-item:nth-child(1) {
    animation-delay: 0.05s;
}

.cart-item:nth-child(2) {
    animation-delay: 0.1s;
}

.cart-item:nth-child(3) {
    animation-delay: 0.15s;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Input focus glow */
.search-input:focus,
.quantity-input:focus,
.size-select:focus {
    box-shadow: 0 0 0 3px rgba(139, 139, 139, 0.1);
    transition: box-shadow 0.2s ease;
}

/* Menu content entrance */
.menu-overlay.active .menu-content {
    animation: menuSlideIn 0.45s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes menuSlideIn {
    from {
        transform: translateX(-100%);
        opacity: 0.5;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Price gentle shimmer on product page */
.product-price {
    position: relative;
    overflow: hidden;
}

.product-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);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 100%;
    }
}

/* Smooth scroll behavior for all elements */
html {
    scroll-behavior: smooth;
}

/* Page transition fade */
@media (prefers-reduced-motion: no-preference) {
    * {
        scroll-behavior: smooth;
    }
}

/* Header fade on scroll */
.top-bar {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Footer link icon appear on hover */
.footer-link::before {
    content: '→ ';
    opacity: 0;
    transform: translateX(-10px);
    display: inline-block;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.footer-link:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Cart opening animation */
.cart-overlay.active {
    animation: fadeIn 0.3s ease;
}

/* Product image lazy load fade */
.product-image,
.product-main-image {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced button press feedback */
button:active:not(.icon-btn) {
    transform: scale(0.98);
}

/* Loading state for images */
img:not([src]) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Smooth color transitions */
a,
button {
    transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

/* Enhanced cart badge bounce on add */
@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.cart-badge.bounce-in {
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Product card progressive reveal */
.product-card:nth-child(1) {
    animation-delay: 0.05s;
}

.product-card:nth-child(2) {
    animation-delay: 0.1s;
}

.product-card:nth-child(3) {
    animation-delay: 0.15s;
}

.product-card:nth-child(4) {
    animation-delay: 0.2s;
}

.product-card:nth-child(5) {
    animation-delay: 0.25s;
}

.product-card:nth-child(6) {
    animation-delay: 0.3s;
}

.product-card:nth-child(7) {
    animation-delay: 0.35s;
}

.product-card:nth-child(8) {
    animation-delay: 0.4s;
}

/* Back to top button bounce */
.back-to-top {
    animation: fadeInUp 0.4s ease when visible;
}

/* Selection highlight */
::selection {
    background-color: rgba(139, 139, 139, 0.2);
    color: #2a2a2a;
}

/* Focus visible improvements */
*:focus-visible {
    outline: 2px solid rgba(139, 139, 139, 0.5);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Smooth transitions for all interactive elements */
.icon-btn,
.menu-link,
.product-card,
.footer-link,
.cart-item,
button {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}