/* ============================================
   Product Categories Layout
   ============================================ */
.product-category-page {
    padding: 30px 0;
    background: #fafafa;
}

.breadcrumbs {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
    text-align: left;
}

.breadcrumbs a {
    color: #666;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .current {
    color: #333;
    font-weight: 500;
}

.category-page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #222;
    text-align: left;
}

.category-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    text-align: left;
}

/* Sidebar Filters */
.category-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-block {
    background: #fff;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.filter-block h3.filter-header {
    font-size: 16px;
    font-weight: 700;
    padding: 20px;
    border-bottom: 1px dashed #eaeaea;
    margin: 0;
}

.sidebar-block.list-block,
.sidebar-block.search-brands {
    padding: 20px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
}

.sidebar-block .block-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-section {
    border-bottom: 1px dotted #eaeaea;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-title {
    padding: 18px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
}

.filter-title i {
    font-size: 10px;
    color: #999;
}

.filter-content {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    margin-bottom: 0px;
}

.custom-checkbox input {
    margin-right: 12px;
    accent-color: var(--primary);
}

.custom-checkbox .text {
    flex: 1;
    margin-top: 2px;
}

.custom-checkbox .count {
    color: #999;
    font-size: 12px;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

.custom-filter-link:hover .text {
    color: var(--primary);
}

.media-tags-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.media-tag {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}

.media-tag:hover {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    outline: none;
}

.price-links a {
    font-size: 13px;
    color: #555;
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    text-decoration: none;
}

.price-links a:hover {
    color: var(--primary);
}

.price-links .count {
    color: #999;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.brand-search-box {
    position: relative;
}

.brand-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 13px;
}

.brand-search-box input {
    width: 100%;
    padding: 12px 12px 12px 35px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border 0.3s;
}

.brand-search-box input:focus {
    border-color: var(--primary);
}

.empty-msg {
    font-size: 13px;
    color: #888;
    margin: 0;
    line-height: 1.5;
}

/* Main Content Area */
.category-main-content {
    flex: 1;
    min-width: 0;
}

/* Subcategories Grid */
.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.subcat-item {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
}

.subcat-item:hover,
.subcat-item.active-subcat {
    border-color: var(--primary-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.subcat-img {
    height: 140px;
    background: #e2e2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.subcat-img img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.subcat-item span {
    font-size: 13px;
    font-weight: 600;
    padding: 12px 10px;
}

.placeholder-icon {
    font-size: 32px;
    color: #ccc;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #555;
}

.view-mode {
    display: flex;
    gap: 5px;
}

.view-mode button {
    background: #f5f5f5;
    border: none;
    font-size: 14px;
    color: #888;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 4px;
    transition: 0.2s;
}

.view-mode button.active {
    background: var(--primary);
    color: #fff;
}

.view-mode button:hover:not(.active) {
    background: #e0e0e0;
}

.sort-select,
.per-page-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.sort-direction {
    background: none;
    border: none;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

/* Product Grid */
.custom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.product-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.3s;
    border: 1px solid #eaeaea;
    display: flex;
    flex-direction: column;
}

.product-item:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.product-image {
    position: relative;
    margin-bottom: 15px;
    height: 220px;
    /* Slightly taller */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.product-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    mix-blend-mode: normal;
}

.btn-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
}

.btn-wishlist:hover {
    color: #e53935;
    transform: scale(1.1);
}

.btn-add-cart {
    position: absolute;
    bottom: 15px;
    /* Brought inside the image frame */
    right: 15px;
    background: var(--primary);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.3s;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(6, 66, 89, 0.3);
}

.btn-add-cart:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.product-info {
    text-align: left;
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-price {
    font-size: 16px;
    color: #222;
    font-weight: 800;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 0px;
}

.price-label {
    font-size: 12px;
    color: #777;
    font-weight: 500;
    order: 0;
}

.old-price,
.product-price del {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    font-weight: 500;
    order: 2;
}

.product-price ins {
    text-decoration: none;
    color: var(--primary);
    order: 1;
}

.product-price>.woocommerce-Price-amount:not(del):not(ins) {
    order: 1;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .custom-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .subcategories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) {
    .category-layout {
        flex-direction: column;
    }

    .category-sidebar {
        width: 100%;
    }

    .sidebar-block {
        max-width: 100%;
    }

    .subcategories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .subcategories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .custom-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
}