/**
 * CSS for product and category pages
 */

/* Common product styles */
.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 220px;
    background-color: #f8f8f8;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-content {
    padding: 1.25rem;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    transition: color 0.2s ease;
}

.product-card:hover .product-title {
    color: var(--wp--preset--color--primary);
}

.product-number {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.product-cta .button {
    display: inline-block;
    background-color: var(--wp--preset--color--primary);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.product-cta .button:hover {
    background-color: var(--wp--preset--color--secondary);
}

/* Category archive page */
.category-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
}

.category-title {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
}

.category-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.category-description p {
    margin-bottom: 1rem;
}

.category-products-count {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #666;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.no-products-found {
    padding: 3rem;
    text-align: center;
    background-color: #f8f8f8;
    border-radius: 8px;
    margin: 2rem 0;
}

/* Product category info block */
.category-info-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.category-image {
    flex: 0 0 350px;
}

.category-image img {
    border-radius: 8px;
    width: 100%;
    height: auto;
}

.category-info-content {
    flex: 1;
    min-width: 300px;
}

.category-featured-badge {
    display: inline-block;
    background-color: var(--wp--preset--color--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-image {
        flex: 0 0 100%;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .category-title {
        font-size: 2rem;
    }
}

/* Category DataTable */
.category-products-datatable {
    margin: 2rem 0;
}

.category-main-image {
    margin: 1.5rem 0;
}

.category-main-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.category-extended-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* DataTable styling overrides */
.dataTables_wrapper {
    margin-top: 2rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper table.dataTable {
    border-collapse: collapse;
}

.dataTables_wrapper table.dataTable thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    padding: 12px 8px;
}

.dataTables_wrapper table.dataTable tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #dee2e6;
}

.dataTables_wrapper table.dataTable tbody tr:hover {
    background-color: #f8f9fa;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 1rem;
}

/* Single Product Page */
.single-product .wp-block-post-title {
    margin-bottom: 0.5rem;
}

/* Product Number Block */
.wp-block-acf-h2w-product-number {
    font-size: 1.125rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Product Main Image */
.wp-block-acf-h2w-product-main-image {
    margin-bottom: 2rem;
}

.wp-block-acf-h2w-product-main-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Product Additional Images Gallery */
.wp-block-acf-h2w-product-additional-images {
    margin-bottom: 2rem;
}

.wp-block-acf-h2w-product-additional-images .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.wp-block-acf-h2w-product-additional-images img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wp-block-acf-h2w-product-additional-images img:hover {
    transform: scale(1.05);
}

/* Product Overview Block */
.wp-block-acf-h2w-product-overview {
    margin-bottom: 2rem;
}

.wp-block-acf-h2w-product-overview h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.wp-block-acf-h2w-product-overview p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Product Specifications Table */
.h2w-product-specifications {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 12px;
    position: sticky;
    top: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.h2w-product-specifications .h2w-spec-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--wp--preset--color--primary, #0073aa);
    color: #1a1a1a;
}

.h2w-product-specifications .h2w-spec-table-wrapper {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.h2w-product-specifications .h2w-spec-table {
    width: 100%;
    border-collapse: collapse;
}

.h2w-product-specifications .h2w-spec-label {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    color: #495057;
    background: #f8f9fa;
    width: 45%;
    border-bottom: 1px solid #e9ecef;
}

.h2w-product-specifications .h2w-spec-value {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.95rem;
    color: #212529;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.h2w-product-specifications .h2w-spec-table tbody tr {
    transition: all 0.2s ease;
}

.h2w-product-specifications .h2w-spec-table tbody tr:hover {
    background-color: #f0f7ff;
}

.h2w-product-specifications .h2w-spec-table tbody tr:last-child .h2w-spec-label,
.h2w-product-specifications .h2w-spec-table tbody tr:last-child .h2w-spec-value {
    border-bottom: none;
}


/* No data message */
.h2w-product-specifications .h2w-spec-no-data {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Downloads Section */
.single-product h2.wp-block-heading {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

/* PDF and Technical Drawing Blocks */
.wp-block-acf-h2w-product-pdf,
.wp-block-acf-h2w-product-technical-drawing {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.wp-block-acf-h2w-product-pdf:hover,
.wp-block-acf-h2w-product-technical-drawing:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.wp-block-acf-h2w-product-pdf a,
.wp-block-acf-h2w-product-technical-drawing a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--wp--preset--color--primary, #0073aa);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.wp-block-acf-h2w-product-pdf a:hover,
.wp-block-acf-h2w-product-technical-drawing a:hover {
    background: var(--wp--preset--color--secondary, #005177);
}

/* Related Products Block */
.wp-block-acf-h2w-related-products {
    margin-top: 3rem;
}

.wp-block-acf-h2w-related-products h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

/* Responsive Design for Single Product */
@media (max-width: 768px) {
    .wp-block-columns {
        flex-direction: column !important;
    }

    .wp-block-column {
        flex-basis: 100% !important;
        width: 100% !important;
    }

    .h2w-product-specifications {
        position: static;
        margin-bottom: 2rem;
    }
}