body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5; /* Updated background color */
    color: #333; /* Updated text color */
}

.banner {
    background-color: #006400; /* Updated banner color to dark green */
    color: white;
    text-align: center;
    padding: 30px 0; /* Increased padding for a larger banner */
}

header.banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #006400;
    color: white;
    text-align: center;
    padding: 1rem;
}

@media (max-width: 768px) {
    header.banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .logo-container {
        justify-content: flex-start;
        width: 100%;
    }
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-background {
    background-color: white;
    padding: 10px;
    border-radius: 10px;
    display: inline-block;
}

.banner-logo {
    max-width: 150px; /* Original size */
    height: auto;
    display: block;
}

.logo-section {
    text-align: center;
    margin: 50px 0;
}

.main-logo {
    max-width: 80%;
    height: auto;
}

.navbar {
    background-color: rgba(46, 125, 50, 0.92); /* Slightly transparent green */
    padding: 0 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: static; /* Ensure navbar is in normal flow and does not overlap */
    top: 0;
    z-index: 100;
    min-height: 64px;
    width: 100%;
    box-sizing: border-box;
}

.navbar-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.menu-toggle {
    display: none !important; /* Always hide hamburger button */
}

.nav-links {
    display: none;
    flex-direction: column;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    background: #2e7d32;
    z-index: 2000;
    padding: 10px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-radius: 0 0 12px 12px;
}
.nav-links.active {
    display: flex;
}
@media (min-width: 1025px) {
    .nav-links {
        display: flex !important;
        flex-direction: row;
        position: static;
        background: none;
        width: auto;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
        gap: 32px;
    }
}
@media (max-width: 1024px) {
    .nav-links {
        display: flex !important;
        flex-direction: column;
        position: static;
        background: none;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        gap: 16px;
        padding: 10px 0;
    }
    .navbar {
        position: static;
    }
}
@media (max-width: 700px) {
    .navbar {
        padding: 0 2vw;
        min-height: 48px;
    }
    .navbar-container {
        flex-direction: row;
        gap: 4px;
    }
    .nav-links {
        gap: 10px;
        font-size: 1.05em;
    }
}

.nav-links.centered-nav {
    justify-content: center;
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #66bb6a;
}

.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: " ▼";
    font-size: 0.8rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #2e7d32;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.dropdown-menu li {
    padding: 5px 20px;
}

.dropdown-menu li a {
    color: white;
    text-decoration: none;
    display: block;
}

