/* Products Page Specific Styles */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 6rem 0 4rem;
    margin-top: 80px;
    text-align: center;
}

.page-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb a:hover {
    color: var(--white);
    transform: translateY(-1px);
}

.breadcrumb i {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb span {
    color: var(--white);
    font-weight: 500;
}

/* Products Main Layout */
.products-main {
    padding: 4rem 0;
    background: url(images/main.jpg);
    background-position: center;
    background-size: cover;
    height: fit-content;
}

.products-main .container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sidebar Styles */
.products-sidebar {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideInLeft 0.4s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
}

.sidebar-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-section::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: 1px;
}

.sidebar-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Category List */
.category-list {
    list-style: none;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.category-item:last-child {
    margin-bottom: 0;
}

.category-item:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05), rgba(33, 150, 243, 0.05));
    border-color: rgba(76, 175, 80, 0.2);
    transform: translateX(5px);
}

.category-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    border: none;
}

.category-item.active i {
    color: var(--white);
    transform: scale(1.1);
}

.category-item i {
    color: var(--primary-color);
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.category-item span:first-of-type {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.category-count {
    background: rgba(76, 175, 80, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: var(--transition);
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* Price Filter */
.price-range {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-color);
}

.price-range span:last-child {
    font-weight: 600;
    color: var(--primary-color);
}

.price-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, var(--primary-color), #ddd);
    border-radius: 4px;
    outline: none;
    margin-bottom: 2rem;
    position: relative;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--white);
    cursor: pointer;
    border: 3px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: var(--transition);
}

.price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 15px rgba(0,0,0,0.3);
}

.price-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--white);
    cursor: pointer;
    border: 3px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: var(--transition);
}

.price-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 15px rgba(0,0,0,0.3);
}

.price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.price-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.price-input label {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.price-input input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    font-weight: 500;
    color: var(--dark-color);
    transition: var(--transition);
}

.price-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
    padding: 0.75rem;
    border-radius: 8px;
    transition: var(--transition);
}

.checkbox-label:hover {
    background: rgba(76, 175, 80, 0.05);
    transform: translateX(5px);
}

.checkbox-label input {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid #ddd;
    border-radius: 6px;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkbox-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    animation: checkboxPop 0.3s ease;
}

@keyframes checkboxPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: bold;
}

.checkbox-label span:last-child {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    flex: 1;
}

.btn-filter-apply {
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 10px;
    transition: var(--transition);
}

.btn-filter-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.btn-filter-clear {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 10px;
    transition: var(--transition);
}

.btn-filter-clear:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* Products Content */
.products-content {
    animation: slideInRight 0.4s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.products-info p {
    color: var(--text-light);
    font-size: 1rem;
}

.products-info span {
    color: var(--dark-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.products-sort {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.products-sort label {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
}

.sort-select {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background-color: var(--white);
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 200px;
    font-weight: 500;
    transition: var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234CAF50' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    appearance: none;
    padding-right: 2.5rem;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.sort-select:hover {
    border-color: var(--primary-color);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    position: relative;
    animation: cardFadeIn 0.5s ease backwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--white);
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.product-badge:not(.new):not(.hot) {
    background: linear-gradient(135deg, var(--accent-color), #ff9800);
}

.product-badge.new {
    background: linear-gradient(135deg, var(--secondary-color), #2196f3);
}

.product-badge.hot {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
}

.product-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    color: var(--dark-color);
    font-size: 1rem;
}

.action-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.action-btn.wishlist.active {
    background: #ff4757;
    color: var(--white);
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.product-content {
    padding: 1.75rem;
    background: linear-gradient(to bottom, transparent, rgba(248, 249, 250, 0.3));
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    transition: var(--transition);
}

.product-card:hover .product-title {
    color: var(--primary-color);
}

.product-category {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 500;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stars {
    display: flex;
    gap: 0.15rem;
}

.stars i {
    color: #ffd700;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.rating-value {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.current-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    position: relative;
}

.current-price::before {
    content: 'K';
    font-size: 0.9em;
    font-weight: 600;
}

.old-price {
    font-size: 1.1rem;
    color: var(--text-light);
    text-decoration: line-through;
    font-weight: 500;
}

.unit {
    font-size: 0.9rem;
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-weight: 500;
}

.btn-add-cart {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: var(--dark-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    border-color: var(--primary-color);
}

.btn-add-cart i {
    transition: transform 0.3s ease;
}

.btn-add-cart:hover i {
    transform: translateX(3px) scale(1.1);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(0, 0, 0, 0.05);
}

.pagination-btn {
    width: 45px;
    height: 45px;
    border: 2px solid #e0e0e0;
    background: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: var(--dark-color);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.1);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pagination-number {
    width: 45px;
    height: 45px;
    border: 2px solid #e0e0e0;
    background: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--dark-color);
}

.pagination-number:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination-number.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.pagination-numbers span {
    color: var(--text-light);
    padding: 0 0.5rem;
}

/* No Products State */
.no-products {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease;
}

.no-products i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.no-products h3 {
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.no-products p {
    color: var(--text-light);
    font-size: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

/* Cart Summary in Sidebar */
.cart-summary {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.cart-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

.cart-summary-item:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.cart-summary-item.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

/* Responsive Design for Products Page */
@media (max-width: 1200px) {
    .products-main .container {
        grid-template-columns: 280px 1fr;
        gap: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 991px) {
    .products-main .container {
        grid-template-columns: 1fr;
    }
    
    .products-sidebar {
        position: static;
        order: 2;
        margin-top: 2rem;
    }
    
    .products-content {
        order: 1;
    }
    
    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .sort-select {
        min-width: 100%;
    }
    
    .page-title {
        font-size: 2.75rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 5rem 0 3rem;
    }
    
    .page-title {
        font-size: 2.25rem;
    }
    
    .page-subtitle {
        font-size: 1.1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .product-image {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 4rem 0 2.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination-numbers {
        display: none;
    }
    
    .products-sidebar {
        padding: 1.5rem;
    }
    
    .sidebar-section {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }
    
    .price-inputs {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .products-sidebar {
        background-color: #2c3e50;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .sidebar-title {
        color: var(--dark-color);
    }
    
    .category-item:hover {
        background: rgba(76, 175, 80, 0.1);
        border-color: rgba(76, 175, 80, 0.3);
    }
    
    .checkbox-label span:last-child {
        color: var(--dark-color);
    }
    
    .price-input input {
        background-color: #34495e;
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--dark-color);
    }
    
    .product-card {
        background-color: #2c3e50;
    }
    
    .product-content {
        background: linear-gradient(to bottom, transparent, rgba(44, 62, 80, 0.5));
    }
    
    .product-title {
        color: var(--dark-color);
    }
    
    .btn-add-cart {
        background: linear-gradient(135deg, #34495e, #2c3e50);
        color: var(--dark-color);
    }
    
    .sort-select {
        background-color: #2c3e50;
        color: var(--dark-color);
        border-color: rgba(255, 255, 255, 0.1);
    }
}