/* UI Enhancements for Smooth Baby-Themed Experience */

/* Optimized baby-themed decorative elements with reduced animation load */
.products::before {
    content: '';
    position: fixed;
    top: 25%;
    right: 5%;
    width: 60px;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23FFB5B5' opacity='0.03' d='M50 10c-15 0-25 10-25 25 0 20 25 55 25 55s25-35 25-55c0-15-10-25-25-25zm0 35c-5.5 0-10-4.5-10-10s4.5-10 10-10 10 4.5 10 10-4.5 10-10 10z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    pointer-events: none;
    z-index: 1;
    animation: gentleFloat 8s ease-in-out infinite;
    will-change: transform;
}

.products::after {
    content: '';
    position: fixed;
    bottom: 15%;
    left: 3%;
    width: 45px;
    height: 45px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle fill='%23FFE0B5' opacity='0.025' cx='50' cy='50' r='40'/%3E%3Cpath fill='%23FFB5B5' opacity='0.03' d='M30 40c0-10 10-15 20-15s20 5 20 15c0 5-5 10-10 10H40c-5 0-10-5-10-10z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    pointer-events: none;
    z-index: 1;
    animation: gentleFloat 10s ease-in-out infinite reverse;
    will-change: transform;
}

@keyframes gentleFloat {

    0%,
    100% {
        transform: translateY(0px) translateZ(0);
    }

    50% {
        transform: translateY(-10px) translateZ(0);
    }
}

/* Subtle baby footprint pattern in corners */
.container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 30px;
    height: 30px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cellipse fill='%23E8F5E8' opacity='0.02' cx='25' cy='15' rx='8' ry='12'/%3E%3Ccircle fill='%23E8F5E8' opacity='0.02' cx='15' cy='30' r='3'/%3E%3Ccircle fill='%23E8F5E8' opacity='0.02' cx='25' cy='35' r='3'/%3E%3Ccircle fill='%23E8F5E8' opacity='0.02' cx='35' cy='30' r='3'/%3E%3C/svg%3E") no-repeat;
    pointer-events: none;
    z-index: 1;
}

/* Enhanced product cards with optimized animations for smooth scrolling */
.product-card {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.3s ease,
        opacity 0.3s ease;
    will-change: transform;
    transform: translateZ(0);
    /* Force hardware acceleration */
}

