/* Elegant WooCommerce Front Page Styles */

/* Fix for disappearing images */
.images:not(.loading) > *,
.woocommerce .product figure:not(.loading) > *,
.thumbnail-wrapper > * {
    visibility: visible !important;
    opacity: 1 !important;
}

.images.loading:after,
.woocommerce .product figure.loading:after {
    display: none !important;
}

/* ===== RESET AND BASE STYLES ===== */
.elegant-front-page * {
    box-sizing: border-box;
}

.elegant-front-page {
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
}

.elegant-front-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.elegant-front-page .section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    font-weight: 300;
    color: #2c3e50;
    position: relative;
}

.elegant-front-page .section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #e74c3c;
    margin: 1rem auto;
}

/* ===== HERO SLIDER SECTION ===== */
.elegant-front-page .hero-slider {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
}

.elegant-front-page .hero-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.elegant-front-page .hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.elegant-front-page .hero-slide.active {
    opacity: 1;
}

.elegant-front-page .slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.elegant-front-page .slide-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.elegant-front-page .slide-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 20px;
}

/* Hero typography - now controlled by customizer with inline styles */
.elegant-front-page .hero-title {
    font-size: 3.5rem; /* Default fallback */
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.elegant-front-page .hero-subtitle {
    font-size: 1.3rem; /* Default fallback */
    margin-bottom: 2rem;
    opacity: 0.9;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    line-height: 1.6;
}

.elegant-front-page .hero-button {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 15px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1rem; /* Default fallback */
    transition: all 0.3s ease;
    text-shadow: none;
    border: 2px solid #e74c3c;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.elegant-front-page .hero-button:hover {
    background: transparent;
    color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Slider Controls */
.elegant-front-page .slider-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.elegant-front-page .slider-prev,
.elegant-front-page .slider-next {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.elegant-front-page .slider-prev:hover,
.elegant-front-page .slider-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.elegant-front-page .slider-dots {
    display: flex;
    gap: 10px;
}

.elegant-front-page .slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.elegant-front-page .slider-dot.active {
    background: white;
    transform: scale(1.2);
}

/* ===== FEATURED CATEGORIES SECTION ===== */
.elegant-front-page .featured-categories {
    padding: 2rem 0 5rem 0; /* Small top padding, large bottom padding */
    background: #f8f9fa;
}

.elegant-front-page .categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.elegant-front-page .category-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.elegant-front-page .category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.elegant-front-page .category-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

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

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

.elegant-front-page .category-content {
    padding: 1rem;
    text-align: center;
}

.elegant-front-page .category-content h3 {
    margin: 0 0 0.3rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.elegant-front-page .category-count {
    color: #7f8c8d;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== FEATURED PRODUCTS SECTION ===== */
.elegant-front-page .featured-products {
    padding: 2rem 0 5rem 0; /* Small top padding, large bottom padding */
    background: white;
}

.elegant-front-page .products-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.elegant-front-page .product-card {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.elegant-front-page .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.elegant-front-page .product-image {
    display: block;
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    flex-shrink: 0;
}

.elegant-front-page .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    display: block;
}

.elegant-front-page .product-card:hover .product-image img {
    transform: scale(1.1);
}

.elegant-front-page .product-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.elegant-front-page .product-title {
    margin: 0 0 0.4rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    flex-grow: 1;
}

.elegant-front-page .product-title a {
    text-decoration: none;
    color: #2c3e50;
    transition: color 0.3s ease;
}

.elegant-front-page .product-title a:hover {
    color: #e74c3c;
}

.elegant-front-page .product-author {
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    font-style: italic;
    line-height: 1.2;
}

.elegant-front-page .product-price {
    font-weight: 700;
    color: #e74c3c;
    font-size: 1rem;
    margin-top: auto;
}

.elegant-front-page .product-price del {
    color: #bdc3c7;
    font-size: 0.85rem;
    margin-right: 0.4rem;
}

.elegant-front-page .product-price ins {
    text-decoration: none;
}





/* ===== SPECIAL OFFERS SECTION ===== */

.elegant-front-page .special-offers {
    padding: 2rem 0 5rem 0; /* Small top padding, large bottom padding */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.elegant-front-page .special-offers .section-title {
    color: white;
}

.elegant-front-page .special-offers .section-title::after {
    background: white;
}

.elegant-front-page .offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.elegant-front-page .special-offers .product-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.elegant-front-page .special-offers .product-image {
    background: rgba(255, 255, 255, 0.05);
}

.elegant-front-page .special-offers .product-title a {
    color: white;
}

.elegant-front-page .special-offers .product-title a:hover {
    color: #f1c40f;
}

.elegant-front-page .special-offers .product-author {
    color: rgba(255, 255, 255, 0.8);
}

.elegant-front-page .special-offers .product-price {
    color: #f1c40f;
}

/* Sale Badge */
.elegant-front-page .sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}







/* ===== BESTSELLERS SECTION ===== */
.elegant-front-page .bestsellers-section {
    padding: 2rem 0 5rem 0; /* Small top padding, large bottom padding */
    background: #ecf0f1;
}

.elegant-front-page .bestsellers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

/* Bestseller Badge */
.elegant-front-page .bestseller-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #27ae60;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}

/* ===== NEWSLETTER SECTION ===== */
.elegant-front-page .newsletter-section {
    padding: 2rem 0 5rem 0; /* Small top padding, large bottom padding */
    background: #2c3e50;
    color: white;
    text-align: center;
}

.elegant-front-page .newsletter-content h2 {
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 300;
    color: white;
}

.elegant-front-page .newsletter-content p {
    margin-bottom: 2rem;
    opacity: 0.9;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.elegant-front-page .newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 0.5rem;
}

.elegant-front-page .newsletter-form input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.elegant-front-page .newsletter-form input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.3);
}

.elegant-front-page .newsletter-form button {
    padding: 15px 30px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.elegant-front-page .newsletter-form button:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ===== IMAGE VISIBILITY GUARANTEE ===== */
.elegant-front-page .category-image .no-image,
.elegant-front-page .product-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    color: #7f8c8d;
    font-size: 0.8rem;
    width: 100%;
    height: 100%;
    padding: 15px;
    text-align: center;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .elegant-front-page .container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .elegant-front-page .hero-slider {
        height: 500px;
    }
    
    .elegant-front-page .hero-title {
        font-size: 2.5rem !important;
    }
    
    .elegant-front-page .hero-subtitle {
        font-size: 1.1rem !important;
    }
    
    .elegant-front-page .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .elegant-front-page .featured-categories,
    .elegant-front-page .featured-products,
    .elegant-front-page .special-offers,
    .elegant-front-page .bestsellers-section,
    .elegant-front-page .newsletter-section {
        padding: 1.5rem 0 3rem 0; /* Adjusted for mobile */
    }
    
    .elegant-front-page .categories-grid,
    .elegant-front-page .products-carousel,
    .elegant-front-page .offers-grid,
    .elegant-front-page .bestsellers-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1.2rem;
    }
    
    .elegant-front-page .newsletter-form {
        flex-direction: column;
        max-width: 400px;
    }
    
    .elegant-front-page .slider-controls {
        bottom: 20px;
    }

    .elegant-front-page .category-image {
        height: 140px;
    }
    
    .elegant-front-page .product-image {
        height: 220px;
    }
    
    .elegant-front-page .product-title {
        font-size: 0.9rem;
    }
    
    .elegant-front-page .product-author {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .elegant-front-page .hero-slider {
        height: 400px;
    }
    
    .elegant-front-page .hero-title {
        font-size: 2rem !important;
    }
    
    .elegant-front-page .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 1.5rem;
    }
    
    .elegant-front-page .hero-button {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
    
    .elegant-front-page .container {
        padding: 0 15px;
    }
    
    .elegant-front-page .section-title {
        font-size: 1.75rem;
    }
    
    .elegant-front-page .categories-grid,
    .elegant-front-page .products-carousel,
    .elegant-front-page .offers-grid,
    .elegant-front-page .bestsellers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .elegant-front-page .category-image {
        height: 120px;
    }
    
    .elegant-front-page .product-image {
        height: 200px;
    }
    
    .elegant-front-page .slider-prev,
    .elegant-front-page .slider-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .elegant-front-page .product-title {
        font-size: 0.85rem;
    }
    
    .elegant-front-page .category-content h3 {
        font-size: 1rem;
    }
}

/* ===== LOADING ANIMATIONS ===== */
.elegant-front-page .category-image img,
.elegant-front-page .product-image img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.elegant-front-page .category-image img.loaded,
.elegant-front-page .product-image img.loaded {
    opacity: 1;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .elegant-front-page * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .elegant-front-page .hero-slider,
    .elegant-front-page .slider-controls,
    .elegant-front-page .newsletter-section {
        display: none;
    }
    
    .elegant-front-page {
        color: black;
        background: white;
    }
    
    .elegant-front-page .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===== BLOG POSTS SECTION ===== */
.elegant-front-page .blog-posts-section {
    padding: 2rem 0 5rem 0;
    background: #f8f9fa;
}

.elegant-front-page .blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.elegant-front-page .blog-post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.elegant-front-page .blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.elegant-front-page .blog-post-image {
    display: block;
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #ecf0f1;
    flex-shrink: 0;
}

.elegant-front-page .blog-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.elegant-front-page .blog-post-card:hover .blog-post-image img {
    transform: scale(1.05);
}

.elegant-front-page .blog-post-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    color: #7f8c8d;
    font-size: 0.9rem;
    width: 100%;
    height: 100%;
}

.elegant-front-page .blog-post-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.elegant-front-page .blog-post-category {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    align-self: flex-start;
}

.elegant-front-page .blog-post-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    flex-grow: 1;
}

.elegant-front-page .blog-post-title a {
    text-decoration: none;
    color: #2c3e50;
    transition: color 0.3s ease;
}

.elegant-front-page .blog-post-title a:hover {
    color: #e74c3c;
}

.elegant-front-page .blog-post-excerpt {
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.elegant-front-page .blog-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: auto;
}

.elegant-front-page .blog-post-date {
    font-weight: 500;
}

.elegant-front-page .blog-post-comments {
    background: #ecf0f1;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* Responsive Blog Posts */
@media (max-width: 768px) {
    .elegant-front-page .blog-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .elegant-front-page .blog-post-content {
        padding: 1.25rem;
    }
    
    .elegant-front-page .blog-post-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .elegant-front-page .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .elegant-front-page .blog-post-image {
        height: 180px;
    }
    
    .elegant-front-page .blog-post-content {
        padding: 1rem;
    }
    
    .elegant-front-page .blog-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Featured Books Section */
.featured-books-section {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.featured-books-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.featured-books-section .section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    font-weight: 600;
    color: #333;
    position: relative;
}

.featured-books-section .section-title:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #e74c3c; /* Accent color */
    margin: 15px auto 0;
}

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

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

@media (max-width: 576px) {
    .featured-books-grid {
        grid-template-columns: 1fr;
    }
}

.featured-book-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    padding-bottom: 20px;
}

.featured-book-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.book-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.book-image {
    overflow: hidden;
    aspect-ratio: 3/4; /* Adjust based on your book cover proportions */
    margin-bottom: 15px;
}

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

.featured-book-item:hover .book-image img {
    transform: scale(1.05);
}

.book-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 15px 10px;
    color: #222;
    line-height: 1.4;
}

.book-price {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e74c3c; /* Accent color */
    margin-bottom: 10px;
}

/* Fallback message */
.no-products {
    text-align: center;
    font-size: 1rem;
    color: #777;
    grid-column: 1 / -1;
}

