/* =============================================
   PRODUCTS.CSS — Wonder Digimech
   Professional Products Page Styling (Matches Website Design System)
   ============================================= */

/* Page Padding */
.products-overview,
.product-categories-section,
.featured-products,
.product-gallery {
    padding: 100px 0;
}

/* Statistics Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 60px;
}

.stat-card {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.06);
    transition: all var(--transition-slow);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
}

.stat-icon i {
    font-size: 1.8rem;
    color: #ffffff;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0f172a;
    font-family: var(--font-display);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
}

/* Dark Stats Grid (for Section 3 - bg-dark-section) */
.stats-grid-dark {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 60px;
}

.stat-card-dark {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: var(--radius-xl);
    text-align: center;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-slow);
}

.stat-card-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-card-dark:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.stat-card-dark .stat-number {
    color: #ffffff;
}

.stat-card-dark .stat-label {
    color: var(--text-secondary);
}

/* Product Categories Section */

.category-detail {
    margin-bottom: 100px;
}

.category-detail:last-child {
    margin-bottom: 0;
}

.category-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.category-detail-content.reverse {
    direction: rtl;
}

.category-detail-content.reverse > * {
    direction: ltr;
}

.category-detail-image {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    transition: all var(--transition-slow);
}

.category-detail-image:hover {
    transform: scale(1.02);
}

.category-detail-image img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.category-detail-image:hover img {
    transform: scale(1.08);
}

.category-detail-text h3 {
    font-size: 2.2rem;
    color: #ffffff;
    font-weight: 800;
    margin-bottom: 20px;
    font-family: var(--font-display);
}

.category-detail-text p {
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 28px;
}

.category-detail-text h4 {
    font-size: 1.15rem;
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 18px;
}

/* Light theme overrides for Section 2 - Product Categories */
.bg-light-section .category-detail-text h3 {
    color: #0f172a;
}

.bg-light-section .category-detail-text p {
    color: #475569;
}

.bg-light-section .category-detail-text h4 {
    color: #1e293b;
}

.applications-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

.applications-list span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(13, 148, 136, 0.12);
    border: 1px solid rgba(13, 148, 136, 0.25);
    border-radius: var(--radius-full);
    color: #38bdf8;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-md);
}

.applications-list span:hover {
    background: rgba(13, 148, 136, 0.2);
    border-color: rgba(13, 148, 136, 0.5);
    transform: translateY(-2px);
}

.applications-list span i {
    color: var(--primary-color);
}

/* Light theme overrides for applications-list tags */
.bg-light-section .applications-list span {
    background: rgba(13, 148, 136, 0.08);
    color: #0d9488;
    border-color: rgba(13, 148, 136, 0.2);
}

.bg-light-section .applications-list span i {
    color: #0d9488;
}

/* Featured Products Section */

.featured-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.featured-product-card {
    background: linear-gradient(145deg, #0f172a, #050914);
    border: 1px solid rgba(30, 64, 175, 0.25);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-slow);
    position: relative;
}

.featured-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.featured-product-card:hover::before {
    opacity: 1;
}

.featured-product-card:hover {
    transform: translateY(-10px);
    border-color: rgba(13, 148, 136, 0.6);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.featured-product-image {
    height: 220px;
    overflow: hidden;
    background: #f1f5f9;
}

.featured-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 35px;
    transition: transform 0.6s ease;
}

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

.featured-product-info {
    padding: 30px;
}

.featured-product-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: rgba(13, 148, 136, 0.15);
    color: #38bdf8;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
}

.featured-product-info h3 {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    font-family: var(--font-display);
}

.featured-product-info p {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

.featured-product-info .btn-primary {
    padding: 12px 28px;
    font-size: 0.9rem;
}

/* Light theme overrides for Featured Products (Section 4 - on light bg) */
.bg-light-section .featured-product-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    position: relative;
}

.bg-light-section .featured-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    height: 4px;
    width: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    opacity: 1;
}

.bg-light-section .featured-product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.03), transparent);
    pointer-events: none;
    border-radius: var(--radius-xl);
}

.bg-light-section .featured-product-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-color);
    box-shadow: 0 12px 40px rgba(13, 148, 136, 0.12);
}

