/**
 * Products Archive Styles
 * Basic CSS structure for products shortcode template
 */

/* Main Container - Uniform 1440px content width with standardized padding */
.handy-products-archive {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 240px;
}

/* Container width adjustments for different display modes */
.handy-products-archive.products-top-level,
.handy-products-archive.products-subcategory,
.handy-products-archive.products-list {
    max-width: 1440px;
}

/* Filter Controls Removed: Now handled by unified filter system via [filter-products] shortcode */

/* Products Grid */
.handy-products-grid {
    display: grid;
    gap: 40px;
    margin-bottom: 30px;
}

/* Category View Grid - Flexible layout for different contexts */
.products-category-view {
    display: grid;
    margin: 0 auto;
}

/* Standardized category cards: 695px width, 35px gap */
.products-top-level .products-category-view,
.products-subcategory .products-category-view {
    grid-template-columns: repeat(2, 695px);
    gap: 35px;
    justify-content: center;
}

/* Product List View Grid - 2 columns for 1420px content width */
.products-list-view {
    grid-template-columns: repeat(2, 675px);
    gap: 35px;
    justify-content: center;
}

/* Category Cards */
.product-category-card {
    background: white;
    border-radius: 60px;
    overflow: hidden;
    box-shadow: 10px 25px 0px #2329330F;
	margin-bottom: 60px;
}

.product-category-card:hover {
    
}

/* Category Image */
.category-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.125rem;
    font-weight: 500;
}

