/**
 * Responsive Layout and Styling Foundation for wcat-cpc-api-plugin Templates
 * 
 * Provides responsive grid layouts and accessibility compliance
 * Supports 2-column desktop, 1-column mobile layout
 * Foundation for future detailed CSS styling enhancements
 * 
 * @package WC_CPC_API_Cats
 * @since 1.0.0
 */

/* ==========================================================================
   Base Mobile-First Approach (Mobile: 320px+)
   ========================================================================== */

/* Archive and Taxonomy Container Base */
.new-product-archive,
.new-category-archive {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
}

/* Hero Section Base */
.archive-hero,
.category-hero {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.archive-hero::before,
.category-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.archive-hero-content,
.category-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 100%;
    padding: 1rem;
}

.archive-eyebrow,
.category-eyebrow {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.archive-title,
.category-hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.archive-description,
.category-hero-description {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    opacity: 0.95;
}

/* Content Areas */
.archive-content,
.category-content {
    margin-bottom: 2rem;
}

/* Filter and Control Sections */
.archive-filters,
.archive-controls,
.products-controls {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.industry-filter,
.sort-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.industry-filter label,
.sort-controls label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
    margin: 0;
}

.industry-filter-select,
.sort-select,
.per-page-select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 0.875rem;
    width: 100%;
    max-width: 200px;
}

.results-count {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    margin-top: 0.5rem;
}

/* Grid Layout Base - Mobile First (1 Column) */
.terms-grid,
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Grid Item Base Styles */
.term-item,
.product-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.term-item:hover,
.product-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Image Containers */
.term-image,
.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.term-item:hover .term-image img,
.product-item:hover .product-image img {
    transform: scale(1.05);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

/* Content Areas */
.term-content,
.product-content {
    padding: 1rem;
}

.term-title,
.product-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
}

.term-title a,
.product-title a {
    color: #343a40;
    text-decoration: none;
    transition: color 0.3s ease;
}

.term-title a:hover,
.product-title a:hover {
    color: #007bff;
}

.term-description {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.term-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
}

/* Product Specifications */
.product-specifications {
    margin-top: 0.75rem;
}

.specs-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
}

.spec-name {
    font-weight: 600;
    color: #495057;
    flex: 1;
}

.spec-value {
    color: #6c757d;
    text-align: right;
    flex: 1;
}

/* FAQ Section */
.category-faqs {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.faqs-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #343a40;
}

.faq-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.faq-question {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

.faq-answer {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* Pagination Base */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.pagination {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    background: white;
    color: #007bff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pagination .current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .dots {
    border: none;
    background: none;
    color: #6c757d;
}

/* ==========================================================================
   Tablet Layout (768px+)
   ========================================================================== */

@media (min-width: 768px) {
    /* Container Adjustments */
    .new-product-archive,
    .new-category-archive {
        padding: 1.5rem;
    }

    /* Hero Section Enhancements */
    .archive-hero,
    .category-hero {
        min-height: 400px;
    }

    .archive-title,
    .category-hero-title {
        font-size: 2.5rem;
    }

    .archive-description,
    .category-hero-description {
        font-size: 1.125rem;
    }

    /* Control Sections - Horizontal Layout */
    .archive-filters,
    .archive-controls,
    .products-controls {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .industry-filter,
    .sort-controls {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    .results-count {
        text-align: right;
        margin-top: 0;
    }

    /* Grid Enhancements - Still 1 Column but Larger Items */
    .term-image,
    .product-image {
        height: 250px;
    }

    .term-content,
    .product-content {
        padding: 1.25rem;
    }

    .term-title,
    .product-title {
        font-size: 1.25rem;
    }
}

/* ==========================================================================
   Desktop Layout (1024px+) - 2 Column Grid
   ========================================================================== */

@media (min-width: 1024px) {
    /* Container Enhancements */
    .new-product-archive,
    .new-category-archive {
        max-width: 1200px;
        padding: 2rem;
    }

    /* Hero Section Full Enhancement */
    .archive-hero,
    .category-hero {
        min-height: 500px;
    }

    .archive-hero-content,
    .category-hero-content {
        max-width: 800px;
    }

    .archive-title,
    .category-hero-title {
        font-size: 3rem;
    }

    /* 2-Column Grid Layout */
    .terms-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    /* Enhanced Grid Items */
    .term-item,
    .product-item {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .term-content,
    .product-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 1.5rem;
    }

    .term-title,
    .product-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .term-description {
        flex: 1;
        margin-bottom: 1rem;
    }

    /* Enhanced Specifications Layout */
    .specs-list {
        gap: 0.5rem;
    }

    .spec-item {
        padding: 0.5rem 0;
        font-size: 0.875rem;
    }

    /* FAQ Section Enhancement */
    .category-faqs {
        padding: 2rem;
    }

    .faq-item {
        padding: 1.5rem;
    }

    .faq-question {
        font-size: 1.125rem;
    }
}

/* ==========================================================================
   Large Desktop Layout (1440px+)
   ========================================================================== */

@media (min-width: 1440px) {
    /* Container Maximum Enhancement */
    .new-product-archive,
    .new-category-archive {
        max-width: 1400px;
    }

    /* Hero Section Maximum */
    .archive-hero,
    .category-hero {
        min-height: 600px;
    }

    /* Enhanced Grid Spacing */
    .terms-grid,
    .products-grid {
        gap: 2.5rem;
    }

    /* Enhanced Content Spacing */
    .term-content,
    .product-content {
        padding: 2rem;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Focus States */
.term-title a:focus,
.product-title a:focus,
.industry-filter-select:focus,
.sort-select:focus,
.per-page-select:focus,
.pagination a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .term-item,
    .product-item {
        border-width: 2px;
    }
    
    .term-title a,
    .product-title a {
        text-decoration: underline;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .term-item,
    .product-item,
    .term-image img,
    .product-image img,
    .pagination a,
    .industry-filter-select,
    .sort-select,
    .per-page-select {
        transition: none;
    }
    
    .term-item:hover,
    .product-item:hover {
        transform: none;
    }
    
    .term-item:hover .term-image img,
    .product-item:hover .product-image img {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .archive-filters,
    .archive-controls,
    .products-controls,
    .pagination-wrapper {
        display: none;
    }
    
    .terms-grid,
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .term-item,
    .product-item {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
    }
}

/* ==========================================================================
   Loading States and Progressive Enhancement
   ========================================================================== */

/* Loading State for Grid Items */
.term-item.loading,
.product-item.loading {
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.6;
    }
    to {
        opacity: 1;
    }
}

/* JavaScript Enhanced States */
.js .sort-controls {
    position: relative;
}

.js .sort-controls::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #6c757d;
    pointer-events: none;
}

/* Error States */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 1rem 0;
    text-align: center;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.no-results p {
    margin: 0;
    font-size: 1rem;
} 