body {
    background-color: #f8f9fa;
}
/* HEADER */
header {
    background-color: #fafafa;
    padding-top: 0;
}
.site-name {
    font-size: 3rem;
    font-weight: 700;
}
.slogan {
    font-family: 'Lora', serif;
    font-size: 1.5rem;
    font-weight: 400;
}
.contact-link p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0;
}
.contact-link i {
    font-size: 1.5rem;
    line-height: 1;
}
.contact-link a {
    color: #198754;
    font-size: 1.75rem;
    text-decoration: none;
}
.contact-link a:hover {
    text-decoration: underline;
}

/* SECTIONS: equal-height */
.section.row {
    align-items: stretch;
}
/* Ensure right-hand column clips overflow */
.section > .col-lg-7 {
    position: relative;
    overflow: hidden;
}

/* CARD BASE */
.card.flex-fill {
    display: flex;
    flex-direction: column;
}

/* IMAGE CONTAINER */
.image-container {
    flex: 0 0 400px; /* Significantly increased fixed height for product images */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Specific styling for main product grid images */
.products-section .card .image-container {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.card:hover .product-image {
    transform: scale(1.08);
}

/* TITLE & PRICE */
.title-price-row {
    background-color: #adb5bd;
    color: #f8f9fa;
    padding: 1rem 2rem;
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    column-gap: 1rem;
}
.title-price-row .card-title {
    margin: 0;
    font-size: 1.75rem;
    text-align: left;
}
.title-price-row .price {
    font-size: 1.5rem;
    font-weight: 700;
}

/* SPEC BLOCK */
.spec-block {
    display: flex;
    background-color: #e9ecef;
    flex: 0 0 auto;
    border-radius: 0 0 .25rem .25rem;
}
.spec-keys,
.spec-values {
    list-style: none;
    margin: 0;
    white-space: nowrap;
}
.spec-keys {
    text-align: right;
    font-weight: bold;
}
.spec-values {
    text-align: left;
}
/* global spec paddings */
.spec-keys {
    width: 50%;
    padding: 1rem 0.5rem 1rem 1rem;
}
.spec-values {
    width: 50%;
    padding: 1rem 1rem 1rem 0.5rem;
}
.spec-keys li,
.spec-values li {
    margin-bottom: .5rem;
}

/* New spec-list structure for Product Card 1 */
.spec-list {
    list-style: none;
    margin: 0;
    padding: 1rem;
    width: 100%;
}
.spec-list li {
    display: flex;
    flex-wrap: wrap;
}
.spec-key, .spec-value {
    display: inline-block;
    width: 50%;
    padding: 0.15rem;
}
.spec-key {
    text-align: right;
    font-weight: bold;
    padding-right: 0.5rem;
}
.spec-value {
    text-align: left;
    padding-left: 0.5rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: normal;
}

/* MODEL 7 SPECIFIC */
.model7-card {
    height: 100%;
}
.model7-card .title-price-row {
    margin-top: auto;
}
.model7-card .image-container {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

/* SHOWCASE IMAGE */
.main-image {
    display: block;
    height: 100%;
    width: auto;
    object-fit: contain;
    object-position: center center;
}

/* ===== Thermostat Section (section 9) Layout ===== */
.thermostat-card {
    display: flex;
    flex-direction: column;
}
/* Title + price row is handled by .title-price-row above */

/* Content row fills remaining height */
.thermostat-card > .d-flex {
    flex: 1 1 auto;
    overflow: hidden;
}

/*  Instead of fixed px, use percentage for image column */
.thermostat-image {
    flex: 0 0 30%;
    max-width: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Override thermostat spec-key/value widths & padding */
.thermostat-card .spec-keys {
    width: 50%;
    padding: 1rem 0.5rem 1rem 1rem;
}
.thermostat-card .spec-values {
    width: 50%;
    padding: 1rem 1rem 1rem 0.5rem;
}

/* Responsive tweaks */
@media (max-width: 992px) {
    .thermostat-image {
        flex: 0 0 25%;
        max-width: 25%;
    }
    .title-price-row .card-title {
        font-size: 1.25rem;
    }
    .title-price-row .price {
        font-size: 1.125rem;
    }
    .title-price-row {
        column-gap: 0.75rem;
    }
}

/* Equal-width halves on large screens */
@media (min-width: 992px) {
    .section > .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Your existing large-screen override */
@media (min-width: 920px) {
    .container {
        max-width: 1932px;
    }
}

/* Product Card Grid Styling */
.products-section h2,
.special-products-section h2 {
    color: var(--color-primary);
    position: relative;
    font-family: 'Lora', serif;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.products-section h2:after,
.special-products-section h2:after {
    content: '';
    position: absolute;
    width: 80px;
    height: 3px;
    background-color: var(--color-secondary, #6c757d);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px;
}

.card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.placeholder-card {
    border: 2px dashed #e0e0e0;
    background-color: #f9f9f9;
}

.placeholder-card .bi {
    opacity: 0.6;
}

.placeholder-card:hover {
    border-color: var(--color-secondary, #6c757d);
    background-color: #f5f5f5;
}

/* Make the grid responsive */
@media (max-width: 991.98px) {
    .row-cols-md-2 > .col .card {
        height: 100%;
    }
}

/* Fix for aligning title rows in product grid */
.row.row-cols-1.row-cols-md-2.row-cols-lg-3 {
    display: flex;
    flex-wrap: wrap;
}

/* Set equal height for each row in grid */
.row.row-cols-1.row-cols-md-2.row-cols-lg-3:after {
    content: '';
    display: block;
    clear: both;
}

/* Create consistent row breaks */
@media (min-width: 992px) {
    .row.row-cols-1.row-cols-md-2.row-cols-lg-3 > .col:nth-child(3n+1) {
        clear: both;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .row.row-cols-1.row-cols-md-2.row-cols-lg-3 > .col:nth-child(2n+1) {
        clear: both;
    }
}

@media (max-width: 767.98px) {
    .products-section h2,
    .special-products-section h2 {
        font-size: 1.75rem;
    }

    .card {
        margin-bottom: 1.5rem;
    }

    /* Adjust image container height on small screens */
    .products-section .card .image-container {
        flex: 0 0 300px;
    }

    /* Make horizontal cards stack on mobile */
    .horizontal-card .image-container {
        height: 200px;
        margin-bottom: 1rem;
    }
}

/* Horizontal Card Specific Styling */
.horizontal-card .image-container {
    flex: 0 0 auto; /* Override the main image container height */
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.horizontal-card .title-price-row {
    border-radius: 0;
}

/* Ensure the spec block fills the available height */
.horizontal-card .row {
    height: 100%;
}

.horizontal-card .col-md-8 {
    display: flex;
    flex-direction: column;
}

.horizontal-card .spec-block {
    flex-grow: 1;
    border-radius: 0 0 0.25rem 0;
}
