/* Product List Page Styles */

/* Products Section */
.products-section {
    padding: 120px 0 60px;
    background: #f8f9fa;
    min-height: 100vh;
}

.products-section .container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* Products Header */
.products-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 1s ease 0.2s both;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.4s both;
}

.search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 15px 50px 15px 50px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.search-bar input:focus {
    outline: none;
    border-color: #ff8c42;
    box-shadow: 0 4px 20px rgba(255, 140, 66, 0.15);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.clear-search:hover {
    color: #ff8c42;
    background: rgba(255, 140, 66, 0.1);
}

/* Products Layout - Sidebar Style */
.products-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* Filters Sidebar */
.filters-sidebar {
    background: white;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 120px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.filters-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters-sidebar-header h3 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-sidebar-icon {
    font-size: 1.2rem;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: #f0f0f0;
    color: #333;
}

.filters-sidebar-content {
    padding: 0;
}

.filters-actions {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.clear-filters {
    background: transparent;
    border: 1px solid #ff8c42;
    color: #ff8c42;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 0.9rem;
}

.clear-filters:hover {
    background: #ff8c42;
    color: white;
}

.filters-list {
    padding: 0;
}

/* Mobile Filter Bar */
.mobile-filter-bar {
    display: none;
    position: fixed;
    bottom: 2rem;
    left: 1rem;
    z-index: 1001;
    padding: 0;
    margin: 0;
}

.mobile-filters-toggle {
    display: flex;
    background: #ff8c42;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    box-shadow: 0 6px 20px rgba(255, 140, 66, 0.4);
    position: relative;
}

.mobile-filters-toggle::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff8c42, #ffa726);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filters-toggle:hover::before {
    opacity: 1;
}

.mobile-filters-toggle:hover {
    background: #e67e22;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 140, 66, 0.5);
}

.mobile-filters-toggle:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.4);
}

.mobile-filters-toggle svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.mobile-filters-toggle span {
    display: none;
}

/* Active state when sidebar is open */
.filters-sidebar.mobile-open ~ .mobile-filter-bar .mobile-filters-toggle {
    background: #e67e22;
    transform: rotate(45deg);
}

/* Filter Groups */
.filter-group {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    height: auto;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-group:hover {
    background: #fafafa;
}

.filter-group.active {
    background: #fff;
}

.filter-group-header {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: auto;
}

.filter-group-header:hover {
    background: #f8f9fa;
}

.filter-group.active .filter-group-header {
    background: rgba(255, 140, 66, 0.05);
    color: #ff8c42;
    border-bottom: 1px solid rgba(255, 140, 66, 0.1);
}

.filter-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    transition: color 0.3s ease;
}

.filter-group.active .filter-group-title {
    color: #ff8c42;
    font-weight: 600;
}

.filter-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.filter-group.active .filter-icon {
    transform: scale(1.05);
}

.filter-chevron {
    transition: all 0.3s ease;
    color: #999;
    width: 14px;
    height: 14px;
}

.filter-group.active .filter-chevron {
    transform: rotate(180deg);
    color: #ff8c42;
}

.filter-options {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    opacity: 0;
}

.filter-options.expanded {
    max-height: 300px;
    padding: 0.75rem 1.5rem 1.25rem;
    opacity: 1;
    background: #fafafa;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Custom Checkbox */
.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 30px;
    font-size: 0.9rem;
    color: #555;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.filter-option:hover {
    color: #333;
}

.filter-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 2px;
    height: 18px;
    width: 18px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.filter-option:hover .checkmark {
    border-color: #ff8c42;
    background: #fff;
}

.filter-option input:checked ~ .checkmark {
    background: #ff8c42;
    border-color: #ff8c42;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-option input:checked ~ .checkmark:after {
    display: block;
}

/* Products Main */
.products-main {
    min-height: 600px;
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 1s ease 0.8s both;
}

#resultsCount {
    font-weight: 500;
    color: #666;
}

.sort-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-section label {
    font-weight: 500;
    color: #666;
}

#sortSelect {
    padding: 8px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#sortSelect:focus {
    outline: none;
    border-color: #ff8c42;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    animation: fadeInUp 1s ease 1s both;
}

