/* ============================================
   MODERN PRODUCTS PAGE
   Mobile-First Responsive Design
   ============================================ */

/* Breadcrumb Bar */
.breadcrumb-bar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: #6b7280;
}

.breadcrumb-item a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--color-primary, #652d2c);
}

.breadcrumb-item.active {
    color: #1f2937;
    font-weight: 500;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "/";
    margin: 0 0.5rem;
    color: #d1d5db;
}

/* Main Layout */
.products-page {
    background: #f9fafb;
    min-height: calc(100vh - 70px);
    padding: 1.5rem 0;
}

.products-layout {
    display: block;
    /* Removed grid sidebar layout */
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* Helper for Full Width Filter Bar */
.top-filter-bar {
    background: #fff;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
    position: sticky;
    top: 60px;
    /* Below navbar */
    z-index: 99;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* ============================================
   FILTERS SIDEBAR
   ============================================ */
/* Sidebar is now hidden/optional or used for mobile drawer */
.filters-sidebar {
    display: none;
    /* Hide desktop sidebar for compact view */
}

.filters-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.clear-filters-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.clear-filters-btn:hover {
    background: #fee2e2;
}

.filters-content {
    padding: 1.25rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 0.875rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.filter-search-input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.filter-search-input:focus {
    outline: none;
    border-color: var(--color-primary, #652d2c);
    box-shadow: 0 0 0 3px rgba(101, 45, 44, 0.1);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-checkbox:hover {
    background: #f3f4f6;
}

.filter-checkbox input[type="radio"],
.filter-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--color-primary, #652d2c);
}

.filter-checkbox span {
    font-size: 0.875rem;
    color: #374151;
}

/* ============================================
   PRODUCTS MAIN CONTENT
   ============================================ */
.products-main {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.products-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    flex: 1;
    min-width: 200px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.375rem 0;
}

.products-count {
    font-size: 0.875rem;
    color: #6b7280;
}

.count-number {
    font-weight: 600;
    color: var(--color-primary, #652d2c);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 8px;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.view-btn.active {
    background: #ffffff;
    color: var(--color-primary, #652d2c);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Sort Dropdown */
.sort-dropdown {
    position: relative;
}

.sort-select {
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background: #ffffff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 1.25rem;
    transition: all 0.2s;
}

.sort-select:hover {
    border-color: var(--color-primary, #652d2c);
}

.sort-select:focus {
    outline: none;
    border-color: var(--color-primary, #652d2c);
    box-shadow: 0 0 0 3px rgba(101, 45, 44, 0.1);
}

/* Mobile Filter Button */
.mobile-filter-btn {
    display: none;
    padding: 0.625rem 1rem;
    background: var(--color-primary, #652d2c);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.mobile-filter-btn:hover {
    background: #4a1f1e;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    /* Fallback for tablets */
    gap: 1.5rem;
    /* Restored larger gap for cleaner look */
    padding: 0 1rem 1.5rem 1rem;
}

@media (min-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        /* Force 4 columns on desktop */
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Force 2 columns mobile */
        gap: 0.75rem;
        padding: 0.75rem;
    }
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

.products-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
}

.products-grid.list-view .product-image-wrapper {
    padding-bottom: 133.33%;
    /* 3:4 ratio */
}

.products-grid.list-view .product-specs {
    display: flex;
}

/* Product Card */
.product-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.product-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.product-image-wrapper {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 133.33% !important;
    /* 4/3 * 100 = 133.33% for 3:4 ratio */
    overflow: hidden !important;
    background: #f9fafb;
}

.product-image-link {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

.product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.3s ease;
}

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

/* Wishlist Button */
.wishlist-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.125rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* Prevent badges from appearing inside product card wishlist buttons */
.product-card .wishlist-btn .action-badge,
.product-card .wishlist-btn .wishlist-badge,
.product-card .wishlist-btn span {
    display: none !important;
}

.wishlist-btn:hover {
    background: #ef4444;
    color: #ffffff;
    transform: scale(1.1);
}

.wishlist-btn.active {
    background: #ef4444;
    color: #ffffff;
}

/* Product Badges */
.product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    z-index: 10;
}

.product-badge.featured {
    background: #10b981;
    color: #ffffff;
}

.product-badge.discount {
    background: #ef4444;
    color: #ffffff;
    top: 3rem;
}

/* Product Info */
.product-info {
    padding: 1rem;
}

.product-category {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.product-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s;
}

.product-name a:hover {
    color: var(--color-primary, #652d2c);
}

/* Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.625rem;
}

.rating-value {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #10b981;
    color: #ffffff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rating-count {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Price */
.product-price-section {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.product-mrp {
    font-size: 0.875rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.product-price-section .tax-note {
    width: 100%;
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: -0.5rem;
}

/* Specs */
.product-specs {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
    background: #f3f4f6;
    border-radius: 4px;
}

/* Add to Cart Button */
.add-to-cart-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--color-primary, #652d2c);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.add-to-cart-btn:hover {
    background: #4a1f1e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(101, 45, 44, 0.3);
}

.add-to-cart-btn.out-of-stock {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

.add-to-cart-btn.out-of-stock:hover {
    transform: none;
    box-shadow: none;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary, #652d2c);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #4a1f1e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(101, 45, 44, 0.3);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-nav {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-item {
    display: flex;
}

.page-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.page-link:hover {
    background: #f3f4f6;
    border-color: var(--color-primary, #652d2c);
    color: var(--color-primary, #652d2c);
}

.page-item.active .page-link {
    background: var(--color-primary, #652d2c);
    border-color: var(--color-primary, #652d2c);
    color: #ffffff;
}

.page-item.disabled .page-link {
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.page-item.disabled .page-link:hover {
    background: transparent;
}

/* ============================================
   MOBILE FILTER BOTTOM SHEET
   ============================================ */
.mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-filter-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    z-index: 1050;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-filter-sheet.active {
    transform: translateY(0);
}

.mobile-filter-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-filter-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.mobile-filter-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.mobile-filter-group {
    margin-bottom: 1.5rem;
}

.mobile-filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.mobile-filter-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
}

.btn-secondary {
    flex: 1;
    padding: 0.875rem;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #ffffff;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification.success {
    border-left: 4px solid #10b981;
}

.toast-notification.error {
    border-left: 4px solid #ef4444;
}

.toast-notification i {
    font-size: 1.5rem;
}

.toast-notification.success i {
    color: #10b981;
}

.toast-notification.error i {
    color: #ef4444;
}

.toast-notification span {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1f2937;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        display: none;
    }

    .mobile-filter-btn {
        display: flex;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    .products-page {
        padding: 1rem 0;
    }

    .products-layout {
        padding: 0 0.75rem;
    }

    .products-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .header-left {
        width: 100%;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .view-toggle {
        order: 2;
    }

    .sort-dropdown {
        flex: 1;
        order: 1;
    }

    .sort-select {
        width: 100%;
    }

    .mobile-filter-btn {
        order: 3;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 1rem 0.75rem;
    }

    .products-grid.list-view {
        grid-template-columns: 1fr;
    }

    .products-grid.list-view .product-card {
        grid-template-columns: 120px 1fr;
        gap: 0.875rem;
    }

    .products-grid.list-view .product-image-wrapper {
        padding-bottom: 133.33%;
        /* 3:4 ratio */
    }

    .product-info {
        padding: 0.75rem;
    }

    .product-name {
        font-size: 0.875rem;
    }

    .product-price {
        font-size: 1.125rem;
    }

    .add-to-cart-btn {
        padding: 0.625rem;
        font-size: 0.8125rem;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .page-link {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }

    .toast-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .page-title {
        font-size: 1.25rem;
    }

    .products-grid {
        gap: 0.5rem;
        padding: 0.75rem 0.5rem;
    }

    .product-card {
        border-radius: 8px;
    }

    .product-info {
        padding: 0.625rem;
    }

    .wishlist-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .product-badge {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Subcategory Chips */
.subcategory-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0 0.5rem;
    width: 100%;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    font-size: 0.875rem;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.chip:hover {
    border-color: var(--color-primary, #652d2c);
    color: var(--color-primary, #652d2c);
    background: #fdf2f2;
}

.chip.active {
    background: var(--color-primary, #652d2c);
    color: #ffffff;
    border-color: var(--color-primary, #652d2c);
}