/* ------------ SHARED CATEGORY STYLES ------------ */

/* Global constraint for product pages */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 30px; /* Safe gutter for desktop */
    width: 100%;
    box-sizing: border-box;
}

/* ------------ CATEGORY HERO ------------ */

.category-hero {
    position: relative;
    height: 35vh;
    min-height: 300px; 
    display: flex;
    align-items: center;
    /* Uses the dark blue variable we created */
    background-color: var(--color-category-hero-bg); 
    overflow: hidden;
}

/* Background image classes kept to prevent HTML errors, but images removed */
.tile-adhesives-bg, 
.tile-grouts-bg, 
.wall-putty-bg, 
.plaster-premix-bg, 
.tile-cleaners-bg {
    background-image: none;
}

.category-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.category-title {
    font-family: var(--font-heading);
    font-size: var(--fs-h1);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-normal);
    /* Uses the light text variable for dark backgrounds */
    color: var(--color-category-hero-heading); 
    text-shadow: none; /* Removed shadow as it's not needed on solid bg */
}

/* ------------ HERO ANCHOR BUTTON (SLEEK & SOLID) ------------ */

/* ------------ HERO ANCHOR BUTTON (LIGHT BLUE THEME) ------------ */

.btn-hero-scroll {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 28px;
    font-family: var(--font-body);
    background-color: var(--color-btn-light-bg); 
    color: var(--color-btn-dark-text);
    text-decoration: none;
    font-size: var(--fs-small); 
    font-weight: var(--fw-bold); /* Bolded for better readability on light bg */
    letter-spacing: var(--ls-wide);
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid var(--color-btn-light-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-hero-scroll:hover {
    background-color: #BAE6FD; /* Slightly darker light blue on hover */
    color: #075985;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(125, 211, 252, 0.3); /* Blue tinted shadow */
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* --- MOBILE VIEW (450px) --- */
@media (max-width: 450px) {
    .btn-hero-scroll {
        margin-top: 25px; 
        padding: 9px 24px;
        font-size: 0.7rem;
        letter-spacing: 1.5px;
        width: fit-content;
    }

    .category-hero {
        height: 25vh; /* Slightly taller than 20vh to let text breathe without image */
        min-height: 180px;
    }
}

/* ------------ CATEGORY EXPLAINER ------------ */

.category-explainer {
    padding: 60px 0;
    background-color: #ffffff;
}

.explainer-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: flex-start;
}

.explainer-title {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-h2);
    color: var(--color-heading-section);
    letter-spacing: var(--ls-wide);
    line-height: var(--lh-heading);
    position: relative;
    padding-left: 25px;
    border-left: 5px solid var(--color-accent);
}

.explainer-body p {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    color: var(--color-text-dark);
    line-height: var(--lh-body);
    letter-spacing: var(--ls-wide);
    margin-bottom: 20px;
    text-align: justify;
}

.explainer-body p:last-child {
    margin-bottom: 0;
}

.explainer-body strong {
    color: var(--color-heading);
    font-weight: var(--fw-semibold);
}

/* --- MOBILE RESPONSIVENESS (450px) --- */

@media (max-width: 450px) {
    .container {
        padding: 0 20px; 
    }

    /* Hero Mobile Adjustments */
    .category-hero { 
        height: 40vh; /* Taller on mobile too */
        min-height: 320px;
        justify-content: center; 
    }
    
    .category-hero-content { 
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        text-align: center !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .category-title {
        font-size: 1.8rem;
    }

    /* Explainer Mobile Adjustments */
    .category-explainer {
        padding: 60px 0;
    }

    .explainer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .explainer-title {
        font-size: 1.5rem;
        padding-left: 0;
        border-left: none;
        padding-bottom: 15px;
        margin-bottom: 15px;
        display: inline-block;
        border-bottom: 3px solid var(--color-accent);
    }

    .explainer-body p {
        font-size: var(--fs-body);
        line-height: var(--lh-body);
        text-align: justify;
    }
}

/* ------------ FEATURE HIGHLIGHTS ------------ */

.feature-highlights {
    background-color: #f8fafc; /* Very light cool grey */
    padding: 40px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.highlight-icon {
    color: var(--color-accent); /* BuildMix Orange */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.highlight-text {
    font-size: var(--fs-small);
    font-weight: var(--fw-semibold);
    color: var(--color-subheading);
    letter-spacing: var(--ls-wide);
    line-height: var(--lh-body);
    text-transform: uppercase;
}

/* --- MOBILE RESPONSIVENESS (450px) --- */

@media (max-width: 450px) {
    .feature-highlights {
        padding: 30px 0;
    }

    .highlights-grid {
        grid-template-columns: 1fr 1fr; /* 2x2 grid on mobile */
        gap: 25px 15px;
    }

    .highlight-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .highlight-text {
        font-size: 0.75rem;
    }
}



/* ------------ PRODUCT GRID SECTION ------------ */

.product-list-section {
    padding: 70px 0;
    background-color: #ffffff;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-main-title {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-h2);
    color: var(--color-heading-section);
    letter-spacing: var(--ls-wide);
    margin-bottom: 10px;
}

.section-subtitle {
    font-family: var(--font-body);
    color: var(--color-subheading);
    font-size: var(--fs-body);
    letter-spacing: var(--ls-wide);
}

/* Flexbox Grid for perfect centering of 3+2 layout */
.product-flex-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center; /* This centers the bottom 2 items */
}

.product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 40px 30px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    /* This ensures exactly 3 items per row on desktop */
    width: calc(33.333% - 20px); 
    min-height: 480px; /* Forces uniform height */
    box-sizing: border-box;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: var(--color-accent);
}

/* Updated Badge Style */
.product-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--color-accent);
    color: var(--color-btn-fg-1);
    font-size: 0.7rem;
    font-weight: var(--fw-semibold);
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px var(--color-accent-light);
}

