/* ==========================================
   CATEGORIES PAGE - COMPLETE STYLES
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.page-container {
    max-width: 1440px;
    margin: 0 auto;
    /* padding: 20px; */
}

/* ==========================================
   LOADING STATE
   ========================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}
    
/* ==========================================
   BREADCRUMB
   ========================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    /* margin-bottom: 25px; */
    padding: 12px 0;
    color: #666;
    font-size: 14px;
    flex-wrap: wrap;
}

.breadcrumb a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #2980b9;
}

.breadcrumb i {
    font-size: 10px;
    color: #999;
}

/* ==========================================
   PAGE HEADER
   ========================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e0e0e0;
}

.header-content {
    flex: 1;
}

.page-title {
    display: none;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 700;
}

.products-count {
    display: none;
    color: #666;
    font-size: 0.95rem;
}

.products-count strong {
    color: #3498db;
    font-size: 1.1em;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 10px;
}

.mobile-filter-toggle,
.mobile-sort-toggle {
  display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-height: 44px;
}

.mobile-filter-toggle:active,
.mobile-sort-toggle:active {
    transform: scale(0.98);
    background: #2980b9;
}

/* ==========================================
   CONTENT LAYOUT
   ========================================== */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* ==========================================
   FILTERS SIDEBAR (MOBILE OVERLAY)
   ========================================== */

.filters-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    background: white;
    z-index: 1001;
    overflow-y: auto;
    transition: left 0.3s ease-in-out;
    padding: 20px;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.filters-sidebar.active {
    left: 0;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.filter-header h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
}

.close-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.close-filters:active {
    background: #e0e0e0;
    color: #2c3e50;
    transform: scale(0.95);
}

.close-filters i {
    font-size: 18px;
}

/* Filter Section */
.filter-section {
    /* margin-bottom: 5px; */
    margin-bottom: 20px;
}

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

.filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.filter-title i {
    color: #3498db;
}

/* Search Box */
.search-form {
    position: relative;
}

.search-box {
    position: relative;
    /* width: 100%; */
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 99999px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:active {
    background: #2980b9;
    transform: translateY(-50%) scale(0.95);
}

/* Active Filters */
.active-filters {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
}

.filter-tag:active {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.filter-tag i {
    font-size: 10px;
}

.clear-all-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3498db;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.3s;
}

.clear-all-filters:active {
    color: #2980b9;
}

/* Filter Options */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
    min-height: 44px;
}

.filter-option:active {
    background: #f8f9fa;
    border-color: #3498db;
}

.filter-option.active {
    background: #e3f2fd;
    border-color: #3498db;
    color: #3498db;
    font-weight: 600;
}

.filter-icon {
    width: 20px;
    text-align: center;
    color: #999;
}

.filter-option.active .filter-icon {
    color: #3498db;
}

.filter-label {
    flex: 1;
}

.filter-count {
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Filter Overlay */
.filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.filter-overlay.active {
    display: block;
    opacity: 1;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 15px;
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
}

.results-info i {
    color: #3498db;
}

.results-info strong {
    color: #2c3e50;
    font-size: 1.1em;
}

/* Sort Options (Mobile Bottom Sheet) */
.sort-options {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 20px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 999;
    border-radius: 20px 20px 0 0;
    flex-direction: column;
    gap: 12px;
}

.sort-options.active {
    display: flex;
}

.sort-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
}

.sort-options select {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    background: white url('data:image/svg+xml;utf8,<svg fill="%23666" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 12px center;
    background-size: 20px;
    appearance: none;
    transition: all 0.3s;
}


.sort-options select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* View Toggle - Hidden on Mobile */
.view-toggle {
    display: none;
}

/* .view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
}

.view-btn:hover {
    color: #3498db;
}

.view-btn.active {
    background: white;
    color: #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
} */

/* ==========================================
   PRODUCTS GRID
   ========================================== */

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}


.product-card {
    background: white;
    border: 1px solid #d1d1d1;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #3498db;
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Product Image */
.product-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 5px 12px;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

/* .product-card:hover .product-image {
    transform: scale(1.08);
} */

.no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #ccc;
}

.no-image i {
    font-size: 48px;
}

.no-image span {
    font-size: 14px;
}

/* Quick View Button - Hidden on Mobile*/
.quick-view-btn {
    display: none;
}

