/* categories.php - Categories Page */
:root {
    --primary-blue: #f57c00;
    --border-color: #e9ecef;
    --text-dark: #333;
    --text-muted: #6c757d;
    --success-green: #28a745;
    --danger-red: #dc3545;
    --warning-yellow: #ffc107;
}

.categories-page {
    padding: 24px 20px 60px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.categories-row {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.categories-row > [class*="col-"] {
    box-sizing: border-box;
}

/* Sidebar - same design as list_of_product */
.sidebar-filters {
    padding-right: 24px;
    position: sticky;
    top: 100px;
}

.sidebar-filters-inner {
    background: linear-gradient(180deg, #ffffff 0%, #fff8e1 100%);
    border: 1px solid #ffe0b2;
    border-radius: 14px;
    padding: 18px 0;
    box-shadow: 0 2px 8px rgba(245, 124, 0, 0.06);
    animation: categoriesSidebarFadeIn 0.3s ease;
}

@keyframes categoriesSidebarFadeIn {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: translateX(0); }
}

.filter-section {
    margin-bottom: 20px;
    padding: 12px 16px 16px;
    border-bottom: 1px solid #ffe0b2;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    margin-left: 8px;
    margin-right: 8px;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.filter-section:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 6px rgba(245, 124, 0, 0.08);
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #ffe0b2;
}

/* Categories List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 8px;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.25s ease, color 0.2s, padding-left 0.2s, transform 0.2s ease;
}

.category-link:hover {
    color: #e65100;
    background: rgba(255, 245, 235, 0.9);
    padding-left: 20px;
    transform: translateX(2px);
}

.category-link i {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.subcategory-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 20px;
    display: none;
}

.subcategory-list li {
    margin-bottom: 5px;
}

.subcategory-list a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.subcategory-list a:hover {
    color: var(--primary-blue);
}

/* Price Range */
.price-range-container {
    padding: 10px 0;
}

.price-slider-wrapper {
    position: relative;
    height: 40px;
    margin-bottom: 15px;
}

.price-slider {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-blue);
    border-radius: 50%;
    cursor: pointer;
}

.price-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-blue);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-apply-filter {
    width: 100%;
    padding: 10px;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-apply-filter:hover {
    background: #e65100;
    transform: translateY(-1px);
}

/* Brand Filters */
.brand-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brand-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.brand-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Color Filters */
.color-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch-filter {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.color-swatch-filter:hover {
    transform: scale(1.1);
}

.color-swatch-filter.active {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(245, 124, 0, 0.2);
}

/* Products Section */
.products-section {
    padding-left: 30px;
    min-width: 0; /* allow grid to shrink inside flex column */
    max-width: 100%;
}

.products-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-products {
    display: flex;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px 0 0 6px;
    outline: none;
}

.search-btn {
    padding: 10px 20px;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}

.control-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 10px 15px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s;
}

.view-btn.active {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

/* Active Filters */
.active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.active-filters-label {
    font-weight: 600;
    color: var(--text-dark);
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-blue);
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
}

.filter-tag i {
    cursor: pointer;
    font-size: 0.75rem;
}

.clear-all {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.clear-all:hover {
    text-decoration: underline;
}

/* Products Grid - same as list_of_product (smaller cards) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
    gap: 14px;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

.product-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(245, 124, 0, 0.3);
}

.product-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    z-index: 2;
}

.product-badge.blue {
    background: var(--primary-blue);
    color: #fff;
}

.product-badge.red {
    background: #b12704;
    color: #fff;
}

.product-card .img-wrap {
    background: #f9fafb;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    min-height: 120px;
    overflow: hidden;
    transition: background 0.25s ease;
}

.product-card:hover .img-wrap {
    background: #fff5eb;
}

.product-card .img-wrap img {
    max-height: 100px;
    width: auto;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.product-card:hover .img-wrap img {
    transform: scale(1.05);
}

.product-actions {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.product-action-btn:hover {
    border-color: #f57c00;
    color: #f57c00;
    background: #fff5eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(245, 124, 0, 0.2);
}

.product-action-btn.add-cart-btn {
    background: linear-gradient(180deg, #ffd54f 0%, #f57c00 100%);
    color: #1a1a1a;
    border-color: transparent;
}

.product-action-btn.add-cart-btn:hover {
    color: #1a1a1a;
    background: linear-gradient(180deg, #ffc107 0%, #e65100 100%);
}

.product-action-btn.whatsapp-btn:hover {
    border-color: #25d366;
    color: #25d366;
    background: rgba(37, 211, 102, 0.08);
}

.product-image {
    width: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.product-image img {
    max-height: 100px;
    width: auto;
    object-fit: contain;
}

.product-info {
    padding: 0;
}

.product-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #111827;
    margin: 6px 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.product-card:hover .product-name {
    color: #e65100;
}

.product-price {
    margin-bottom: 6px;
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
}

.old-price {
    font-size: 0.75rem;
    color: #6b7280;
    text-decoration: line-through;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.product-rating i {
    color: #ffc107;
    font-size: 0.75rem;
}

.rating-value {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.product-colors {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

.btn-add-to-cart {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.8rem;
    background: linear-gradient(180deg, #ffd54f 0%, #f57c00 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(245, 124, 0, 0.25);
}

.btn-add-to-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.35);
}

/* List View */
.products-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
}

.products-grid.list-view .product-image,
.products-grid.list-view .img-wrap {
    width: 120px;
    min-height: 100px;
    flex-shrink: 0;
}

.products-grid.list-view .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar-filters {
        padding-right: 0;
        margin-bottom: 24px;
    }

    .products-section {
        padding-left: 0;
    }

    .products-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-products {
        max-width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
        gap: 14px;
    }
}
