/* Product Image Styling for Consistency */
.image-container {
    width: 100%;
    height: 300px; /* Set a consistent height */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    background-color: var(--secondary-color);
    color: var(--text-color);
    text-align: center; /* Center-aligns the text within the card */
    margin-bottom: 20px;
    height: 100%; /* Ensure cards take full height of their container */
    display: flex;
    flex-direction: column;
}

.card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow card body to fill available space */
    justify-content: space-between; /* Distribute content evenly */
}

.product-item {
    margin-bottom: 30px; /* Add consistent margin between products */
}

.product-rating {
    min-height: 24px; /* Ensure consistent space for rating stars */
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image maintains its aspect ratio without distortion */
    transition: transform 0.3s ease;
}

/* Optional: Hover effect for a polished look */
.product-image:hover {
    transform: scale(1.05); /* Slight zoom on hover */
}

/* Price display with discount */
.price-container {
    min-height: 24px; /* Ensure consistent height for price area */
}

/* Card title consistency */
.card-title {
    min-height: 48px; /* Set minimum height for card titles */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}
/* Category tiles show real product photos; the entire tile is the link. */
.subcategory-card{display:block;height:100%;overflow:hidden;border:1px solid var(--market-line);border-radius:12px;text-decoration:none;color:var(--text-color);background:var(--card-bg);transition:border-color .2s,box-shadow .2s}
.subcategory-card:hover{border-color:var(--market-blue);box-shadow:0 4px 16px #075bfa12;color:var(--text-color)}
.subcategory-preview{aspect-ratio:1.6;background:var(--market-panel);overflow:hidden}
.subcategory-preview img{display:block;width:100%;height:100%;object-fit:contain;padding:12px}
.subcategory-caption{padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.subcategory-caption h3{font-size:18px;font-weight:600;margin:0;letter-spacing:0}
.subcategory-caption>span{font-size:12px;color:var(--market-muted)}
.subcategory-placeholder{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:var(--market-muted);font-size:13px}
.subcategory-placeholder i{font-size:36px}

.catalog-page{max-width:1800px;padding-left:32px;padding-right:32px}
.catalog-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:28px;align-items:start;direction:ltr}
.catalog-layout.has-subcategory-nav{grid-template-columns:235px minmax(0,1fr)}
.catalog-results{min-width:0}
.catalog-sidebar{position:sticky;top:18px;border:1px solid var(--market-line);border-radius:12px;background:var(--market-panel);padding:20px 12px}
.catalog-sidebar h2{font-size:20px;margin:0 8px 8px;font-weight:650}
.catalog-sidebar-label{font-size:12px;color:var(--market-muted);margin:0 8px 14px}
.catalog-sidebar nav{display:flex;flex-direction:column;gap:5px}
.catalog-sidebar a{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px;border-radius:7px;color:var(--text-color);text-decoration:none;font-size:13px}
.catalog-sidebar a:hover{background:var(--card-bg);color:var(--market-blue)}
.catalog-sidebar a[aria-current=page]{background:var(--card-bg);color:var(--market-blue);box-shadow:inset 3px 0 var(--market-blue);font-weight:600}
.catalog-child-name{flex:1;min-width:0}.catalog-sidebar small{color:var(--market-muted);font-size:11px;margin-left:auto}.catalog-sidebar-empty{font-size:12px;margin:8px;color:var(--market-muted)}
.catalog-sidebar .subcategory-preview{width:44px;height:44px;flex:0 0 44px;border-radius:6px;display:grid;place-items:center;background:var(--card-bg);aspect-ratio:1}
.catalog-sidebar .subcategory-preview img{padding:0;width:44px;height:44px;object-fit:contain}
.catalog-results #products-container{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;margin:0}
.catalog-results #products-container>.product-item{width:auto;max-width:none;padding:0;margin:0;min-width:0}
.catalog-results #products-container>.col-12:not(.product-item){grid-column:1/-1}
.catalog-results .image-container{height:230px}.catalog-results .product-image{object-fit:contain}
@media(min-width:1500px){.catalog-results #products-container{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1100px){.catalog-layout.has-subcategory-nav{grid-template-columns:210px minmax(0,1fr);gap:20px}.catalog-results #products-container{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.catalog-page{padding-left:14px;padding-right:14px}.catalog-layout.has-subcategory-nav{grid-template-columns:130px minmax(0,1fr);gap:12px}.catalog-sidebar{padding:12px 5px}.catalog-sidebar h2{font-size:15px;margin-left:5px}.catalog-sidebar-label{font-size:11px;margin-left:5px}.catalog-sidebar a{font-size:12px;padding:8px 5px;gap:5px}.catalog-sidebar .subcategory-preview{display:none}.catalog-results #products-container{grid-template-columns:minmax(0,1fr);gap:16px}.catalog-results .image-container{height:180px}.catalog-results .card-body{padding:12px}.catalog-results .card-title{font-size:16px}.catalog-results .price-container{font-size:13px}.catalog-results .card-body>.d-flex{flex-wrap:wrap;gap:8px}}
