/* ================================
   STICKY HEADER
   ================================ */
.site-header {
    transition: all 0.4s ease;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}

.site-header.scrolled .top-bar {
    display: none;
}

.site-header.scrolled .header-inner {
    padding: 12px 0;
}

/* ================================
   SCROLL TO TOP - Enhanced
   ================================ */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(227, 6, 19, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) rotate(-90deg);
    transition: all 0.4s ease;
    z-index: 999;
    overflow: hidden;
}

.scroll-top::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-hover) 100%);
    border-radius: var(--radius-full);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) rotate(0);
}

.scroll-top:hover::before {
    opacity: 1;
}

.scroll-top:hover {
    transform: translateY(-5px) rotate(0);
    box-shadow: 0 15px 35px rgba(227, 6, 19, 0.4);
}

/* Progress Ring */
.scroll-top .progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.scroll-top .progress-ring circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 3;
}

/* ================================
   HOVER EFFECTS - Advanced Cards
   ================================ */
.shop-product-card,
.category-card,
.product-card {
    position: relative;
    overflow: hidden;
}

.shop-product-card::before,
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.6s;
    z-index: 1;
    pointer-events: none;
}

.shop-product-card:hover::before,
.category-card:hover::before {
    left: 100%;
}

/* Card 3D tilt effect */
.tilt-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
}

/* Image Zoom on Hover */
.image-hover-zoom {
    overflow: hidden;
}

.image-hover-zoom img {
    transition: transform 0.5s ease;
}

.image-hover-zoom:hover img {
    transform: scale(1.15);
}

/* ================================
   GRADIENT BACKGROUNDS
   ================================ */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

.gradient-dark {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #152a4a 100%);
}

.gradient-light {
    background: linear-gradient(135deg, #fce4e6 0%, #f8d5d8 100%);
}

.gradient-mesh {
    background: 
        radial-gradient(at 40% 20%, rgba(227, 6, 19, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(10, 25, 48, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(227, 6, 19, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 50%, rgba(10, 25, 48, 0.05) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(227, 6, 19, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, rgba(10, 25, 48, 0.05) 0px, transparent 50%);
}

/* Animated Gradient */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-animated {
    background: linear-gradient(
        -45deg,
        var(--primary-color),
        var(--primary-hover),
        var(--secondary-color),
        #1a3a5c
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* ================================
   ICON BADGES - Enhanced
   ================================ */
.icon-badge,
.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--white);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid var(--primary-color);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(227, 6, 19, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 6px rgba(227, 6, 19, 0);
    }
}

/* Cart Icon Shake Animation */
@keyframes cartShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.cart-icon.shake {
    animation: cartShake 0.5s ease;
}

/* Badge Bounce */
@keyframes badgeBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

.badge-bounce {
    animation: badgeBounce 1s ease;
}

/* ================================
   LOADING STATES
   ================================ */

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-lighter) 0%,
        #f0f0f0 50%,
        var(--gray-lighter) 100%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    width: 70%;
    margin-bottom: 12px;
}

.skeleton-image {
    aspect-ratio: 1;
    width: 100%;
}

/* Spinner Loader */
.spinner-loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-lighter);
    border-top-color: var(--primary-color);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button Loading */
.btn.loading {
    color: transparent !important;
    position: relative;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 20px;
}

.loading-overlay.active {
    display: flex;
}

.loading-overlay .spinner-loader {
    width: 60px;
    height: 60px;
    border-width: 5px;
}

.loading-overlay p {
    color: var(--gray-dark);
    font-weight: 600;
}

/* Dots Loader */
.dots-loader {
    display: inline-flex;
    gap: 5px;
}

.dots-loader span {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    animation: dotBounce 1.4s infinite ease-in-out;
}

.dots-loader span:nth-child(1) { animation-delay: -0.32s; }
.dots-loader span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Progress Bar */
.progress-bar-wrapper {
    background: var(--gray-lighter);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: progressShine 1.5s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* ================================
   NEWSLETTER SUCCESS
   ================================ */
.newsletter-form {
    position: relative;
}

.newsletter-success {
    position: absolute;
    inset: 0;
    background: var(--white);
    border-radius: var(--radius-full);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--success);
    font-weight: 700;
    animation: slideInUp 0.4s ease;
}

.newsletter-success.active {
    display: flex;
}

.newsletter-success-icon {
    width: 40px;
    height: 40px;
    background: var(--success);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Confetti Success */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    top: -10px;
    animation: confettiFall 3s linear;
    z-index: 10000;
    pointer-events: none;
}

@keyframes confettiFall {
    to {
        top: 110vh;
        transform: rotate(720deg);
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--white);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: #1976d2;
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--white);
}

.toast.success .toast-icon { background: var(--success); }
.toast.error .toast-icon { background: var(--danger); }
.toast.warning .toast-icon { background: var(--warning); }
.toast.info .toast-icon { background: #1976d2; }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: var(--dark);
    font-size: var(--fs-sm);
    margin-bottom: 3px;
}

.toast-message {
    color: var(--gray);
    font-size: var(--fs-xs);
}

.toast-close {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: var(--fs-lg);
    flex-shrink: 0;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ================================
   CATEGORY ICONS - Enhanced
   ================================ */
.category-icon-wrapper {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.category-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-color);
    transform: scale(0);
    border-radius: var(--radius-full);
    transition: transform 0.4s;
}

.category-icon-wrapper:hover::before {
    transform: scale(1);
}

.category-icon-wrapper svg,
.category-icon-wrapper img {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
    color: var(--primary-color);
    transition: color 0.3s;
}

.category-icon-wrapper:hover svg {
    color: var(--white);
}

/* Category Icons Grid */
.categories-icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    padding: 30px 0;
}

.category-icon-card {
    text-align: center;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.category-icon-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-icon-card:hover .category-icon-wrapper {
    background: var(--primary-color);
}

.category-icon-card:hover .category-icon-wrapper svg {
    color: var(--white);
}

.category-icon-card h4 {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--dark);
    margin: 15px 0 5px;
}

.category-icon-card .count {
    font-size: var(--fs-xs);
    color: var(--gray);
}

/* ================================
   FADE IN ON SCROLL
   ================================ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }

/* ================================
   RIPPLE EFFECT
   ================================ */
.btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}