/* ==========================================================================
   Sanskar Engineering Works - Main Stylesheet
   ========================================================================== */

:root {
    --primary-color: #0B3C95;   /* Deep Industrial Blue */
    --accent-color: #E31E24;    /* Safety Red/Orange Accent */
    --dark-color: #222222;      /* Deep Charcoal for Text */
    --light-bg: #F8F9FA;        /* Light Gray Section Background */
    --white: #FFFFFF;
    --gray-border: #E0E0E0;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Top Bar & Header --- */
.top-bar {
    background-color: #06235C;
    color: var(--white);
    font-size: 0.9rem;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar .top-bar-right {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.top-bar a {
    color: var(--white);
    transition: var(--transition);
}

.top-bar a:hover {
    color: #e31e24; /* Changes color slightly on hover */
}

.header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

/* Desktop Logo Style */
.logo h1 {
    color: var(--primary-color);
    font-size: 1.5rem; /* Slightly reduced from 1.6rem to accommodate 'Works' beautifully */
    font-weight: 700;
}

/* Mobile Responsiveness Viewport Update */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 1.3rem; /* Ensures the full name fits nicely on single lines on mobile */
    }
}

.logo span {
    color: var(--accent-color);
}

.logo p {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -4px;
}

.nav-menu {
    display: flex;
    gap: 25px;
}

.nav-menu a {
    font-weight: 600;
    color: var(--dark-color);
    padding: 8px 0;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--accent-color);
}

.menu-toggle-checkbox, .hamburger {
    display: none;
}

/* --- Inner Page Hero Section --- */
.page-title {
    background: linear-gradient(rgba(11, 60, 149, 0.85), rgba(11, 60, 149, 0.95)), url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?auto=format&fit=crop&q=80&w=1200') no-repeat center center/cover;
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.page-title h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* --- Common UI Components --- */
.section-padding {
    padding: 70px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 45px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
}

.btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 12px 28px;
    font-weight: 600;
    border-radius: 4px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #be1318;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: #082d70;
}

/* --- Hero Section & CSS Slideshow --- */
.hero {
    height: 550px;
    display: flex;
    align-items: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slideshow .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    animation: cssSlideshow 15s linear infinite;
}

/* Staggering the animation start times for each slide */
.hero-slideshow .slide:nth-child(1) {
    animation-delay: 0s;
}
.hero-slideshow .slide:nth-child(2) {
    animation-delay: 5s;
}
.hero-slideshow .slide:nth-child(3) {
    animation-delay: 10s;
}

/* Smooth fade-in, sustain, and fade-out timeline logic */
@keyframes cssSlideshow {
    0% { opacity: 0; transform: scale(1); }
    8% { opacity: 1; }
    33% { opacity: 1; }
    41% { opacity: 0; transform: scale(1.05); } /* Subtle zoom effect */
    100% { opacity: 0; }
}

.hero-content {
    max-width: 700px;
}

.hero-content h2 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.cert-badge {
    display: inline-block;
    background-color: var(--accent-color);
    padding: 5px 12px;
    font-weight: bold;
    font-size: 0.85rem;
    border-radius: 3px;
    margin-bottom: 15px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--light-bg);
    padding: 30px;
    border-radius: 5px;
    border-left: 5px solid var(--primary-color);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* --- About Page Layout --- */
.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.distributor-logos {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

.dist-card {
    border: 1px solid var(--gray-border);
    padding: 15px;
    text-align: center;
    border-radius: 5px;
    background: var(--light-bg);
    flex: 1;
}

.dist-card h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

/* --- Products Page Layout --- */
.disclaimer-box {
    background-color: #FFF3CD;
    border-left: 5px solid #FFC107;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 40px;
    font-weight: 500;
    text-align: center;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.product-card {
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    overflow: hidden;
    text-align: center;
    transition: var(--transition);
}

.product-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.product-card img {
    width: 100%;
    height: 220px; /* Keeps card heights completely identical */
    object-fit: cover; /* Crops image cleanly to fill the space without distorting */
}

.product-card h3 {
    font-size: 1.1rem;
    padding: 15px;
    background: var(--light-bg);
    color: var(--dark-color);
    border-top: 1px solid var(--gray-border);
}

/* --- Services Page Layout --- */
.services-section h3 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--gray-border);
    padding-bottom: 10px;
}

.services-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.service-item {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    gap: 15px;
}

.service-item::before {
    content: "✓";
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* --- Contact Page Layout --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.info-box {
    margin-bottom: 30px;
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-border);
    border-radius: 4px;
    font-family: inherit;
}

/* --- Footer --- */
.footer {
    background-color: #111111;
    color: #999999;
    padding: 50px 0 20px;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

/* Responsive container for Google Map embed */
.map-container {
    width: 100%;
    height: 150px;
    border-radius: 4px;
    overflow: hidden;
    border: 0;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--white);
    padding-left: 5px; /* Slight nudge animation on hover */
}

