/* Modern Layout Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Global Fade Animations */
.fade-in:not(.hero-section *) {
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards;
}

.fade-in-up:not(.hero-section *) {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left:not(.hero-section *) {
    opacity: 0;
    transform: translateX(-30px);
    animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right:not(.hero-section *) {
    opacity: 0;
    transform: translateX(30px);
    animation: fadeInRight 0.8s ease-out forwards;
}

.fade-in-scale:not(.hero-section *) {
    opacity: 0;
    transform: scale(0.9);
    animation: fadeInScale 0.8s ease-out forwards;
}

/* Hero section overrides */
.hero-section,
.hero-section * {
    opacity: 1 !important;
    visibility: visible !important;
}

.hero-section .fade-in,
.hero-section .fade-in-up,
.hero-section .fade-in-left,
.hero-section .fade-in-right,
.hero-section .fade-in-scale {
    opacity: 1 !important;
    transform: none !important;
}

/* Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

/* Paused animations for scroll trigger */
.fade-in,
.fade-in-up,
.fade-in-left,
.fade-in-right,
.fade-in-scale {
    animation-fill-mode: both;
}

.fade-in.animate,
.fade-in-up.animate,
.fade-in-left.animate,
.fade-in-right.animate,
.fade-in-scale.animate {
    animation-play-state: running;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hero Section Animations */
.hero-section {
    opacity: 1 !important;
    visibility: visible !important;
}

.hero-visible {
    animation: fadeIn 0.8s ease-out forwards;
}

.hero-left {
    animation: fadeInLeft 1s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-image {
    animation: fadeInRight 1s ease-out 0.4s forwards;
    opacity: 0;
}

.hero-badge {
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
    opacity: 0;
}

.hero-title {
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
    opacity: 0;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 1s forwards;
    opacity: 0;
}

.hero-button {
    animation: fadeInUp 0.8s ease-out 1.2s forwards;
    opacity: 0;
}

/* Ensure hero elements are always visible after animation */
.hero-section * {
    animation-fill-mode: forwards;
}

.hero-content {
    opacity: 1;
}

/* Product Card Hover Effects */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.product-card:hover::before {
    left: 100%;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15) !important;
}

.product-card img {
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

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

/* Touch device optimizations */
.touch-device .product-card:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important;
}

/* Ensure all images are crisp and clear */
img {
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Product images specifically */
.product-card img,
.category-circle img,
.hero-image img {
    filter: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Override any blur effects */
* {
    filter: none !important;
}

*:not(:hover) {
    filter: none !important;
}

/* Loading state for products - Remove blur effect */
.product-card {
    opacity: 1;
}

.product-card img {
    filter: none !important;
    opacity: 1 !important;
    transition: transform 0.3s ease;
}

.product-card.loaded img {
    filter: none;
}

/* Category Circle Hover Effects */
.category-item {
    transition: all 0.3s ease;
}

.category-item:hover {
    transform: translateY(-5px);
}

.category-item:hover .category-circle {
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* Button Hover Effects */
button {
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Featured Products 4-Column Grid */
.featured-products-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
}

.featured-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Responsive grid for featured products */
@media (max-width: 1200px) {
    .featured-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .featured-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 576px) {
    .featured-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-products-container {
        padding: 0 20px;
    }
}

/* Product card responsive adjustments */
@media (max-width: 768px) {
    .product-card img {
        height: 220px !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px !important;
    }
    
    .hero-content h1 {
        font-size: 2.5rem !important;
    }
    
    .section-padding {
        padding: 40px 20px !important;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
        gap: 20px !important;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    .category-circle {
        width: 120px !important;
        height: 120px !important;
    }
    
    .category-circle img {
        width: 80px !important;
        height: 80px !important;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem !important;
    }
    
    .section-title {
        font-size: 2rem !important;
    }
    
    .category-grid {
        grid-template-columns: 1fr !important;
    }
}

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

/* Loading Animation */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Brand Logos Animation */
.brand-logo {
    transition: all 0.3s ease;
}

.brand-logo:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

/* Testimonial Cards */
.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
}

.feature-icon {
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* Service Features */
.service-feature {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.service-feature::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.6s;
    z-index: 1;
}

.service-feature:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25) !important;
    border-color: rgba(0,0,0,0.1);
}

.service-feature:hover::before {
    left: 100%;
}

.service-feature:hover h3 {
    color: #000 !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    transform: translateX(3px);
    transition: all 0.3s ease;
}

.service-feature:hover p {
    color: #222 !important;
    font-weight: 600 !important;
    transform: translateX(3px);
    transition: all 0.3s ease;
}

.service-feature:hover > div:first-child {
    transform: rotate(10deg) scale(1.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Service Features Grid Layout */
.service-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .service-features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 576px) {
    .service-features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Service feature responsive */
@media (max-width: 1200px) {
    .service-feature {
        gap: 15px !important;
        padding: 20px !important;
    }
    
    .service-feature > div:first-child {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        min-height: 60px !important;
        font-size: 1.8rem !important;
    }
    
    .service-feature h3 {
        font-size: 1rem !important;
    }
    
    .service-feature p {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 992px) {
    .service-feature {
        flex-direction: column;
        text-align: center;
        gap: 15px !important;
        padding: 20px !important;
    }
    
    .service-feature > div:first-child {
        width: 65px !important;
        height: 65px !important;
        min-width: 65px !important;
        min-height: 65px !important;
        font-size: 1.9rem !important;
        margin: 0 auto;
    }
    
    .service-feature h3 {
        font-size: 1.1rem !important;
    }
    
    .service-feature p {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 768px) {
    /* Switch to 2x2 grid on mobile */
    .service-feature {
        flex-direction: column;
        text-align: center;
        gap: 15px !important;
        padding: 25px !important;
    }
    
    .service-feature > div:first-child {
        width: 70px !important;
        height: 70px !important;
        min-width: 70px !important;
        min-height: 70px !important;
        font-size: 2rem !important;
        margin: 0 auto;
    }
    
    .service-feature h3 {
        font-size: 1.2rem !important;
    }
    
    .service-feature p {
        font-size: 1rem !important;
    }
}
