/* ===================================
   Style Enhancements & Animations
   =================================== */

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Hero Section Animations */
.hero__title {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.hero__subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s;
    animation-fill-mode: both;
}

.hero__description {
    animation: fadeInUp 0.8s ease-out 0.4s;
    animation-fill-mode: both;
}

.hero__content .btn {
    animation: fadeInUp 0.8s ease-out 0.6s;
    animation-fill-mode: both;
}

/* Feature Cards Animation */
.feature-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

/* Enhanced Product Cards */
.product-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

/* Stagger animations for product cards */
.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(n+7) { animation-delay: 0.35s; }

/* Enhanced hover effects */
.product-card:hover {
    transform: translateY(-10px) scale(1.02) !important;
    box-shadow: 0 15px 30px rgba(255, 107, 53, 0.2), 0 8px 16px rgba(196, 30, 58, 0.15) !important;
}

.product-card:hover .product-card__image {
    transform: scale(1.05);
}

.product-card__image {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Better button glow effects */
.btn--primary:hover {
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.45), 0 3px 8px rgba(196, 30, 58, 0.3) !important;
    transform: translateY(-3px) !important;
}

.btn--primary:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.35) !important;
}

.btn--secondary:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Enhanced hero section */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(255,255,255,.04) 15px, rgba(255,255,255,.04) 30px),
        repeating-linear-gradient(-45deg, transparent, transparent 15px, rgba(0,0,0,.02) 15px, rgba(0,0,0,.02) 30px);
    pointer-events: none;
    z-index: 1;
}

.hero__title,
.hero__subtitle,
.hero .btn {
    position: relative;
    z-index: 2;
}

.hero__title {
    animation: fadeInUp 0.8s ease-out;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hero__subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s;
    animation-fill-mode: both;
}

.hero .btn {
    animation: fadeInUp 0.8s ease-out 0.4s;
    animation-fill-mode: both;
}

/* Better typography */
.section-title {
    font-size: clamp(2rem, 5vw, 2.5rem) !important;
    letter-spacing: -0.5px;
    margin-bottom: var(--spacing-2xl) !important;
    position: relative;
    padding-bottom: var(--spacing-md);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-full);
}

.page-title {
    font-size: clamp(1.875rem, 4vw, 2.25rem) !important;
}

/* Enhanced category buttons */
.category-btn {
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 107, 53, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.category-btn:hover::before {
    width: 300px;
    height: 300px;
}

.category-btn.active {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35) !important;
}

/* Cart improvements */
.cart-item {
    transition: background-color 0.3s ease;
}

.cart-item:hover {
    background-color: var(--bg-secondary);
}

.cart-summary {
    animation: fadeInUp 0.6s ease-out 0.3s;
    animation-fill-mode: both;
}

/* Disable animations on mobile to prevent positioning conflicts */
@media (max-width: 640px) {
    .cart-summary {
        animation: none !important;
    }

    /* Disable container animation on cart page to fix position: fixed */
    .cart-section .container {
        animation: none !important;
        transform: none !important;
    }
}

/* Better loading states */
.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Improved footer */
.footer {
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* Better modal animations */
.modal {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal__content {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
}

.modal.active .modal__content {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal.active .modal__overlay {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modal Quantity Controls Animation */
.modal-quantity-wrapper {
    animation: fadeInUp 0.4s ease-out;
}

.modal-quantity-controls .quantity-btn {
    animation: fadeIn 0.3s ease-out;
}

.modal-quantity-controls .quantity-btn:nth-child(1) {
    animation-delay: 0.1s;
}

.modal-quantity-controls .quantity-value {
    animation: fadeIn 0.3s ease-out 0.15s;
    animation-fill-mode: both;
}

.modal-quantity-controls .quantity-btn:nth-child(3) {
    animation-delay: 0.2s;
}

/* Enhanced checkout options */
.checkout-option {
    position: relative;
    overflow: hidden;
}

.checkout-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.05), transparent);
    transition: left 0.5s ease;
}

.checkout-option:hover::before {
    left: 100%;
}

/* Better toast animations */
.toast {
    animation: fadeInUp 0.3s ease-out;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.btn:focus-visible,
.category-btn:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Enhanced contact form */
.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Better product grid appearance */
.products-grid {
    animation: fadeInUp 0.6s ease-out 0.2s;
    animation-fill-mode: both;
}

/* Improved cart badge */
.cart-badge {
    animation: pulse 2s ease-in-out infinite;
}

/* Better empty cart state */
.empty-cart {
    animation: fadeInUp 0.6s ease-out;
}

.empty-cart svg {
    animation: pulse 2s ease-in-out infinite;
}

/* Enhanced coupon section */
.coupon-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

/* Better success/error states */
.coupon-message.success {
    animation: fadeInUp 0.4s ease-out;
}

.coupon-message.error {
    animation: fadeInUp 0.4s ease-out;
}

/* Improved header on scroll */
@supports (backdrop-filter: blur(10px)) {
    .header {
        backdrop-filter: blur(10px);
        background-color: rgba(255, 251, 245, 0.95);
    }
}

/* Better quantity controls */
.quantity-btn:hover {
    transform: scale(1.1);
    background-color: var(--primary-light);
}

.quantity-btn:active {
    transform: scale(0.95);
}

/* Enhanced remove button */
.remove-btn {
    transition: all 0.3s ease;
}

.remove-btn:hover {
    transform: translateX(2px);
    color: var(--color-error);
}

/* Better product price display */
.product-price {
    animation: pulse 3s ease-in-out infinite;
}

/* Improved nav links */
.nav__link {
    position: relative;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.nav__link:hover::after {
    width: 100%;
}

/* Enhanced footer links */
.footer__links a {
    transition: all 0.3s ease;
    position: relative;
    padding-left: 0;
}

.footer__links a::before {
    content: '›';
    position: absolute;
    left: -15px;
    opacity: 0;
    transition: all 0.3s ease;
}

.footer__links a:hover {
    padding-left: 20px;
}

.footer__links a:hover::before {
    left: 0;
    opacity: 1;
}

/* Improved container fade-in */
.container {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}
