/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

header {
    background: #003366;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header,
.cert-hero,
.clients-hero,
.services-hero-text,
.about-text,
.contact-info,
.about-cta {
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    padding-left: 1rem;
    padding-right: 1rem;
}

.about-text ul {
    display: inline-block;
    text-align: left;
    margin: 0 auto 1rem;
    padding-left: 1.2rem;
}

/* Navigation */
.navbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: white;
    box-shadow: 0 3px 14px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.navbar-logo,
.footer-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
}

.brand-text {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-weight: 800;
    font-size: 20px;
}

.brand-thermo {
    color: #1565c0;
}

.brand-electronics {
    color: #d32f2f;
}

.navbar-toggle {
    display: none;
    width: 34px;
    height: 30px;
    padding: 5px;
    border: none;
    background: transparent;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.navbar-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 3px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.navbar-link,
.footer-link {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: color 0.2s ease;
}

.navbar-link:hover,
.footer-link:hover {
    color: #1565c0;
}

.navbar-link.active {
    color: #1565c0;
}

@media (max-width: 820px) {
    .navbar {
        padding: 14px 18px;
    }

    .navbar-toggle {
        display: flex;
    }

    .navbar-links {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow: hidden;
        max-height: 0;
        border-top: 1px solid #e2e8f0;
        transition: max-height 0.3s ease;
    }

    .navbar-links.active {
        max-height: 340px;
    }

    .navbar-link {
        padding: 14px 18px;
        border-bottom: 1px solid #f1f5f9;
    }
}

@media (max-width: 520px) {
    .navbar {
        flex-wrap: wrap;
    }

    .navbar-links.active {
        max-height: 380px;
    }
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
}

#search-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #d7dee5;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease;
}

#search-input:focus {
    border-color: #003366;
}

/* Filters */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #003366;
    background: white;
    color: #003366;
    cursor: pointer;
    font-weight: bold;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: #003366;
    color: white;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.product-card {
    background: white;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    overflow: hidden;
    margin: 0 0 15px 0; /* keep image inside the card */
    max-height: 160px; /* smaller thumbnail height for denser grid */
    background-color: #fafafa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* show whole image without zoom/crop */
    object-position: center;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.category-tag {
    display: inline-block;
    align-self: flex-start;
    background: #eaf1f8;
    color: #003366;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.product-card h3 {
    color: #003366;
    margin-bottom: 8px;
    font-size: 18px;
}

.product-card .desc {
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
}

.empty-state {
    text-align: center;
    color: #777;
    grid-column: 1 / -1;
    padding: 3rem 0;
    font-size: 18px;
}

.quote-btn {
    background: #e67e22;
    color: white;
    border: none;
    padding: 12px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
}

.quote-btn:hover {
    background: #d35400;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 2.5rem;
}

.page-btn {
    min-width: 40px;
    padding: 8px 12px;
    border: 2px solid #d7dee5;
    background: white;
    color: #003366;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: #003366;
    background: #eaf1f8;
}

.page-btn.active {
    background: #003366;
    border-color: #003366;
    color: white;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #999;
    padding: 0 4px;
}

.page-summary {
    width: 100%;
    text-align: center;
    color: #777;
    font-size: 14px;
    margin-top: 10px;
}

/* Modal Overlay */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-btn:hover {
    color: #333;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

#selectedProduct {
    background-color: #eee;
    color: #555;
}

.submit-btn {
    background: #003366;
    color: white;
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #002244;
}

/* Back link on product detail page */
.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: #003366;
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* Product Detail Page */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.detail-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* show whole image without cropping */
    object-position: center;
    display: block;
    border-radius: 8px;
    max-height: 520px;
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-info h2 {
    color: #003366;
    font-size: 28px;
    margin-bottom: 15px;
}

.detail-desc {
    color: #555;
    font-size: 16px;
    margin-bottom: 25px;
    flex-grow: 1;
}

.detail-info .quote-btn {
    align-self: flex-start;
    padding: 14px 32px;
    width: auto;
}

.loading-state,
.not-found {
    text-align: center;
    padding: 3rem 0;
    color: #666;
    grid-column: 1 / -1;
}

.not-found h2 {
    color: #003366;
    margin-bottom: 10px;
}

.not-found .submit-btn {
    margin-top: 15px;
}

@media (max-width: 700px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
}

/* Footer */
.site-footer {
    width: 100%;
    max-width: 1180px;
    margin: 40px auto 0;
    background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
    color: #e2e8f0;
    padding: 36px 32px 24px;
    border-top: 4px solid #2563eb;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding-bottom: 24px;
}

.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    max-width: 360px;
}

.footer-brand-text {
    font-size: 21px;
    margin-bottom: 6px;
}

.footer-slogan {
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 14px;
}

.footer-contact {
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.footer-nav-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 140px;
}

.footer-nav-group h4 {
    color: #ffffff;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.footer-link {
    color: #dbeafe;
}

.footer-link:hover {
    color: #93c5fd;
}

.footer-bottom {
    margin-top: 18px;
    text-align: center;
    color: #cbd5e1;
    font-size: 14px;
}

@media (max-width: 700px) {
    .site-footer {
        margin: 24px 12px 0;
        max-width: calc(100% - 24px);
        padding: 28px 18px 20px;
        border-radius: 18px 18px 0 0;
    }

    .footer-top {
        justify-content: center;
        text-align: center;
        align-items: center;
    }

    .footer-brand {
        justify-content: center;
        flex-direction: column;
        align-items: center;
        text-align: center;
        max-width: none;
    }

    .footer-links {
        width: 100%;
        justify-content: center;
        gap: 16px;
        text-align: center;
    }

    .footer-nav-group {
        flex: 1 1 140px;
        align-items: center;
    }
}

/* Sticky Dialer */
.sticky-dialer {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #27ae60;
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 999;
    transition: transform 0.3s;
}

.sticky-dialer:hover {
    transform: scale(1.05);
}