.bg-light-section .featured-product-info {
    position: relative;
    z-index: 1;
}

.bg-light-section .featured-product-info h3 {
    color: #0f172a;
}

.bg-light-section .featured-product-info p {
    color: #475569;
}

.bg-light-section .featured-product-tag {
    background: rgba(13, 148, 136, 0.08);
    color: #0d9488;
}

/* Product Gallery - New Modal Lightbox Styles */

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 60px;
}

.gallery-item {
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 45px rgba(15, 23, 42, 0.12);
    transition: all var(--transition-slow);
    cursor: pointer;
    aspect-ratio: 4 / 3;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
}

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

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

/* Dark theme overrides for Gallery */
.bg-dark-section .gallery-item {
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
}

.bg-dark-section .gallery-item:hover {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

/* Hover Shadow effect on thumbnails */
.hover-shadow {
    transition: 0.3s;
}

.hover-shadow:hover {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

/* =============================================
   MODAL LIGHTBOX (W3Schools Reference)
   ============================================= */

/* The Modal (background) */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
}

/* Modal Content */
.modal-content {
    position: relative;
    background-color: transparent;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
}

/* The Close Button */
.close {
    color: white;
    position: fixed;
    top: 22px;
    right: 30px;
    font-size: 40px;
    font-weight: bold;
    z-index: 10001;
    cursor: pointer;
    transition: color 0.25s ease;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #ef4444;
    text-decoration: none;
}

/* Hide the slides by default */
.mySlides {
    display: none;
}

.mySlides img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

/* Next & previous buttons */
.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s ease;
    border-radius: 0 4px 4px 0;
    user-select: none;
    -webkit-user-select: none;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}

/* Position the "next button" to the right */
.next {
    right: 0;
    border-radius: 4px 0 0 4px;
}

/* On hover, add a black background color with a little bit see-through */
.prev:hover,
.next:hover {
    background-color: rgba(13, 148, 136, 0.7);
    text-decoration: none;
}

/* Number text (1/3 etc) */
.numbertext {
    color: #f2f2f2;
    font-size: 13px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
    background: rgba(0,0,0,0.4);
    border-radius: 0 0 8px 0;
}

/* Caption text */
.caption-container {
    text-align: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 12px 16px;
    color: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: -4px;
}

#caption {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    font-family: var(--font-display);
}

/* Demo thumbnail row */
.demo-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
}

.demo-column {
    flex: 0 0 auto;
    width: 60px;
}

.demo-column img {
    width: 100%;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
}

.demo-column img:hover {
    border-color: rgba(255,255,255,0.5);
}

.demo-column img.active,
.demo {
    opacity: 0.6;
}

.demo.active,
.demo:hover {
    opacity: 1;
    border-color: var(--primary-color);
}

/* Scroll lock */
body.modal-open {
    overflow: hidden;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .modal {
        padding-top: 60px;
    }

    .modal-content {
        width: 95%;
    }

    .mySlides img {
        max-height: 50vh;
    }

    .close {
        top: 14px;
        right: 18px;
        font-size: 32px;
    }

    .prev,
    .next {
        font-size: 18px;
        padding: 12px;
    }

    .demo-column {
        width: 44px;
    }

    .demo-column img {
        height: 36px;
    }

    #caption {
        font-size: 0.9rem;
    }
}

/* Responsive Styles */
@media (max-width: 991px) {
    .category-detail-content {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .category-detail-content.reverse {
        direction: ltr;
    }

    .category-detail-image img {
        height: 320px;
    }

    .stats-grid,
    .stats-grid-dark,
    .featured-products-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .products-overview,
    .product-categories-section,
    .why-our-products,
    .featured-products,
    .product-gallery {
        padding: 70px 0;
    }

    .stat-card {
        padding: 35px 25px;
    }

    .category-detail-text h3 {
        font-size: 1.9rem;
    }

    .category-detail {
        margin-bottom: 70px;
    }

    .category-detail-image img {
        height: 280px;
    }
}

@media (max-width: 576px) {
    .stats-grid,
    .stats-grid-dark,
    .featured-products-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 2.2rem;
    }
}
