/* ===== Styles specific to category_products.php ===== */

/* --- Category Header --- */
.category-header {
    display: flex; align-items: center; gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.5rem; padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}
.category-header i { font-size: 1.8rem; color: var(--accent-1); }
.category-header h2 {
    font-family: var(--font-secondary); font-size: 2rem; margin: 0;
    background: var(--gradient-primary); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}

.price-filter{
    display: flex; align-items: center; gap: 0.5rem;flex-direction: column;width:100%;
}

/* --- Back Link (Top) --- */
.back-to-products-link {
    display: inline-block; margin-bottom: 2rem; color: var(--text-secondary);
    text-decoration: none; font-weight: 500; transition: color 0.2s ease;
}
.back-to-products-link i { margin-right: 0.3rem; }
.back-to-products-link:hover { color: var(--accent-1); text-decoration: none; }

/* --- Category Filters --- */
.category-filters.card {
    padding: 1rem 1.5rem; margin-bottom: 2rem; background: var(--secondary-bg);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 0.5rem; }
.filter-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.price-filter .price-inputs-cat { display: flex; align-items: center; gap: 0.5rem;flex-direction: column; }
.price-filter .price-inputs-cat span { color: var(--text-secondary); }
.filter-group input[type="number"],
.filter-group select {
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color);
    color: var(--text-primary); padding: 0.5rem 0.8rem; border-radius: 6px;
    font-size: 0.9rem; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.filter-group input[type="number"]:focus,
.filter-group select:focus {
    outline: none; border-color: var(--accent-1);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
.price-filter input[type="number"] { width: 80px; -moz-appearance: textfield;appearance: textfield; }
.price-filter input[type="number"]::-webkit-outer-spin-button,
.price-filter input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sort-filter select {
    min-width: 180px; cursor: pointer; appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23b0b0b0'%3E%3Cpath fill-rule='evenodd' d='M8 11.646l-4.854-4.854a.5.5 0 01.708-.708L8 10.232l4.146-4.146a.5.5 0 01.708.708L8 11.646z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.8rem center;
    background-size: 1em 1em; padding-right: 2.5rem;
}
.sort-filter select option { background-color: var(--secondary-bg); color: var(--text-primary); }
.actions-filter { margin-left: auto; flex-direction: row; gap: 0.8rem; }
.category-filters .button {
    padding: 0.6rem 1.2rem; font-size: 0.9rem; border-radius: 6px;
    font-weight: 600; transition: all 0.2s ease;
}
.category-filters .button i { margin-right: 0.4rem; }
.category-filters .button-primary { background: var(--gradient-primary); color: #000; border: none; }
.category-filters .button-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 55, 255, 0.3); }
.category-filters .button-secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); border: 1px solid var(--border-color);text-align: center;text-decoration: none; }
.category-filters .button-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--text-secondary); transform: translateY(-2px); }

/* --- NEW: Brand Filter Styles --- */
.brand-filter {
    width: 100%;
    flex-shrink: 0; /* Prevent shrinking */
}
.brand-filter-list {
    max-height: 150px; /* Limit height */
    overflow-y: auto; /* Add scroll if many brands */
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
/* Custom Scrollbar */
.brand-filter-list::-webkit-scrollbar { width: 6px; }
.brand-filter-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.brand-filter-list::-webkit-scrollbar-thumb { background: var(--accent-1); border-radius: 3px; }

.brand-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}
.brand-checkbox:hover {
    color: var(--text-primary);
}
.brand-checkbox input[type="checkbox"] {
    display: none; /* Hide default checkbox */
}
.brand-checkbox .custom-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.brand-checkbox .custom-checkbox i {
    font-size: 0.7rem;
    color: #fff;
    transform: scale(0);
    transition: transform 0.2s ease;
}
.brand-checkbox input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--accent-1);
    border-color: var(--accent-1);
}
.brand-checkbox input[type="checkbox"]:checked + .custom-checkbox i {
    transform: scale(1);
}
.brand-checkbox input[type="checkbox"]:checked + .custom-checkbox + span {
    color: var(--text-primary);
    font-weight: 500;
}
/* --- End Brand Filter Styles --- */