.product-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: var(--fw-bold);
    color: var(--color-heading);
    letter-spacing: var(--ls-wide);
    margin-bottom: 5px;
}

.product-tagline {
    font-family: var(--font-body);
    font-size: var(--fs-extra-small);
    color: var(--color-accent);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wide);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.product-desc {
    font-family: var(--fs-small);
    font-size: var(--fs-small);
    color: var(--color-text-dark);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1; /* Pushes meta and button to the bottom */
}

.product-features {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    border-top: 1px solid #f3f4f6;
    padding-top: 20px;
}

.product-features li {
    font-size: var(--fs-small);
    color: #444444dc;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-features li::before {
    content: '✓';
    color: var(--color-accent);
    font-weight: bold;
}

.product-meta {
    margin-bottom: 25px;
    background: #f9fafb;
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.meta-label { 
    color: var(--color-text-dark);
    letter-spacing: var(--ls-wide); 
}

.meta-value { 
    color: var(--color-heading); 
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wide);
}

.btn-product {
    text-align: center;
    display: block;
    background: var(--color-subheading);
    color: #ffffff;
    text-decoration: none;
    padding: 12px;
    border-radius: 4px;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-small);
    letter-spacing: var(--ls-wide);
    transition: all 0.3s;
}

.btn-product:hover {
    background: var(--color-accent);
}

/* --- RESPONSIVENESS --- */

@media (max-width: 992px) {
    .product-card {
        width: calc(50% - 15px); /* 2 items per row */
    }
}

@media (max-width: 450px) {
    .product-list-section { padding: 60px 0; }
    
    .product-card {
        width: 100%; /* Full width stack */
        min-height: auto;
        padding: 35px 25px;
    }

    .section-main-title {
        font-size: 1.8rem;
    }
}


/* ------------ COMPARISON TABLE ------------ */

.comparison-section {
    padding: 70px 0 100px 0;
    background-color: #fcfcfc;
}

.table-responsive {
    width: 100%;
    overflow-x: auto; /* Enables horizontal scroll on mobile */
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    text-align: left;
    min-width: 800px; /* Ensures table doesn't squash on small screens */
}

.comparison-table thead th {
    background-color: var(--color-subheading);
    color: #ffffff;
    padding: 20px;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-small);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
}

.comparison-table tbody td {
    padding: 18px 20px;
    border-bottom: 1px solid #edf2f7;
    font-size: var(--fs-small);
    color: #4a5568; 
}

.comparison-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.comparison-table tbody tr:hover {
    background-color: var(--color-accent-light);
}

.comparison-table strong {
    color: var(--color-accent);
    font-weight: var(--fw-bold);
}

.table-link {
    color: var(--color-accent); 
    text-decoration: none;
    font-weight: 800;
    transition: color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.table-link:hover {
    color: var(--color-heading);
    border-bottom: 1px solid var(--color-heading);
}

/* Optional: Add a small arrow or icon after the link if you want it to look more like a button */
.table-link::after {
    content: ' →';
    font-size: 0.8em;
    opacity: 0.6;
}

/* --- MOBILE VIEW (450px) --- */
@media (max-width: 450px) {
    .comparison-section {
        padding: 60px 0;
    }

    /* Hint to the user that they can scroll the table */
    .table-responsive::after {
        content: 'Scroll horizontally to view more →';
        display: block;
        text-align: center;
        font-size: 0.7rem;
        color: #999;
        margin-top: 15px;
        text-transform: uppercase;
    }
}