/* Custom Product Tabs Plugin Styles */

.custom-product-tabs-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Main Layout - Two Column */
.main-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Left Sidebar - Filters */
.sidebar-filters {
    flex: 0 0 300px;
    min-width: 300px;
}

/* Right Main Content */
.main-content {
    flex: 1;
    min-width: 0; /* Allows content to shrink */
}

/* Price Filter Container */
.price-filter-container {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 0;
    position: sticky;
    top: 20px;
}

.filter-title {
    color: #0073aa;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.price-filter {
    max-width: 100%;
}

.price-label {
    color: #0073aa;
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 15px 0;
}

/* Price Slider */
.price-slider-wrapper {
    margin-bottom: 15px;
}

.price-slider {
    position: relative;
    height: 40px;
    margin: 0 10px;
}

.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    transform: translateY(-50%);
}

.slider-range {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 6px;
    background: #0073aa;
    border-radius: 3px;
    transform: translateY(-50%);
}

.slider-handle {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid #0073aa;
    border-radius: 50%;
    cursor: grab;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 2;
}

.slider-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.slider-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.15);
}

.min-handle {
    left: 0%;
}

.max-handle {
    left: 100%;
}

/* Price Range Display */
.price-range-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 14px;
    color: #333;
}

.min-price-display,
.max-price-display {
    font-weight: 500;
}

.price-separator {
    margin: 0 10px;
    color: #666;
}

/* Apply Filter Button */
.apply-filter-btn {
    width: 100%;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.apply-filter-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.apply-filter-btn:active {
    transform: translateY(0);
}

/* Sort Container */
.sort-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 20px;
    gap: 10px;
}

.sort-container label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.sort-dropdown {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    min-width: 180px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.sort-dropdown:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Tabs Container */
.tabs-container {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
    overflow-x: auto;
    gap: 2px;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.tab-button:hover {
    color: #333;
    background-color: #f8f9fa;
}

.tab-button.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background-color: #f8f9fa;
}

/* Products Container */
.products-container {
    margin-top: 20px;
}

.products-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, 1fr);
}

.products-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.products-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.products-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #0073aa;
}

/* New Badge */
.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff6b35;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.product-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-thumbnail {
    transform: scale(1.05);
}

/* Thumbnail Icon Structure */
.thumb-icon {
    height: 100%;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mini-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-icon.pdf {
    background: rgba(224, 85, 85, 0.15);
    border: 0.5px solid rgba(224, 85, 85, 0.3);
}

.mini-icon.excel {
    background: rgba(58, 184, 122, 0.15);
    border: 0.5px solid rgba(58, 184, 122, 0.3);
}

.icon-label {
    font-size: 10px;
    color: #555;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
}

/* Product Content */
.product-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Fallback for browsers that don't support line-clamp */
    max-height: 2.6em;
    text-overflow: ellipsis;
}

.product-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Fallback for browsers that don't support line-clamp */
    max-height: 2.8em;
    text-overflow: ellipsis;
    flex: 1;
}

.product-price {
    margin-bottom: 15px;
}

.price-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.price-text .woocommerce-Price-currencySymbol {
    font-size: 14px;
}

/* Buy Now Button */
.buy-now-btn {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.buy-now-btn:hover {
    background: linear-gradient(135deg, #005a87, #00456b);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

/* No Products Message */
.no-products {
    text-align: center;
    color: #666;
    font-size: 16px;
    padding: 40px;
    grid-column: 1 / -1;
}

/* Loading State */
.products-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.products-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .sidebar-filters {
        flex: 0 0 auto;
        min-width: auto;
    }
    
    .price-filter-container {
        position: static;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid[data-columns="4"],
    .products-grid[data-columns="5"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .custom-product-tabs-wrapper {
        padding: 15px;
    }
    
    .main-layout {
        gap: 15px;
    }
    
    .sort-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .sort-dropdown {
        min-width: auto;
    }
    
    .tabs-container {
        gap: 0;
        border-bottom-width: 1px;
    }
    
    .tab-button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .products-grid[data-columns="4"],
    .products-grid[data-columns="5"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .product-description {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid[data-columns="2"],
    .products-grid[data-columns="3"],
    .products-grid[data-columns="4"],
    .products-grid[data-columns="5"] {
        grid-template-columns: 1fr;
    }
    
    .product-image {
        height: 180px;
    }
    
    .tab-button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Smooth Transitions */
.products-grid {
    transition: opacity 0.3s ease;
}

/* Accessibility */
.tab-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
}

.buy-now-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.sort-dropdown:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