/* Category Info */
.category-info {
    padding: 20px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.category-icon {
    width: 125px;
    height: 125px;
    object-fit: contain;
}

.icon-placeholder {
    width: 125px;
    height: 125px;
    background: #dee2e6;
    border-radius: 4px;
    /* TODO: Remove when icons are added */
}

.category-title {
	font-family: Poppins, sans-serif;
    margin: 0;
    font-size: 2.563rem;
    font-weight: 700;
	letter-spacing: -0.82px;
    color: #273749;
}

/* Category Description */
.category-description {
    margin-bottom: 20px;
}

.description-text {
	font-family: Poppins, sans-serif;
	font-weight: 400;
    margin: 0;
    line-height: 1.6;
    color: #3E434A;
    font-size: 1.125rem;
}

.description-toggle {
    color: #007cba;
    cursor: pointer;
    text-decoration: underline;
}

.description-toggle:hover {
    color: #005a87;
}

/* Action Buttons */
.category-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

/* Base styling for category action items - ensures visibility at all screen sizes */
.category-action-item {
    /* Removed redundant background and border-radius - button handles its own styling */
}

.btn {
    padding: 10px 30px;
    border: none;
    text-decoration: none;
	font-family: Poppins, sans-serif;
    font-weight: 600;
    font-size: 1.063rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}


.btn-clear-filters {
    background: #6c757d;
    color: #FFFFFF;
}

.btn-clear-filters:hover {
    background: #5a6268;
}

/* Product List Cards */
.product-list-card {
    background: white;
    border-radius: 60px;
    overflow: hidden;
    box-shadow: 10px 25px 0px #2329330F;
	margin-bottom: 60px;
}

/* Product Thumbnail */
.product-thumbnail {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumbnail .image-placeholder {
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Product Info */
.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    font-family: Poppins, sans-serif;
    margin-bottom: .5rem;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.82px;
    color: #273749;
    line-height: 1;
	padding-bottom: 10px;
}

/* Content truncation classes for JavaScript equalizer */
.product-title.title-truncated {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-excerpt p.content-truncated {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Product Excerpt */
.product-excerpt {
    margin-bottom: 15px;
}

.product-excerpt p {
    font-family: Poppins, sans-serif;
    font-weight: 400;
    margin: 0;
    line-height: 1.6;
    color: #3E434A;
    font-size: 1.125rem;
}

/* Product Actions Button */
.product-actions {
    margin-top: 15px;
}

.btn-product-details {
    background: #0145AB;
    color: #FFFFFF;
    border-radius: 28px 28px 28px 28px;
    padding: 10px 30px;
    border: none;
    text-decoration: none;
    font-family: Poppins, sans-serif;
    font-weight: 600;
    font-size: 1.063rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-product-details:hover {
    background: #003a8c;
    color: #FFFFFF;
    text-decoration: none;
}

.btn-product-details i {
    font-size: 1rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-results p {
    font-size: 1.125rem;
    margin-bottom: 20px;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Responsive Design */
/* Large Desktop and up: 1800px+ (maintains fixed card sizes) */
@media (min-width: 1800px) {
    .products-top-level .products-category-view,
    .products-subcategory .products-category-view {
        /* Keep fixed card sizes on very large screens */
    }
}

/* Tablet: 1600px and below - adjust for standardized card layout */
@media (max-width: 1600px) {
    .handy-products-archive {
        padding: 15px 40px;
    }
    
    /* Category view - responsive 2 columns maintaining proportional gap */
    .products-top-level .products-category-view,
    .products-subcategory .products-category-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px;
        max-width: 100%;
    }
    
    /* Product list view - 2 columns on tablet */
    .products-list-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .category-actions {
        flex-direction: column;
    }
    
    .category-action-item {
        width: 100%;
        /* Background and border-radius inherited from base styles */
    }
    
    .category-action-item:not(:last-child) {
        margin-bottom: 8px;
    }
    
    .category-actions .btn {
        width: auto;
    }
    
    .btn {
        flex: none;
    }
    
    /* Scale down icons for tablet */
    .category-icon,
    .icon-placeholder {
        width: 80px;
        height: 80px;
    }
}

/* Mobile: 549px and below */
@media (max-width: 549px) {
    .handy-products-archive {
        padding: 10px 10px;
    }
    
    /* Category view - 1 column on mobile */
    .products-top-level .products-category-view,
    .products-subcategory .products-category-view {
        grid-template-columns: 1fr;
        gap: 35px;
    }
    
    /* Product list view - 1 column on mobile */
    .products-list-view {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .category-info {
        padding: 15px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-thumbnail {
        height: 120px;
    }
    
    /* Scale down icons for mobile */
    .category-icon,
    .icon-placeholder {
        width: 60px;
        height: 60px;
    }
    
    /* Pagination responsive styles */
    .handy-pagination {
        padding: 0 20px;
        margin: 30px auto 10px auto;
    }
    
    .pagination-container {
        gap: 4px;
    }
    
    .page-numbers {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 0.75rem;
        border-radius: 6px;
    }
    
    .prev-button.page-numbers,
    .next-button.page-numbers {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    /* Hide some page numbers on very small screens to prevent overflow */
    .pagination-container {
        justify-content: center;
    }
}

/* ==========================================================================
   Products Pagination Styles (Copied from Recipes)
   ========================================================================== */

/* Main pagination container - matches site's 1440px standard with centered layout */
.handy-pagination {
    max-width: 1440px;
    margin: 40px auto 20px auto;
    padding: 0 20px;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Base styling for all pagination elements */
.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 10px 16px;
    background: white;
    color: #3E434A;
    text-decoration: none;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: Poppins, sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(35, 41, 51, 0.06);
}

/* Hover effects for interactive elements */
.page-numbers:hover {
    background: #f8f9fa;
    border-color: #0145AB;
    color: #0145AB;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(35, 41, 51, 0.1);
}

/* Current page highlighting */
.page-numbers.current {
    background: #0145AB;
    color: white;
    border-color: #0145AB;
    cursor: default;
    transform: none;
    box-shadow: 0 2px 8px rgba(1, 69, 171, 0.3);
}

.page-numbers.current:hover {
    background: #0145AB;
    color: white;
    transform: none;
}

/* Previous and Next buttons - wider for better UX */
.prev-button.page-numbers,
.next-button.page-numbers {
    min-width: auto;
    padding: 10px 20px;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.prev-button.page-numbers:hover,
.next-button.page-numbers:hover {
    background: #0145AB;
    color: white;
    border-color: #0145AB;
}

/* Dots/ellipsis styling */
.page-numbers.dots {
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: default;
    box-shadow: none;
    font-weight: 700;
    font-size: 1rem;
}

.page-numbers.dots:hover {
    background: transparent;
    color: #6c757d;
    transform: none;
    box-shadow: none;
}

/* Focus states for accessibility */
.page-numbers:focus {
    outline: 2px solid #0145AB;
    outline-offset: 2px;
}

/* Active/pressed state */
.page-numbers:active:not(.current):not(.dots) {
    transform: translateY(0);
    background: #e9ecef;
}

/* ==========================================================================
   Pagination Responsive Design
   ========================================================================== */

/* Tablet: 1600px and below */
@media (max-width: 1600px) {
    .handy-pagination {
        padding: 0 40px;
        margin: 35px auto 15px auto;
    }
}

/* Medium screens: 1200px and below */
@media (max-width: 1200px) {
    .pagination-container {
        gap: 6px;
    }
    
    .page-numbers {
        min-width: 40px;
        height: 40px;
        padding: 8px 12px;
        font-size: 0.813rem;
    }
    
    .prev-button.page-numbers,
    .next-button.page-numbers {
        padding: 8px 16px;
    }
}