/* Enhanced Product Card */
.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* Enhanced Product Clickable Area */
.product-clickable {
    flex: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.product-clickable:hover {
    color: inherit;
    text-decoration: none;
}

.product-clickable:focus {
    outline: 2px solid #ff8c42;
    outline-offset: 2px;
    border-radius: 15px;
}

/* Enhanced Product Image */
.product-image {
    height: 220px;
    background: linear-gradient(135deg, #ff8c42, #ffa726);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-clickable:hover .product-image img {
    transform: scale(1.05);
}

.no-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff8c42, #ffa726);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    padding: 1rem;
    box-sizing: border-box;
}

/* Product Hover Overlay */
.product-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-clickable:hover .product-hover-overlay {
    opacity: 1;
}

.view-detail-text {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem 1rem;
    border: 2px solid white;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.product-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2;
}

.product-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.badge-new {
    background: rgba(46, 204, 113, 0.9);
    color: white;
}

.badge-popular {
    background: rgba(231, 76, 60, 0.9);
    color: white;
}

.badge-featured {
    background: rgba(52, 152, 219, 0.9);
    color: white;
}

.badge-low-stock {
    background: rgba(243, 156, 18, 0.9);
    color: white;
}

/* Enhanced Product Content */
.product-content {
    padding: 1.5rem 1.5rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.clickable-title {
    transition: color 0.3s ease;
}

.product-clickable:hover .clickable-title {
    color: #ff8c42;
}

.product-id {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.product-feature {
    background: #f8f9fa;
    color: #666;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ff8c42;
    margin-bottom: 0.5rem;
}

.product-stock {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.stock-in-stock {
    color: #27ae60;
}

.stock-out-of-stock {
    color: #e74c3c;
}

/* Enhanced Product Actions */
.product-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem 1.5rem;
    margin-top: auto;
}

.add-to-cart-btn {
    width: 100%;
    background: #ff8c42;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #e67e22;
    transform: translateY(-1px);
}

.add-to-cart-btn:disabled {
    background: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

/* Fast Button States */
.fast-add-btn.adding {
    background: #f39c12;
    transform: none;
}

.fast-add-btn.success {
    background: #27ae60;
    transform: none;
}

.fast-add-btn.error {
    background: #e74c3c;
    transform: none;
}

/* Navigation Feedback */
.navigation-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 10001;
    transform: translate(-50%, -50%);
    background: rgba(255, 140, 66, 0.95);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 200px;
}

.navigation-spinner {
    margin-bottom: 8px;
}

.navigation-spinner div {
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-radius: 50%;
    border-top: 2px solid transparent;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Fast Product Message */
.fast-product-message {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    background: #ff8c42;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.2s ease;
}

.fast-product-message.success {
    background: #27ae60;
}

.fast-product-message.error {
    background: #e74c3c;
}

.fast-product-message.warning {
    background: #f39c12;
}

.fast-product-message.show {
    transform: translateX(0);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.no-results p {
    font-size: 1rem;
    color: #666;
}

/* Sidebar Overlay for Mobile */
.filters-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filters-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #ff8c42;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter Animation */
.filter-animation {
    animation: filterFade 0.5s ease;
}

@keyframes filterFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 1400px) {
    .products-layout {
        max-width: 1400px;
        padding: 0 1.5rem;
    }
}

@media (max-width: 1200px) {
    .products-layout {
        grid-template-columns: 300px 1fr;
        gap: 2rem;
        padding: 0 1.5rem;
    }
    
    .products-section .container {
        max-width: 1200px;
        padding: 0 1.5rem;
    }
}

@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .filters-sidebar {
        position: sticky;
        top: 100px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .products-section .container {
        max-width: 1024px;
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .products-section {
        padding: 100px 0 40px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .products-layout {
        display: block;
        padding: 0 1rem;
    }
    
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 320px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        border-radius: 0;
        border: none;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }
    
    .filters-sidebar.mobile-open {
        left: 0;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .mobile-filter-bar {
        display: block;
    }
    
    .products-main {
        width: 100%;
    }
    
    .results-info {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        margin-bottom: 1.5rem;
        padding: 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-content {
        padding: 1.25rem;
    }
    
    .filters-sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 480px) {
    .products-layout {
        padding: 0 0.5rem;
    }
    
    .filters-sidebar {
        width: 100%;
        left: -100%;
    }
    
    .filters-sidebar.mobile-open {
        left: 0;
    }
    
    .results-info {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .mobile-filters-toggle {
        width: 45px;
        height: 45px;
        padding: 10px;
    }
    
    .mobile-filters-toggle svg {
        width: 18px;
        height: 18px;
    }
    
    .mobile-filter-bar {
        bottom: 1.5rem;
        left: 0.75rem;
    }
    
    .filter-group-header {
        padding: 0.875rem 1rem;
    }
    
    .filter-group-title {
        font-size: 0.9rem;
        gap: 0.5rem;
    }
    
    .filter-icon {
        font-size: 1rem;
    }
    
    .filter-options.expanded {
        padding: 0.75rem 1rem 1rem;
        max-height: 250px;
    }
    
    .search-bar {
        margin: 0 0.5rem;
    }
    
    .add-to-cart-btn {
        padding: 14px 20px;
        font-size: 0.9rem;
    }
}

@media (min-width: 769px) {
    .mobile-filter-bar {
        display: none !important;
    }
    
    .sidebar-close {
        display: none !important;
    }
    
    .filters-sidebar {
        position: sticky !important;
        left: auto !important;
    }
    
    .filters-sidebar-overlay {
        display: none !important;
    }
}