.product-card:hover {
    transform: translateY(-6px) translateZ(0);
    box-shadow:
        0 15px 30px rgba(94, 58, 28, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Optimized loading states with reduced animation intensity */
.product-card.loading {
    background: linear-gradient(90deg,
            rgba(250, 244, 235, 0.8) 0%,
            rgba(250, 244, 235, 0.95) 50%,
            rgba(250, 244, 235, 0.8) 100%);
    background-size: 200% 100%;
    animation: gentleShimmer 2s infinite;
    will-change: background-position;
}

@keyframes gentleShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Lazy loading image container */
.lazy-image-container {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #FAF4EB 0%, #F4EAD3 100%);
}

.lazy-image-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath fill='%23E0E0E0' d='M25 5A20 20 0 1 0 45 25A20 20 0 0 0 25 5zm0 36A16 16 0 1 1 41 25A16 16 0 0 1 25 41z'/%3E%3Cpath fill='%23E0E0E0' d='M25 15a10 10 0 1 0 10 10A10 10 0 0 0 25 15z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

.lazy-image-container.loaded::before {
    display: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

/* Optimized product image with hardware acceleration */
.product-image {
    opacity: 0;
    transition: opacity 0.4s ease;
    will-change: opacity;
    transform: translateZ(0);
    /* Force hardware acceleration */
}

.product-image.loaded {
    opacity: 1;
}

/* Remove icon clutter from descriptions */
.product-description i,
.product-category i,
.breadcrumb i {
    display: none;
}

/* Cleaner text without icons */
.product-description,
.product-category,
.breadcrumb {
    position: relative;
    padding-left: 0;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced micro-interactions */
.quick-cart-btn {
    position: relative;
    overflow: hidden;
}

.quick-cart-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(27, 123, 137, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.quick-cart-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Optimized wishlist button with hardware acceleration */
.wishlist-btn {
    display: none !important;
    /* HIDDEN - Removed wishlist icon from product cards */
    background: transparent !important;
    border: none !important;
    color: #FF6B9D;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: -4px;
    right: 3px;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 0;
    /* Hide any text content */
    cursor: pointer;
    z-index: 5;
    backdrop-filter: none !important;
    box-shadow: none !important;
    will-change: transform;
    transform: translateZ(0);
    /* Force hardware acceleration */
}

.wishlist-btn::before {
    content: '🤍';
    font-size: 18px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Hide any FontAwesome icons that might be in the button */
.wishlist-btn i {
    display: none !important;
}

/* Wishlisted state */
.wishlist-btn.active::before {
    content: '❤️';
    transform: scale(1.1);
}

.wishlist-btn:hover {
    background: transparent !important;
    transform: scale(1.1) translateZ(0);
    box-shadow: none !important;
}

.wishlist-btn:hover::before {
    content: '💖';
    animation: quickHeartBounce 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(255, 107, 157, 0.2));
}

.wishlist-btn.active:hover::before {
    content: '💔';
    animation: heartBounce 0.6s ease;
}

/* Loading state for wishlist button */
.wishlist-btn.loading::before {
    content: '⏳';
    animation: wishlistSpin 1s ease-in-out infinite;
}

.wishlist-btn.loading {
    pointer-events: none;
    opacity: 0.7;
    transform: scale(0.95);
}

/* Enhanced animations */
@keyframes wishlistSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes heartBounce {

    0%,
    100% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1.3);
    }
}

@keyframes quickHeartBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Enhanced wishlist button states */
.wishlist-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wishlist-btn:focus {
    outline: 2px solid rgba(255, 107, 157, 0.3);
    outline-offset: 2px;
}

/* Success state animation */
.wishlist-btn.success {
    animation: wishlistSuccess 0.6s ease-out;
}

@keyframes wishlistSuccess {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.2);
    }

    50% {
        transform: scale(1.1);
    }

    75% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.mobile-cart-btn,
.mobile-cart-btn-outside {
    background: linear-gradient(135deg, #1b7b89 0%, #2BAAA0 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(27, 123, 137, 0.3);
    will-change: transform;
    transform: translateZ(0);
    /* Force hardware acceleration */
}

.mobile-cart-btn:hover,
.mobile-cart-btn-outside:hover {
    background: linear-gradient(135deg, #2BAAA0 0%, #1b7b89 100%);
    transform: scale(1.1) translateZ(0);
    box-shadow: 0 6px 20px rgba(27, 123, 137, 0.4);
}

.quick-add-btn {
    background: linear-gradient(135deg, #1b7b89 0%, #2BAAA0 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(27, 123, 137, 0.3);
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    /* Force hardware acceleration */
}

.quick-add-btn:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 8px 20px rgba(27, 123, 137, 0.35);
    background: linear-gradient(135deg, #2BAAA0 0%, #1b7b89 100%);
}

.quick-add-btn:active {
    transform: translateY(0) translateZ(0);
    box-shadow: 0 4px 15px rgba(27, 123, 137, 0.3);
}

/* Gentle baby-themed cursor effects */
.product-card:hover {
    cursor: pointer;
}

/* Add subtle baby elements that appear on hover */
.product-card::after {
    content: '✨';
    position: absolute;
    top: 15px;
    right: 60px;
    font-size: 12px;
    opacity: 0;
    transform: translateY(10px) rotate(0deg);
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.product-card:hover::after {
    opacity: 0.6;
    transform: translateY(0) rotate(15deg);
}

/* Add gentle bounce to wishlist heart */

/* Smoother filter transitions */
.filter-backdrop {
    backdrop-filter: blur(8px);
    transition: backdrop-filter 0.3s ease;
}

/* Enhanced loading skeleton for better UX */
.skeleton {
    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;
    }
}

/* Optimized intersection observer fade-in animation */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(20px) translateZ(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
    will-change: opacity, transform;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

/* Staggered animation for product grid */
.product-card-wrapper:nth-child(1) {
    animation-delay: 0.1s;
}

.product-card-wrapper:nth-child(2) {
    animation-delay: 0.2s;
}

.product-card-wrapper:nth-child(3) {
    animation-delay: 0.3s;
}

.product-card-wrapper:nth-child(4) {
    animation-delay: 0.4s;
}

.product-card-wrapper:nth-child(5) {
    animation-delay: 0.5s;
}

.product-card-wrapper:nth-child(6) {
    animation-delay: 0.6s;
}

/* Responsive baby props */
@media (max-width: 768px) {

    .products::before,
    .products::after {
        width: 30px;
        height: 30px;
    }

    .container::before {
        width: 20px;
        height: 20px;
    }

    /* Adjusted wishlist icon for mobile */
    .wishlist-btn {
        top: -3px;
        right: 2px;
        width: 32px !important;
        height: 32px !important;
    }

    .wishlist-btn::before {
        font-size: 16px;
    }
}

/* Enhanced product grid with better spacing */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0 0.25rem;
    }
}

/* Optimized product card proportions with hardware acceleration */
.product-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 10px 30px rgba(94, 58, 28, 0.08),
        0 1px 8px rgba(94, 58, 28, 0.06);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.3s ease;
    will-change: transform;
    transform: translateZ(0);
    /* Force hardware acceleration */
}

.product-card:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow:
        0 20px 40px rgba(94, 58, 28, 0.12),
        0 8px 15px rgba(94, 58, 28, 0.08);
}

/* Better image aspect ratio with optimized container */
.product-image-container {
    aspect-ratio: 4/5;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #FAF4EB 0%, #F4EAD3 100%);
}

/* Optimized image scaling with hardware acceleration */
.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    will-change: transform;
    transform: translateZ(0);
    /* Force hardware acceleration */
}

.product-card:hover .product-image {
    transform: scale(1.05) translateZ(0);
}

@media (prefers-reduced-motion: reduce) {

    .products::before,
    .products::after,
    .gentleFloat,
    .pulse,
    .gentleShimmer,
    .quickHeartBounce {
        animation: none;
    }

    .product-card,
    .wishlist-btn,
    .mobile-cart-btn,
    .quick-add-btn,
    .product-image {
        transition: none;
    }

    /* Disable all transforms for reduced motion */
    * {
        transform: none !important;
    }
}

/* Enhanced focus states for accessibility */
.product-card:focus-within {
    outline: 2px solid var(--brand-accent-teal);
    outline-offset: 4px;
}

/* Optimized page transitions */
.page-transition {
    opacity: 0;
    transform: translateY(15px) translateZ(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
    will-change: opacity, transform;
}

.page-transition.loaded {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

/* Performance optimizations for smooth scrolling */
* {
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize scroll performance */
.product-grid {
    contain: layout style paint;
}

.product-card {
    contain: layout style paint;
    isolation: isolate;
}

/* Reduce paint on scroll */
.products::before,
.products::after {
    contain: strict;
}