.footer-col h3 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-col p {
    margin-bottom: 10px;
}

.footer-bottom {
    border-top: 1px solid #222222;
    padding-top: 20px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Ensures it stacks nicely on mobile screens */
    gap: 10px;
}

.footer-bottom a {
    color: var(--white);
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--accent-color);
}

/* --- Home Page Extended Component Grids --- */
.bg-white { background-color: var(--white); }
.bg-light { background-color: var(--light-bg); }

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.section-title-left {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.rounded-img {
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.grid-4-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

/* Home Product Cards Styling */
.home-prod-card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 4px;
    overflow: hidden;
    text-align: center;
    transition: var(--transition);
}
.home-prod-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.home-prod-card img {
    /* height: 150px; */
    height: auto;
    width: 100%;
    /* object-fit: cover; */
}
.home-prod-card h4 {
    padding: 12px;
    color: var(--dark-color);
}

/* Home Service Cards Styling */
.home-serv-card {
    background: var(--white);
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    border: 1px solid var(--gray-border);
    text-align: center;
}
.home-serv-card .serv-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}
.home-serv-card h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.3rem;
}

/* Testimonial Cards Styling */
.testimonial-card {
    background: var(--white);
    padding: 30px;
    border-radius: 6px;
    border-top: 4px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.testimonial-card .quote {
    font-style: italic;
    color: #555555;
    margin-bottom: 15px;
}
.testimonial-card h5 {
    color: var(--primary-color);
    font-size: 1rem;
}
.testimonial-card span {
    font-size: 0.8rem;
    color: #888888;
}

/* Container for each logo */
.logo-grid .logo-card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    padding: 20px;
    min-height: 100px;
    
    /* Center the image vertically and horizontally */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

/* Handling the diverse image sizes */
.logo-grid .logo-card img {
    max-width: 85%;      /* Prevents wide logos from touching borders */
    /* Forces tall logos to clip at a uniform height */
    /* max-height: 55px;    */
    max-height: auto;
    width: auto;         /* Maintains original aspect ratio */
    height: auto;        /* Maintains original aspect ratio */
    /* Ensures the image fits entirely without clipping */
    /* object-fit: contain;  */
    
    /* Professional Blend: Makes all chaotic brand colors uniform gray */
    /* filter: grayscale(100%);
    opacity: 0.7; */
    transition: all 0.3s ease;
}

/* Bring back full color and sharpness when a user hovers over a logo */
.logo-grid .logo-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.logo-grid .logo-card:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

.client-placeholder {
    opacity: 0.6;
}

.grid-6-col {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

/* Product Cards Grid System (Applies to both Home & Products pages) */
.home-prod-card img, .product-card img {
    width: 100%;
    /* Forces every single image box to be identical in height */
    /* height: 220px;  */
    height: auto;
    /* Crucial: Crops and scales the image cleanly to fill the box without distorting */
    /* object-fit: cover;   */
    object-position: center; /* Keeps the center of the valve photo focused */
    display: block;
}

/* Connect to Mobile Settings layout query */
@media (max-width: 768px) {
    .two-col-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Mobile Responsiveness & Hamburger Menu --- */
@media (max-width: 768px) {
    .top-bar {
        display: none;
    }
    
    .header .container {
        position: relative;
        padding: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    /* Display the Hamburger Icon */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 1001;
    }

    .hamburger span {
        display: block;
        height: 3px;
        width: 100%;
        background-color: var(--primary-color);
        border-radius: 3px;
        transition: var(--transition);
    }

    /* Transform navigation into a dropdown menu hidden by default */
    .nav-container {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        z-index: 999;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        text-align: left;
        padding: 10px 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 15px 25px;
        border-bottom: 1px solid var(--gray-border);
    }

    .nav-menu a:hover, .nav-menu a.active {
        border-bottom: 1px solid var(--gray-border);
        background-color: var(--light-bg);
        padding-left: 30px;
    }

    /* The Magic CSS Hack: When checkbox is checked, expand the menu max-height */
    .menu-toggle-checkbox:checked ~ .nav-container {
        max-height: 350px; /* Adjust based on menu height */
    }

    /* Turn the hamburger icon into an 'X' close indicator when menu is open */
    .menu-toggle-checkbox:checked ~ .hamburger span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle-checkbox:checked ~ .hamburger span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle-checkbox:checked ~ .hamburger span:nth-child(3) {
        transform: translateY(-9px) rotate(-44deg);
    }

    /* Content Layout Resizing */
    .hero-content h2 {
        font-size: 2.2rem;
    }
    .about-wrapper, .contact-wrapper {
        grid-template-columns: 1fr;
    }
}