/**
 * Tab Products Styles
 * 
 * Styles for AJAX-based product listing in tabs
 * 
 * @package Blocksy_Child
 */

/* Main Wrapper */
.autohjul-tab-products-wrapper {
    width: 100%;
    margin: 30px 0;
}

/* Filters Section */
.autohjul-tab-products-filters {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.autohjul-tab-products-filters__wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.autohjul-tab-products-filters__field {
    flex: 1;
    min-width: 200px;
}

.autohjul-tab-products-filters__field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.autohjul-tab-products-filters__field select {
    width: 100%;
    padding: 7px 12px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.autohjul-tab-products-filters__field select:hover {
    border-color: #999;
}

.autohjul-tab-products-filters__field select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Products Container */
.autohjul-tab-products-container {
    position: relative;
    min-height: 400px;
}

/* Loading: tyre loader is in assets/css/tyre-loader.css */
.autohjul-tab-products-loading {
    text-align: center;
    padding: 60px 20px;
}

/* Products Grid */
.autohjul-tab-products-grid {
    width: 100%;
}

.autohjul-tab-products-grid .products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Ensure 4 products per row (8 products = 2 rows) */
.autohjul-tab-products-grid .products .product {
    width: 100%;
    margin: 0;
    padding: 0;
    max-width: 100%;
}

/* Home page shortcode: full tire images, proper display */
.autohjul-tab-products-grid .autohjul-product-card__image-wrapper {
    min-height: 180px;
}

.autohjul-tab-products-grid .autohjul-product-card__image {
    object-fit: contain;
    object-position: center;
    width: 100%;
    height: 100%;
}

/* Responsive Grid */
@media (max-width: 1200px) {
    .autohjul-tab-products-grid .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .autohjul-tab-products-grid .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .autohjul-tab-products-filters__wrapper {
        flex-direction: column;
    }
    
    .autohjul-tab-products-filters__field {
        min-width: 100%;
    }
}

/* Mobile: keep 2 columns, smaller gap so both cards fit without truncation */
@media (max-width: 576px) {
    .autohjul-tab-products-wrapper {
        padding: 0 8px;
    }
    
    .autohjul-tab-products-grid .products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    
    .autohjul-tab-products-grid .products .product {
        min-width: 0;
    }
}

/* No Products Message */
.autohjul-no-products,
.autohjul-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.autohjul-error {
    color: #dc3545;
}

/* Pagination */
.autohjul-tab-products-pagination {
    margin-top: 40px;
    text-align: center;
}

.autohjul-pagination {
    display: inline-block;
}

.autohjul-pagination__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.autohjul-pagination__item {
    margin: 0;
    padding: 0;
}

.autohjul-pagination__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    text-align: center;
    text-decoration: none;
    color: #333;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 16px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.autohjul-pagination__link:hover {
    background-color: #ffffff;
    border-color: #999;
    color: #000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.autohjul-pagination__link--active {
    background-color: #0066cc;
    border-color: #0066cc;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.autohjul-pagination__link--active:hover {
    background-color: #0052a3;
    border-color: #0052a3;
    color: #ffffff;
    transform: translateY(-1px);
}

.autohjul-pagination__link--prev,
.autohjul-pagination__link--next {
    font-weight: 600;
    color: #333;
}

.autohjul-pagination__link--prev:hover,
.autohjul-pagination__link--next:hover {
    background-color: #ffffff;
    color: #0066cc;
}

.autohjul-pagination__item--dots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.autohjul-pagination__item--dots span {
    color: #666;
    font-size: 16px;
}

.autohjul-pagination__link:disabled,
.autohjul-pagination__link[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Screen Reader Text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .autohjul-pagination__list {
        gap: 6px;
    }
    
    .autohjul-pagination__link {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .autohjul-pagination__item--dots {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .autohjul-pagination__link {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
    
    .autohjul-pagination__item--dots {
        width: 36px;
        height: 36px;
        display: none;
    }
}