/* --- Category Products Grid (Updated for 6-Col) --- */
.category-products-grid {
    display: grid;
    /* Mobile-first: 2 columns */
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem; /* Smaller gap for mobile */
    margin-top: 2rem;
    margin-bottom: 3rem;
}
.category-products-grid .card-link {
    text-decoration: none; /* Remove underline from link */
    color: inherit; /* Inherit text color */
    display: block; /* Ensure link takes up space */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.category-products-grid .card-link:hover {
    transform: translateY(-5px); /* Lift card on hover */
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}
.category-products-grid .pentagon-card {
     width: 100%;  margin: 0;
     height: 100%; /* Ensure all cards in a row are same height */
}
/* Ensure product actions are full-width */
.category-products-grid .product-actions {
    display: grid; /* Change to grid */
    grid-template-columns: 1fr; /* Single column */
    gap: 0.5rem;
}
.category-products-grid .action-btn {
    width: 100%; /* Make button full width */
}
/* Hide View Details button if it exists (CSS only) */
.category-products-grid .action-btn.secondary {
    display: none;
}


/* Font overrides for cards in this grid */
.category-products-grid .product-title { font-size: 0.7rem; min-height: 2.4em;max-width:70%;}
.category-products-grid .product-description { font-size: 0.75rem; min-height: 3.6em; }
.category-products-grid .current-price { font-size: 1rem; }
.category-products-grid .original-price { font-size: 0.75rem; }
.category-products-grid .delivery-info { font-size: 0.7rem; }
.category-products-grid .action-btn { font-size: 0.8rem; padding: 0.7rem; }

/* Responsive Grid Breakpoints */
@media (min-width: 480px) {
    .category-products-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
}
@media (min-width: 768px) {
    .category-products-grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
}
@media (min-width: 1024px) {
    .category-products-grid { grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
}
@media (min-width: 1440px) {
    .category-products-grid { grid-template-columns: repeat(6, 1fr); gap: 2rem; }
}
/* --- END GRID --- */


/* --- Responsive for Category Page Filters --- */
@media (max-width: 992px) {
    .filter-row { gap: 1rem; }
    .actions-filter { margin-left: 0; width: 100%; justify-content: flex-start; margin-top: 0.5rem; }
}
@media (max-width: 768px) {
     .category-header h2 { font-size: 1.5rem; }
    .filter-row { flex-direction: column; align-items: stretch; }
    .price-filter input[type="number"] { width: 100px; }
    .sort-filter select { min-width: 0; width: 100%; }
    .actions-filter { flex-direction: row; justify-content: flex-end; width: auto; margin-top: 0; }
    /* .brand-filter-list { max-height: 100px; }  */
}
@media (max-width: 480px) {
    .category-header h2 { font-size: 1.3rem; }
    .back-to-products-link { margin-bottom: 1rem; }
     .actions-filter { flex-direction: column; align-items: stretch; }
     .actions-filter .button { width: 100%; }
     .brand-filter { width: 100%; } /* Make brand filter full width */

     /* Font overrides for smallest screens (2 columns) */
    .category-products-grid .product-title { font-size: 0.7rem; min-height: 2.2em; }
    .category-products-grid .product-description { display: none; }
    .category-products-grid .current-price { font-size: 0.9rem; }
     .category-products-grid .action-btn { font-size: 0.7rem; padding: 0.5rem; }
     .category-products-grid .delivery-info { font-size: 0.6rem; }
}

/* --- No Results Styling --- */
.no-results { text-align: center; padding: 4rem 2rem; }
.no-results-icon { font-size: 4rem; color: var(--text-secondary); margin-bottom: 1rem; }
.no-results h3 { font-family: var(--font-secondary); font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.no-results p { color: var(--text-secondary); margin-bottom: 2rem; }
.no-results .button.button-secondary { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(255, 255, 255, 0.05); color: var(--text-primary); border: 1px solid var(--border-color); padding: 0.8rem 1.5rem; font-size: 0.9rem; font-weight: 600; }
.no-results .button.button-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--text-secondary); transform: translateY(-2px); }
