/* ================================================
   KEFA STUDIO - ADVANCED EFFECTS
   Modern Visual Enhancements & Micro-interactions
   ================================================ */

/* ===== GLOBAL ENHANCEMENTS ===== */

/* Smooth Cursor Interactions */
* {
    cursor: inherit;
}

a,
button,
.clickable {
    cursor: pointer;
}

/* Selection Color */
::selection {
    background: var(--primary);
    color: var(--white);
}

::-moz-selection {
    background: var(--primary);
    color: var(--white);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: var(--radius-full);
    border: 2px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== HERO SECTION ENHANCEMENTS ===== */

/* Animated Background Gradient */
.hero-section {
    background: linear-gradient(-45deg, #b399d4, #9c84cc, #7d69a8, #9c84cc);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Floating Elements in Hero */
.hero-section::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: 10%;
    right: 10%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

/* Hero Text Animation */
.hero-section h1 {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.hero-section p {
    animation: fadeInUp 1s ease 0.2s forwards;
    opacity: 0;
}

.hero-section .btn-primary {
    animation: fadeInUp 1.2s ease 0.4s forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CATEGORY FILTER ENHANCEMENTS ===== */

.category-filters-section {
    position: relative;
}

.category-filters-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            var(--primary-light),
            transparent);
}

.filter-btn {
    position: relative;
    backdrop-filter: blur(10px);
}

.filter-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: var(--primary-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.filter-btn.active::after {
    opacity: 1;
}

/* Filter Button Ripple Effect */
.filter-btn {
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.filter-btn:active::before {
    width: 300px;
    height: 300px;
}

/* ===== SECTION ENHANCEMENTS ===== */

/* Section Entry Animation */
.products-section {
    animation: sectionFadeIn 0.8s ease forwards;
}

@keyframes sectionFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Title Enhanced */
.section-title {
    position: relative;
}

.section-title h2 {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-700) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Decorative Elements */
.section-title::before,
.section-title::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    opacity: 0.1;
    border-radius: 50%;
}

.section-title::before {
    top: -20px;
    left: -20px;
    animation: pulse 3s ease infinite;
}

.section-title::after {
    bottom: -20px;
    right: -20px;
    animation: pulse 3s ease 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.2;
    }
}

/* ===== PRODUCT CARD ADVANCED EFFECTS ===== */

/* Glass Morphism Effect */
.product-card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Magnetic Hover Effect */
.product-card {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.product-card:hover {
    z-index: 10;
}

/* Product Info Gradient Overlay */
.product-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.product-card:hover .product-info::before {
    transform: scaleX(1);
}

/* Product Image Overlay Effects */
.product-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-card:hover .product-image::after {
    opacity: 1;
}

/* Badge Glow Effect */
.product-badge {
    box-shadow: 0 0 20px rgba(156, 132, 204, 0.5);
    animation: badgeGlow 2s ease-in-out infinite;
}

@keyframes badgeGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(156, 132, 204, 0.3);
    }

    50% {
        box-shadow: 0 0 25px rgba(156, 132, 204, 0.6);
    }
}

/* ===== BUTTON ENHANCEMENTS ===== */

/* Primary Button Advanced */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Button Click Feedback */
.btn-primary:active {
    transform: translateY(-2px) scale(0.98);
}

/* Secondary Button Enhancements */
.btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn-secondary:hover::after {
    width: 400px;
    height: 400px;
}

/* Add to Cart Button Success State */
.btn-add-cart.added {
    background: var(--success) !important;
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.btn-add-cart.added::after {
    content: '✓';
    position: absolute;
    right: 10px;
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    from {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(360deg);
    }
}

/* ===== CART & USER LINKS ===== */

.cart-link {
    position: relative;
    overflow: hidden;
}

.cart-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0);
    border-radius: inherit;
    transition: transform 0.3s ease;
}

.cart-link:hover::before {
    transform: scale(1);
}

.cart-count {
    animation: bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Cart Count Update Animation */
.cart-count.updated {
    animation: pop 0.5s ease;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* ===== FOOTER ENHANCEMENTS ===== */

.main-footer {
    position: relative;
    overflow: hidden;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            var(--primary),
            transparent);
}

.footer-social a {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.footer-social a:hover {
    transform: translateY(-5px) rotate(360deg);
}

/* ===== NEWSLETTER ENHANCEMENTS ===== */

.newsletter {
    position: relative;
    overflow: hidden;
}

.newsletter::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
    animation: float 8s ease-in-out infinite;
}

.newsletter-form input:focus {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.newsletter-form button {
    position: relative;
    overflow: hidden;
}

.newsletter-form button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.newsletter-form button:hover::before {
    opacity: 0.2;
}

/* ===== LOADING STATES ===== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== TOAST NOTIFICATIONS ===== */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--white);
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transform: translateX(400px);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.info {
    border-left: 4px solid var(--info);
}

/* ===== PARALLAX EFFECTS ===== */

.parallax {
    transform: translateY(calc(var(--scroll) * 0.5));
}

/* ===== INTERSECTION OBSERVER ANIMATIONS ===== */

.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ===== BACK TO TOP BUTTON ===== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 998;
}

.back-to-top.show {
    opacity: 1;
    transform: scale(1);
}

.back-to-top:hover {
    transform: scale(1.1) rotate(360deg);
    box-shadow: var(--shadow-xl);
}

/* ===== COOKIE CONSENT ===== */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: var(--space-lg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1001;
}

.cookie-consent.show {
    transform: translateY(0);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Contain layout calculations */
.product-card {
    contain: layout style paint;
}

.section-title {
    contain: layout;
}