.dropdown-menu li a:hover {
    background-color: #66bb6a;
    border-radius: 5px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

footer {
    background-color: #2e7d32; /* Tumma vihreä footer */
    color: white;
    text-align: center;
    padding: 10px 0;
}

.service {
    margin: 40px 0;
    text-align: center;
    padding: 20px;
    background-color: #ffffff; /* Add a white background for better contrast */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Subtle shadow for a modern look */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service:hover {
    transform: translateY(-5px); /* Slight lift on hover */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
}

.service-images {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.service-image {
    max-width: 30%;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-image:hover {
    transform: scale(1.05); /* Slight zoom effect */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Add shadow on hover */
}

.request-quote {
    display: block;
    width: 90%;
    max-width: 350px;
    align-self: center;
    padding: 12px 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    background-color: #66bb6a; /* Match the theme color */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-align: center;
    margin: 24px auto 0 auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.request-quote:hover {
    background-color: #57a05a; /* Darker green on hover */
    transform: scale(1.05); /* Slightly enlarge on hover */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
}

.service-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-container img, .service-container .scaled-image {
    max-width: 100%;
    width: 100%; /* Always fit container width */
    height: auto;
    max-height: 300px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.10);
}
@media (max-width: 700px) {
    .service-container img, .service-container .scaled-image {
        max-width: 100vw;
        width: 100%;
        max-height: 180px;
    }
}

.services {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-container {
    width: 100%;
    max-width: 1000px;
    margin: 32px auto;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 24px 32px;
    cursor: pointer;
    position: relative;
}

.service-container:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    border-color: #66bb6a;
}

@media (min-width: 769px) {
    .service-container {
        flex-direction: column;
        align-items: center;
    }
}
@media (max-width: 768px) {
    .service-container {
        flex-direction: column;
        align-items: center;
    }
}

.carousel {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.carousel-image {
    width: 100%;
    height: auto;
    display: none;
    transition: opacity 0.5s ease;
}

.carousel-image:first-child {
    display: block;
}

.service-content {
    text-align: left;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.service-content h2 {
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: #2e7d32;
}

.service-content h3 {
    margin-top: 0;
    color: #2e7d32;
    text-align: left;
}

.service-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.service-content ul {
    padding-left: 1.2em;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.service-content li {
    margin-bottom: 0.3em;
    line-height: 1.6;
}

.service-button {
    text-align: right;
}

.request-quote {
    display: block;
    width: 90%;
    max-width: 350px;
    align-self: center;
    padding: 12px 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    background-color: #66bb6a;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-align: center;
    margin: 24px auto 0 auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.request-quote:hover {
    background-color: #57a05a;
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Styles for the partner logos section */
.partners {
    text-align: center;
    margin: 40px 0;
}

.partner-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.partner-logo {
    max-width: 150px;
    height: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.partner-logo:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Scale Keskijärven Maanrakennuksen logo */
.keskijarvi-logo {
    width: 150px; /* Match the width of the Pippuriset logo */
    height: auto; /* Maintain aspect ratio */
    margin: 0 auto; /* Center the logo horizontally */
    display: block; /* Ensure proper alignment */
}

/* Adjust background proportionally */
.keskijarvi-logo-container {
    background-color: #f0f0f0; /* Adjust background color if needed */
    padding: 20px; /* Add padding around the logo */
    text-align: center; /* Center the logo within the container */
    border-radius: 10px; /* Optional: Add rounded corners */
}

/* Styles for interactive speech bubbles */
.speech-bubble {
    position: relative;
    background: #fff;
    color: #2e7d32;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 18px 32px;
    max-width: 350px;
    margin: 0;
    font-size: 1.1rem;
    position: relative;
    text-align: center;
    min-width: 220px;
}

.speech-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.15);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 16px 16px 0 16px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.speech-bubble-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin: 40px 0;
}

@media (max-width: 900px) {
    .speech-bubble-container {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    .speech-bubble {
        max-width: 95vw;
        min-width: 0;
        padding: 12px 10px;
        font-size: 1rem;
    }
}

/* Styles for the interactive "Tarjouspyyntö" form and the return button */
.interactive-offer {
    margin: 40px auto;
    max-width: 600px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.interactive-offer h2 {
    font-size: 1.8rem;
    color: #2e7d32;
    margin-bottom: 20px;
}

.interactive-offer form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.interactive-offer select,
.interactive-offer textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.submit-offer {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background-color: #66bb6a;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.submit-offer:hover {
    background-color: #57a05a;
    transform: scale(1.05);
}

.back-to-services {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #66bb6a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-to-services:hover {
    color: #57a05a;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 80%;
    overflow-y: auto;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    color: black;
    cursor: pointer;
    background: none;
    border: none;
}

/* Responsive adjustments for modal */
@media (max-width: 768px) {
    .modal-content {
        max-width: 90%;
        max-height: 90%;
    }
}

/* Remove unused modal styles for offerModal, serviceModal, productDetailsModal, checkoutModal */
#productDetailsModal, #checkoutModal {
    display: none !important;
}
#productDetailsModal .modal-content,
#checkoutModal .modal-content,
#checkoutModal .modal-content h2,
#checkoutModal .modal-content label,
#checkoutModal .modal-content input,
#checkoutModal .modal-content button {
    display: none !important;
}

/* Ensure consistent image scaling for palvelut and verkkokauppa */
.scaled-image {
    width: 350px; /* Increased width */
    height: 250px; /* Increased height */
    object-fit: cover; /* Maintain aspect ratio and fill the dimensions */
    border-radius: 10px; /* Optional: Add rounded corners */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Optional: Add subtle shadow */
}

/* Adjusting service-container to provide more room horizontally for larger images */
.service-container {
    grid-template-columns: auto 1fr; /* Maintain layout */
    gap: 20px; /* Increase gap for better spacing */
    align-items: center; /* Center-align items for better visual balance */
}

/* Adding specific styles for larger images */
.service-container img {
    max-width: 800px; /* Ensure larger images fit within the container */
    max-height: 200px; /* Maintain aspect ratio for larger images */
    width: auto; /* Allow images to scale proportionally */
    height: auto; /* Allow images to scale proportionally */
}

/* Moving h1 element titled "Palvelut" slightly away from the left edge */
h1 {
    margin-left: 0; /* Remove left margin */
    text-align: center; /* Center align all h1 elements */
}

/* Center-align the "Palvelumme" text */
.services h2 {
    text-align: center;
}

header.banner, .navbar, .navbar.unified-navbar {
    z-index: 10;
    position: relative;
}

/* --- Responsive and cross-browser improvements --- */

/* Enlarged product card: better mobile scaling and scrolling */
.product-card.enlarged {
    z-index: 99999 !important;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    -webkit-transform: translate(-50%, -50%) scale(1.5);
    -ms-transform: translate(-50%, -50%) scale(1.5);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    background: #fff;
    max-width: 90vw;
    max-height: 90vh;
    width: 400px;
    min-height: unset;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .product-card.enlarged {
        width: 95vw;
        max-width: 95vw;
        height: 95vh;
        max-height: 95vh;
        transform: translate(-50%, -50%) scale(1);
        -webkit-transform: translate(-50%, -50%) scale(1);
        -ms-transform: translate(-50%, -50%) scale(1);
        padding: 10px;
    }
}

.info-box {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 32px 32px;
    max-width: 700px;
    margin: 40px auto;
    font-size: 1.1rem;
    color: #000;
    text-align: center;
}
.info-box h2 {
    margin-top: 0;
    color: #2e7d32;
}
.info-box a {
    color: #198754;
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.2s;
}
.info-box a:hover {
    color: #145c32;
}
.info-box .contact-link {
    color: #66bb6a;
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.2s;
}
.info-box .contact-link:hover {
    color: #198754;
}
@media (max-width: 700px) {
    .info-box {
        padding: 16px 8px;
        max-width: 98vw;
        font-size: 1rem;
    }
}

.speech-bubble a {
    color: #198754;
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.2s;
}

.speech-bubble a:hover, .speech-bubble a:focus {
    color: #145c32;
}

/* Verkkokauppa button styles to match 'pyydä tarjous' */
.add-to-cart, .add-to-cart-btn, .cart-btn, .checkout-btn {
    background-color: #66bb6a;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    padding: 0.6em 1.2em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: 1em;
    margin: 0.2em 0.1em;
    box-shadow: 0 2px 8px rgba(102,187,106,0.10);
}
.add-to-cart:hover, .add-to-cart-btn:hover, .cart-btn:hover, .checkout-btn:hover {
    background-color: #57a05a;
    color: #fff;
}

.products {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: flex-start;
    align-items: stretch;
    margin-bottom: 32px;
}
.product-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    flex: 1 1 300px;
    min-width: 260px;
    max-width: 340px;
    min-height: 380px;
    max-height: 520px;
    box-sizing: border-box;
    padding: 20px 16px 16px 16px;
    margin: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}
.product-image-wrapper {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.product-image {
    max-width: 100%;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: none;
}
@media (max-width: 900px) {
    .products {
        gap: 16px;
    }
    .product-card {
        min-width: 90vw;
        max-width: 98vw;
        min-height: 340px;
        max-height: 600px;
        padding: 14px 8px 16px 8px;
    }
    .product-image-wrapper {
        height: 140px;
    }
    .product-image {
        max-height: 120px;
    }
}

/* New transitions for .banner-logo and .speech-bubble elements */
.banner-logo, .speech-bubble, .partner-logo, .info-box, .service-content, .product-card {
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);
}
.banner-logo:hover, .banner-logo:focus, .partner-logo:hover, .partner-logo:focus {
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 6px 24px rgba(25,135,84,0.18);
    outline: none;
}
.speech-bubble:hover, .speech-bubble:focus {
    transform: scale(1.04) rotate(1deg);
    box-shadow: 0 8px 32px rgba(102,187,106,0.15);
    outline: none;
}

/* Ensure all .banner-logo are always inside <a href="../index.html"> or <a href="index.html"> on all pages */