/**
 * Category Bar Module Styles
 * PrestaShop 1.7 Module
 */

/* Main Wrapper - Scoped to prevent conflicts */
.category-bar-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.category-bar-wrapper * {
    box-sizing: border-box;
}

/* Top Toolbar */
.category-bar-wrapper .top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    gap: 20px;
}

.category-bar-wrapper .top-pagination {
    display: flex;
    align-items: center;
}

.category-bar-wrapper .top-pagination .pagination-nav {
    margin: 0;
}

.category-bar-wrapper .top-pagination .pagination {
    margin: 0;
}

/* Products Grid - Fixed to 5 columns */
.category-bar-wrapper .products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
}

/* Product Item */
.category-bar-wrapper .product-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

/* Product Content */
.category-bar-wrapper .product-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Product Image */
.category-bar-wrapper .product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #f5f5f5;
}

.category-bar-wrapper .product-image-wrapper a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-bar-wrapper .product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.category-bar-wrapper .product-item:hover .product-image {
    transform: scale(1.05);
}

.category-bar-wrapper .no-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ccc;
}

.category-bar-wrapper .no-image-placeholder i {
    font-size: 48px;
}

/* Product Info */
.category-bar-wrapper .product-info {
    padding: 0px 15px 0px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-bar-wrapper .product-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 5px;
}

.category-bar-wrapper .product-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.category-bar-wrapper .product-name a:hover {
    color: #007bff;
}

.category-bar-wrapper .product-index {
    font-size: 16px;
    color: #666;
    margin-top: auto;
}

.category-bar-wrapper .index-label {
    font-weight: 700;
}

.category-bar-wrapper .index-value {
    color: #333;
}

/* Product Prices */
.category-bar-wrapper .product-prices {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


.category-bar-wrapper .price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.category-bar-wrapper .price-label2 {
    color: #fdb819;
    font-size: 16px;
    font-weight: 600;
}

.category-bar-wrapper .price-label {
    color: #666;
}

.category-bar-wrapper .price-value {
    font-weight: 600;
    color: #333;
}

.category-bar-wrapper .price-with-tax {
    color: #007bff;
    font-size: 16px;
}

/* Product Actions */
.category-bar-wrapper .product-actions {
    padding: 15px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

.category-bar-wrapper .add-to-cart-form {
    width: 100%;
}

/* Quantity Selector */
.category-bar-wrapper .quantity-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-bar-wrapper .quantity-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.category-bar-wrapper .qty-btn {
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 0;
}

.category-bar-wrapper .qty-btn:hover {
    background: #e0e0e0;
}

.category-bar-wrapper .qty-btn:active {
    background: #d0d0d0;
}

.category-bar-wrapper .qty-btn i {
    font-size: 18px;
    color: #333;
}

.category-bar-wrapper .quantity-input {
    width: 60px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    -moz-appearance: textfield;
}

.category-bar-wrapper .quantity-input::-webkit-outer-spin-button,
.category-bar-wrapper .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.category-bar-wrapper .quantity-input:focus {
    outline: none;
}

/* Add to Cart Button */
.category-bar-wrapper .add-to-cart-btn {
    width: 100%;
    padding: 12px 20px;
    background: #fdb819;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
}

.category-bar-wrapper .add-to-cart-btn:hover {
    background: #782d29;
    transform: translateY(-1px);
}

.category-bar-wrapper .add-to-cart-btn:active {
    transform: translateY(0);
}

.category-bar-wrapper .add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.category-bar-wrapper .add-to-cart-btn i {
    font-size: 18px;
}

/* Pagination */
.category-bar-wrapper .pagination-controls {
    margin-top: 30px;
}

.category-bar-wrapper .products-per-page-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.category-bar-wrapper .products-per-page-selector label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.category-bar-wrapper .products-per-page-select {
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    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 10px center;
    background-size: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s ease;
}

.category-bar-wrapper .products-per-page-select:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.category-bar-wrapper .products-per-page-select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-color: #007bff;
}

.category-bar-wrapper .pagination-wrapper {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.category-bar-wrapper .pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.category-bar-wrapper .page-item {
    display: inline-block;
}

.category-bar-wrapper .page-link {
    display: block;
    padding: 8px 12px;
    color: #007bff;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.category-bar-wrapper .page-link:hover {
    background: #f5f5f5;
    border-color: #007bff;
}

.category-bar-wrapper .page-item.active .page-link {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    pointer-events: none;
}

.category-bar-wrapper .page-item.disabled .page-link {
    color: #ccc;
    pointer-events: none;
    border-color: #ddd;
}

/* No Products Message */
.category-bar-wrapper .no-products-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .category-bar-wrapper .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .category-bar-wrapper .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .category-bar-wrapper .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .category-bar-wrapper .product-info {
        padding: 12px;
    }
    
    .category-bar-wrapper .product-actions {
        padding: 12px;
    }
    
    .category-bar-wrapper {
        padding: 15px;
    }
    
    .category-bar-wrapper .products-per-page-selector {
        flex-direction: column;
        gap: 8px;
    }
    
    .category-bar-wrapper .pagination-info {
        font-size: 13px;
    }
    
    .category-bar-wrapper .top-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .category-bar-wrapper .top-pagination {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .category-bar-wrapper .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-bar-wrapper .product-name {
        font-size: 14px;
    }
    
    .category-bar-wrapper .price-row {
        font-size: 13px;
    }
    
    .category-bar-wrapper .add-to-cart-btn {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .category-bar-wrapper .products-per-page-selector {
        padding: 12px;
    }
    
    .category-bar-wrapper .products-per-page-selector label {
        font-size: 13px;
    }
    
    .category-bar-wrapper .products-per-page-select {
        font-size: 13px;
        padding: 6px 28px 6px 10px;
    }
    
    .category-bar-wrapper .top-toolbar {
        padding: 12px;
    }
    
    .category-bar-wrapper .pagination .page-link {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Loading States */
.category-bar-wrapper .add-to-cart-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Animations */
@keyframes categoryBarFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-bar-wrapper .product-item {
    animation: categoryBarFadeIn 0.3s ease;
}

/* Accessibility */
.category-bar-wrapper .qty-btn:focus,
.category-bar-wrapper .add-to-cart-btn:focus,
.category-bar-wrapper .page-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .category-bar-wrapper .product-actions,
    .category-bar-wrapper .pagination-wrapper {
        display: none;
    }
    
    .category-bar-wrapper .product-item {
        break-inside: avoid;
    }
}