/* =============================================
   SKELETON LOADERS
============================================= */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Skeleton variants */
.skeleton-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-card {
    padding: 20px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* =============================================
   MICRO-INTERACTIONS
============================================= */

/* Smooth button ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Card lift effect */
.card-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Image zoom on hover */
.img-zoom {
    overflow: hidden;
    border-radius: 8px;
}

.img-zoom img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-zoom:hover img {
    transform: none;
}

/* Smooth underline animation */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* Button fill animation */
.btn-fill {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-fill::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
    z-index: -1;
}

.btn-fill:hover::before {
    width: 300%;
    height: 300%;
}

/* Input focus glow */
.input-glow {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-glow:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Success checkmark animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 50;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: checkmark 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* =============================================
   LOADING STATES
============================================= */

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* =============================================
   LAZY LOAD IMAGE
============================================= */
.lazy-image {
    opacity: 0;
    transition: opacity 0.6s ease;
}

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

/* Blur-up effect */
.blur-up {
    filter: blur(20px);
    transition: filter 0.6s ease;
}

.blur-up.loaded {
    filter: blur(0);
}

/* =============================================
   ENHANCED HOVER EFFECTS
============================================= */

/* Magnetic cursor effect (for product cards) */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Gradient shift on hover */
.gradient-shift {
    background-size: 200% 200%;
    transition: background-position 0.6s ease;
}

.gradient-shift:hover {
    background-position: 100% 100%;
}

/* =============================================
   ACCESSIBILITY IMPROVEMENTS
============================================= */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 10px;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 9999;
    border-radius: 4px;
    font-size: 14px;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 10px;
}

/* =============================================
   MOBILE OPTIMIZATIONS
============================================= */

/* Larger tap targets for mobile */
@media (max-width: 768px) {
    button,
    a.btn,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent text selection on tap */
    .card-lift,
    .img-zoom {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        user-select: none;
    }

    /* Remove cubic-bezier hover animation on mobile */
    .img-zoom img {
        transition: none !important;
        transform: none !important;
    }
}

/* =============================================
   UTILITY CLASSES
============================================= */

/* Smooth transitions */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.2s ease;
}

.transition-slow {
    transition: all 0.6s ease;
}

/* =============================================
   PRODUCT GRID SKELETON
============================================= */
.product-grid-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-skeleton-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-skeleton-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.product-skeleton-content {
    padding: 16px;
}

.product-skeleton-title {
    height: 20px;
    width: 70%;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.product-skeleton-code {
    height: 16px;
    width: 40%;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Hide skeleton when products load */
.products-loaded .product-grid-skeleton {
    display: none;
}

/* =============================================
   PHASE 2: VISUAL POLISH
============================================= */

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

.parallax-content {
    position: relative;
    z-index: 2;
}

/* Smooth reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for grids */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-item.active {
    opacity: 1;
    transform: translateY(0);
}

/* Delay classes for staggered effect */
.stagger-delay-1 { transition-delay: 0.1s; }
.stagger-delay-2 { transition-delay: 0.2s; }
.stagger-delay-3 { transition-delay: 0.3s; }
.stagger-delay-4 { transition-delay: 0.4s; }
.stagger-delay-5 { transition-delay: 0.5s; }
.stagger-delay-6 { transition-delay: 0.6s; }

/* Enhanced button - Modern clean style */
.btn-gradient {
    background: #fff !important;
    color: #000 !important;
    border: 1.5px solid #000 !important;
    transition: all 0.3s ease !important;
}

.btn-gradient:hover {
    background: #000 !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* Floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page transition removed (client preference) */

/* Enhanced hover glow effect */
.hover-glow {
    position: relative;
    transition: all 0.3s ease;
}

.hover-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #000, #666, #000);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(10px);
}

.hover-glow:hover::before {
    opacity: 0.7;
}

/* Text gradient animation */
.text-gradient {
    background: linear-gradient(
        135deg,
        #000 0%,
        #666 50%,
        #000 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Smooth underline expand */
.underline-expand {
    position: relative;
    display: inline-block;
}

.underline-expand::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.4s ease, left 0.4s ease;
}

.underline-expand:hover::after {
    width: 100%;
    left: 0;
}

/* =============================================
   TOAST NOTIFICATIONS
============================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(calc(100% + 40px));
    opacity: 0;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-icon svg {
    width: 16px;
    height: 16px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 4px 0;
    color: #1a1a1a;
}

.toast-message {
    font-size: 13px;
    margin: 0;
    color: #666;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast variants */
.toast.toast-success .toast-icon {
    background: #d4edda;
    color: #155724;
}

.toast.toast-error .toast-icon {
    background: #f8d7da;
    color: #721c24;
}

.toast.toast-warning .toast-icon {
    background: #fff3cd;
    color: #856404;
}

.toast.toast-info .toast-icon {
    background: #d1ecf1;
    color: #0c5460;
}

/* Toast progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    transition: width linear;
}

@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: unset;
        width: 100%;
    }
}

/* =============================================
   CAROUSEL DOT INDICATORS
============================================= */
.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0d0d0;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-dot:hover {
    background: #999;
    transform: scale(1.2);
}

.carousel-dot.active {
    background: #1a1a1a;
    width: 24px;
    border-radius: 4px;
}

/* Enhanced mobile tap targets */
@media (max-width: 768px) {
    .carousel-dot {
        width: 10px;
        height: 10px;
        padding: 6px; /* Increase tap target */
    }
}

/* =============================================
   MOBILE MENU ENHANCEMENTS (REMOVED due to conflict with styles.css)
   Restored standard dropdown menu.
============================================= */
/* .mobile-menu styles removed */

/* Enhanced touch feedback */
@media (hover: none) and (pointer: coarse) {
    button:active,
    a.btn:active,
    .btn:active {
        transform: scale(0.96);
        transition: transform 0.1s ease;
    }
    
    .card-lift:active {
        transform: translateY(-4px) scale(0.98);
    }
}
