/*
Theme Name: Tongmei Child
Theme URI: https://tongmei-sculpture.com
Description: Child theme for Hebei Tongmei Garden Sculpture
Author: Tongmei Team
Template: hello-elementor
Version: 1.0.0
*/

/* ============================================
   OVERRIDE ELEMENTOR CONTAINER MAX WIDTH
   Allows banners to span full viewport width
   ============================================ */
:root {
    --container-max-width: 1920px;
}

.elementor-section,
.elementor-container {
    --container-max-width: 1920px;
}

/* ============================================
   UNIFIED WIDTH MANAGEMENT
   All pages use 1600px max-width for consistency
   ============================================ */

/* Override parent theme max-width for all pages */
@media(min-width: 1200px) {
    /* Header and Footer */
    .page-header .entry-title,
    .site-footer .footer-inner,
    .site-footer:not(.dynamic-footer),
    .site-header .header-inner,
    .site-header:not(.dynamic-header),
    body:not([class*=elementor-page-]) .site-main {
        max-width: 1600px !important;
    }

    .site-footer.footer-full-width,
    .site-header.header-full-width {
        max-width: 100% !important;
    }
}

/* Ensure custom header is centered */
.tm-hdr {
    width: 100% !important;
}

.tm-hdr .inner {
    max-width: 1600px !important;
    margin: 0 auto !important;
}

/* Blog layout adjustments */
.blog-content-wrapper {
    display: grid !important;
    grid-template-columns: 1fr 350px !important;
    gap: 50px !important;
}

.blog-sidebar {
    min-width: 350px !important;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 0;
    list-style: none;
    margin: 0;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.product-card .product-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: #f0f0f0;
}

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

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

.product-card .product-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f6f3 0%, #e8e4df 100%);
    color: var(--tm-accent);
    font-size: 48px;
}

.product-card .product-info {
    padding: 20px;
}

.product-card .product-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--tm-primary);
    margin: 0 0 10px;
}

.product-card .product-info h3 a {
    color: inherit;
    text-decoration: none;
}

.product-card .product-info h3 a:hover {
    color: var(--tm-accent);
}

.product-card .product-info .product-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 15px;
}

.product-card .product-info .product-category {
    display: inline-block;
    background: #f8f6f3;
    color: #888;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Single Product */
.single-product-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 60px 40px;
}

.single-product-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
}

.single-product-image {
    flex: 1;
    min-width: 350px;
}

.single-product-image > img {
    width: 100%;
    border-radius: 12px;
}

.single-product-image .no-image {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #f8f6f3 0%, #e8e4df 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: var(--tm-accent);
}

.single-product-details {
    flex: 1;
    min-width: 350px;
}

.single-product-details h1 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    color: var(--tm-primary);
    margin: 0 0 20px;
    line-height: 1.3;
}

.single-product-details .category-tags {
    margin-bottom: 25px;
}

.single-product-details .category-tag {
    display: inline-block;
    background: #f8f6f3;
    color: #666;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    margin-right: 8px;
    margin-bottom: 8px;
}

.single-product-details .product-excerpt {
    font-size: 17px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 25px;
}

.product-content-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.product-content-section .product-content {
    font-size: 15px;
    color: #444;
    line-height: 1.8;
}

.product-content-section .product-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: var(--tm-primary);
    margin: 25px 0 15px;
}

.product-content-section .product-content ul {
    padding-left: 20px;
    margin: 10px 0;
}

.product-content-section .product-content li {
    margin-bottom: 8px;
}

.single-product-details .quote-btn {
    display: inline-block;
    background: var(--tm-accent);
    color: #fff;
    padding: 16px 40px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin-top: 30px;
    transition: background 0.3s;
}

.single-product-details .quote-btn:hover {
    background: var(--tm-hover);
}

/* Related Products */
.related-products {
    margin-top: 60px;
    padding-top: 60px;
    border-top: 1px solid #eee;
}

.related-products h2 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: var(--tm-primary);
    text-align: center;
    margin: 0 0 40px;
}

/* Category Filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
}

.category-filter a {
    display: inline-block;
    padding: 8px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    color: #666;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.category-filter a:hover,
.category-filter a.active {
    border-color: var(--tm-accent);
    color: var(--tm-accent);
    background: rgba(201, 169, 110, 0.08);
}

/* Breadcrumb */
.breadcrumb {
    font-size: 14px;
    color: #999;
    margin-bottom: 30px;
}

.breadcrumb a {
    color: #999;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--tm-accent);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.pagination a {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.pagination a:hover {
    border-color: var(--tm-accent);
    color: var(--tm-accent);
}

.pagination span.current {
    background: var(--tm-accent);
    color: #fff;
    border: 1px solid var(--tm-accent);
}

/* Product Gallery (main + thumbs) */
.gallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: #f0f0f0;
    cursor: pointer;
}

.gallery-main-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s;
}

.gallery-main-img.active {
    opacity: 1;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.gallery-thumb {
    width: 72px;
    height: 72px;
    min-width: 72px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.3s;
    flex-shrink: 0;
    display: block;
}

.gallery-thumb:hover {
    opacity: 1;
}

.gallery-thumb.active {
    border-color: var(--tm-accent);
    opacity: 1;
}

/* Lightbox */
.tongmei-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.tongmei-lightbox.active {
    display: flex;
}

.tongmei-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
}

.tongmei-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
}

.tongmei-lightbox-prev,
.tongmei-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    z-index: 10001;
    padding: 20px;
    user-select: none;
}

.tongmei-lightbox-prev { left: 20px; }
.tongmei-lightbox-next { right: 20px; }

.tongmei-lightbox-prev:hover,
.tongmei-lightbox-next:hover {
    color: var(--tm-accent);
}

/* Responsive */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .single-product-layout {
        flex-direction: column;
    }

    .single-product-image,
    .single-product-details {
        min-width: 100%;
    }

    .product-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