/* Product Info */
.product-info {
    /* padding: 0 15px 12px; */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    display: none;
    align-self: flex-start;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.product-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.4;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-summary {
    display: none;
}


/* Product Rating */
.product-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.stars {
    display: flex;
    gap: 2px;
    color: #ffc107;
}

.stars i {
    font-size: 12px;
}

.rating-text {
    font-size: 11px;
    color: #999;
}

/* Product Price */
.product-price {
    text-align: center;
    margin-bottom: 8px;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Stock Status */
.stock-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.stock-status.in-stock {
    color: #27ae60;
}

.stock-status.low-stock {
    color: #f39c12;
}

.stock-status.out-of-stock {
    color: #e74c3c;
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #f0f0f0;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px;
}

.btn-primary {
    flex: 1;
    background: #3498db;
    color: white;
}

.btn-primary:active:not(:disabled) {
    background: #2980b9;
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    flex: 0 0 auto;
    padding: 12px 15px;
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-secondary:active {
    background: #d5dbdb;
    transform: scale(0.95);
}

.wishlist-btn.active {
    background: #e74c3c;
    color: white;
}

/* ==========================================
   LIST VIEW
   ========================================== */

/* .products-list .product-card {
    flex-direction: row;
    height: auto;
}

.products-list .product-image-container {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.products-list .product-link {
    flex-direction: row;
}

.products-list .product-info {
    flex: 1;
}

.products-list .product-actions {
    flex-direction: column;
    width: 150px;
    border-top: none;
    border-left: 1px solid #f0f0f0;
} */

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
    margin-bottom: 20px;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
/* Small phones */
@media (min-width: 480px) {
    .page-container {
        padding: 10px;
    }

    .breadcrumb {
        font-size: 12px;
    }

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

    .main-content {
        padding: 15px;
    }

    .product-card {
        padding: 0;
    }

    .product-info {
        padding: 0 12px;
    }

    .product-actions {
        padding: 12px;
    }

    .btn {
        font-size: 0.85rem;
        padding: 10px;
    }

    .product-image-container{
        height: 200px;
    }
}


/* ==========================================
   TABLET RESPONSIVE (768px+)
   ========================================== */
@media (min-width: 768px) {
    .page-container {
        padding: 15px;
    }

    .breadcrumb {
        font-size: 14px;
    }

    .page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 20px;
    }

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

    .header-actions {
        width: auto;
    }

    .mobile-filter-toggle,
    .mobile-sort-toggle {
        flex: 0 0 auto;
        min-width: 120px;
    }

    .main-content {
        padding: 20px;
    }

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

    .product-image-container {
        height: 180px;
    }

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

    .search-form {
    display: flex;
    width: 100% !important;
}
}


/* Tablets */
@media (min-width: 769px) and (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .product-image-container{
        height: 150px;
    }
}



/* ==========================================
   DESKTOP RESPONSIVE (992px+)
   ========================================== */
@media (min-width: 992px) {
    .page-container {
        padding: 20px;
    }

    /* Hide mobile buttons */
    .mobile-filter-toggle,
    .mobile-sort-toggle {
        display: none;
    }

    /* Show sidebar inline */
    .content-wrapper {
        grid-template-columns: 280px 1fr;
        gap: 25px;
    }

    .filters-sidebar {
        position: sticky;
        top: 90px;
        left: 0;
        width: 100%;
        max-width: none;
        height: fit-content;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        transition: none;
    }

    .filter-header {
        display: none;
    }

    .close-filters {
        display: none;
    }

    .filter-overlay {
        display: none !important;
    }

    /* Toolbar adjustments */
    .toolbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 20px;
        margin-bottom: 25px;
    }

    .sort-options {
        display: flex;
        position: static;
        width: auto;
        flex-direction: row;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        gap: 10px;
    }

    .sort-options select {
        width: auto;
        min-width: 200px;
    }

    .view-toggle {
        display: flex;
        gap: 5px;
        background: #f0f0f0;
        padding: 4px;
        border-radius: 8px;
    }

    .view-btn {
        padding: 8px 12px;
        background: transparent;
        border: none;
        color: #666;
        cursor: pointer;
        border-radius: 6px;
        transition: all 0.3s;
    }

    .view-btn:hover {
        color: #3498db;
    }

    .view-btn.active {
        background: white;
        color: #3498db;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

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

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }

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

    .product-image-container {
        height: 200px;
    }

    /* Show quick view on hover */
    .quick-view-btn {
        display: flex;
        position: absolute;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        background: rgba(52, 152, 219, 0.95);
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
        opacity: 0;
        transition: all 0.3s;
        align-items: center;
        gap: 6px;
    }

    .product-card:hover .quick-view-btn {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .product-summary {
        display: -webkit-box;
        font-size: 0.85rem;
        color: #666;
        margin-bottom: 12px;
        line-height: 1.4;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-name {
        text-align: left;
    }

    .product-rating {
        justify-content: flex-start;
    }

    .product-price {
        text-align: left;
    }

    .stock-status {
        justify-content: flex-start;
    }

    .btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .btn-primary:hover:not(:disabled) {
        background: #2980b9;
    }

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

    /* List view styles */
    .products-list .product-card {
        flex-direction: row;
    }

    .products-list .product-image-container {
        width: 200px;
        flex-shrink: 0;
    }

    .products-list .product-link {
        flex-direction: row;
    }

    .products-list .product-info {
        flex: 1;
    }

    .products-list .product-actions {
        flex-direction: column;
        width: 150px;
        border-top: none;
        border-left: 1px solid #f0f0f0;
    }
}


/* ==========================================
   LARGE DESKTOP (1200px+)
   ========================================== */
@media (min-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 300px 1fr;
        gap: 30px;
    }

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

    .main-content {
        padding: 25px;
    }
}