/**
 * Haryana Tools - Industrial Theme
 * Master stylesheet for production-ready e-commerce catalog, blog, and product details.
 */

:root {
    --primary: #1e293b;
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --dark-bg: #212529;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

/* Header & Navbar Branding */
header {
    background-color: var(--primary);
    color: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo, .navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff !important;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #ffffff;
}

/* Page Layout & Container Constraints */
#main-content {
    min-height: 80vh;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    max-width: 100%; /* Ensures it spans the screen width properly */
    margin: 2rem auto;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Filters */
aside#sidebar-filters, .sidebar-filters {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    height: fit-content;
}

aside h3, .sidebar-filters h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.filter-group select, .filter-group input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
}

.search-box {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    background: #fff;
}

/* Product Section & Grid Container */
#category-products {
    width: 100%;
    min-width: 0; /* Prevents grid items from overflowing or forcing wrap */
}

#category-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.grid-container {
    display: grid;
    /* Reduced minmax size to 180px so more cards comfortably fit side by side */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 1.25rem;
    width: 100%;
}

.card, .product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
   
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.card:hover, .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.product-img-container, .product-img-wrapper {
    width: 100%;
    height: 180px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-img-container img, .product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.card-title, .product-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.sku-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
}



.main-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 450px;
    display: block;
}

/* Blog Grid & Cards */
.blog-grid, .content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto 12 auto;
}

.blog-post-card, .content-grid > div {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.blog-img-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f5f5f5;
}

.blog-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-post-card:hover .blog-thumb {
    transform: scale(1.05);
}

.blog-content-wrapper {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-category-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.post-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 15px;
}

/* Sponsored & Google Ads Integration */
.sponsored-card {
    background: #f9f9f9;
    border: 1px dashed #ccd5db;
    padding: 16px;
    justify-content: center;
    align-items: center;
}

.badge-sponsored {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    margin-bottom: 8px;
    align-self: flex-start;
}

/* Footer Section */
footer {
    background-color: var(--primary);
    color: #94a3b8;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    font-size: 0.9rem;
}

/* Responsive Layout Breakpoints */
@media (max-width: 992px) {
    .content-grid, .blog-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 576px) {
    .content-grid, .blog-grid {
        grid-template-columns: 1fr;
    }
}

main.container{
    max-width:1600px !important;
    width:100% !important;
}


/* Force strict image sizing on product cards */
.grid-container .card img, 
.grid-container .product-card img,
.product-img-container img, 
.product-img-wrapper img {
    width: auto !important;
    max-width: 100% !important;
    height: 140px !important; /* Makes images compact and neat */
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Ensure the product card height is uniform and compact */
.grid-container .card, 
.grid-container .product-card {
    height: 280px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}