/* ============================================
   WOOD TEXTURE BACKGROUNDS & VISUAL ENHANCEMENTS
   ============================================ */

/* Wood grain texture for sections */
.wood-texture {
    background-color: #f5f1eb;
    background-image: 
        linear-gradient(90deg, rgba(139, 90, 43, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(139, 90, 43, 0.03) 1px, transparent 1px);
    background-size: 50px 50px, 100px 100px;
    position: relative;
}

.wood-texture::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(61, 35, 23, 0.02) 2px,
            rgba(61, 35, 23, 0.02) 4px
        );
    pointer-events: none;
}

/* Dark wood texture for footer/hero */
.dark-wood-texture {
    background: linear-gradient(135deg, #2a1a0f 0%, #3d2317 50%, #1a0f08 100%);
    position: relative;
}

.dark-wood-texture::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(255, 255, 255, 0.02) 3px,
            rgba(255, 255, 255, 0.02) 6px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 20px,
            rgba(0, 0, 0, 0.1) 20px,
            rgba(0, 0, 0, 0.1) 22px
        );
    pointer-events: none;
}

/* Apply textures to sections */
.featured-products,
.categories-section {
    background-color: #f5f1eb;
    background-image: 
        linear-gradient(90deg, rgba(139, 90, 43, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(139, 90, 43, 0.02) 1px, transparent 1px);
    background-size: 60px 60px, 120px 120px;
}

.about-preview {
    background: linear-gradient(135deg, #faf8f5 0%, #f0ebe3 100%);
    position: relative;
}

.about-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(139, 90, 43, 0.015) 10px,
            rgba(139, 90, 43, 0.015) 20px
        );
    pointer-events: none;
}

/* Wood badge styles for products */
.wood-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.wood-badge-maple {
    background: #f5e6d3;
    color: #8b6914;
    border: 1px solid #d4af37;
}

.wood-badge-walnut {
    background: #3d2317;
    color: #d4c4a8;
    border: 1px solid #5d3a2a;
}

.wood-badge-cherry {
    background: #722f37;
    color: #f5e6d3;
    border: 1px solid #8b4513;
}

.wood-badge-oak {
    background: #c4a35a;
    color: #2a1a0f;
    border: 1px solid #8b6914;
}

/* Enhanced product cards with wood feel */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(42, 26, 15, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e8e0d5;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(42, 26, 15, 0.15);
}

.product-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8b5a2b, #c9a227, #8b5a2b);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover::after {
    opacity: 1;
}

/* Craftsmanship accent line */
.craft-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #8b5a2b, #c9a227);
    margin: 20px auto;
    border-radius: 2px;
}

/* Tool icon accents */
.tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f5f1eb, #e8e0d5);
    border-radius: 50%;
    color: #8b5a2b;
    font-size: 1.1rem;
    border: 2px solid #d4c4a8;
}

/* Section dividers with wood grain */
.section-divider {
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #d4c4a8 20%, 
        #8b5a2b 50%, 
        #d4c4a8 80%, 
        transparent 100%
    );
    margin: 60px 0;
    position: relative;
}

.section-divider::before {
    content: '✦';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #f5f1eb;
    padding: 0 15px;
    color: #8b5a2b;
    font-size: 1.2rem;
}

/* Image lazy loading placeholder */
.lazy-image {
    background: linear-gradient(135deg, #e8e0d5 0%, #d4c4a8 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { opacity: 0.5; }
}

/* Performance: will-change for animated elements */
.product-card,
.btn,
.hero-content {
    will-change: transform;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .btn,
    .hero-content {
        will-change: auto;
        transition: none;
    }
    
    .lazy-image {
        animation: none;
    }
}

/* ============================================
   IMAGE OPTIMIZATION & ENHANCEMENTS
   ============================================ */

/* Product image container */
.product-image {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #e8e0d5 0%, #d4c4a8 100%);
    aspect-ratio: 1 / 1;
    border-radius: 8px 8px 0 0;
}

/* Product images with smooth loading */
.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
    opacity: 0;
}

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

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

/* Image loading placeholder */
.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, #e8e0d5 25%, #d4c4a8 50%, #e8e0d5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

.product-image img.loaded + ::before,
.product-image img[src]:not([src='']) + ::before {
    display: none;
}

/* Hero image enhancements */
.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9) contrast(1.1);
}

/* Category image styling */
.category-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 4 / 3;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.1);
}

/* About section image styling */
.about-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(42, 26, 15, 0.2);
}

.about-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid rgba(201, 162, 39, 0.3);
    border-radius: 12px;
    pointer-events: none;
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Gallery image grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Print styles for images */
@media print {
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}