/* Reset and Variables */
:root {
    --primary-color: #1a2a3a; /* Deep Navy */
    --secondary-color: #ff8c00; /* Safety Orange */
    --slate-grey: #4a5568;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --text-dark: #2d3748;
    --text-light: #718096;
    --whatsapp-green: #25d366;
    --glass-bg: rgba(255, 255, 255, 0.1);

    /* WhatsApp Popup Variables */
    --wa-btn-size: 50px;
    --wa-edge-margin: 40px;
    --wa-popup-gap: 16px;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Accessibility Utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Utilities */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
    letter-spacing: 1px;
}

/* Generic Section Header Frame (Architectural L-Bracket) */
.section-header-frame {
    position: relative;
    max-width: 850px;
    margin: 0 auto 4rem auto;
    padding: 40px;
    padding-left: 120px;
    border-left: 6px solid #e67e22;
    border-top: 2px solid rgba(230, 126, 34, 0.3);
    background: transparent;
    text-align: left;
    box-shadow: -12px -5px 20px -12px rgba(230, 126, 34, 0.5);
}

.section-header-title { font-family: 'Montserrat', sans-serif; font-size: clamp(1.5rem, 6vw, 2.2rem); font-weight: 800; text-transform: uppercase; letter-spacing: 2px; margin: 0; }
.section-header-title span:last-child { color: #e67e22; }

/* Navbar */
.navbar {
    background: rgba(255, 255, 255); /* Semi-transparent white for glassmorphism */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-bottom: var(--secondary-color) 2px solid;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-logo-img {
    height: 40px;
    vertical-align: middle;
    margin-right: 10px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo span {
    color: #d97706; /* Darker amber for better contrast on white (3.1:1) */
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--secondary-color);
}

.nav-link.active {
    color: var(--secondary-color);
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--secondary-color);
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-dark);
    transition: all 0.3s ease-in-out;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background-color: var(--secondary-color);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background-color: var(--secondary-color);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    /* Adjusted padding for better spacing on all devices */
    padding-top: 120px;
    padding-right: 20px;
    padding-bottom: 60px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('hero-bg.webp') no-repeat center center/cover;
    z-index: -2;
    animation: kenburns 20s infinite alternate ease-in-out;
    will-change: transform;
}

@media (max-width: 768px) {
    .hero-bg {
        animation: none;
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(10, 15, 25, 0.98) 0%, rgba(0, 0, 0, 0.7) 35%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
}

.hero-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-central-logo-wrap {
    width: 280px;
    height: auto;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: width 0.3s ease;
}

.hero-central-logo-wrap img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5));
}

.connection-pulse {
    width: 4px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    position: absolute;
    bottom: -1px; /* Positions exactly on the horizontal bar */
    left: 50%;
    transform: translateX(-50%);
    animation: pulseOrange 2s infinite;
    box-shadow: 0 0 10px var(--secondary-color);
}

@keyframes pulseOrange {
    0% { transform: translateX(-50%) scale(1.5); box-shadow: 0 0 10px var(--secondary-color); opacity: 1; }
    50% { transform: translateX(-50%) scale(5); box-shadow: 0 0 30px var(--secondary-color); opacity: 0.3; }
    100% { transform: translateX(-50%) scale(1.5); box-shadow: 0 0 10px var(--secondary-color); opacity: 1; }
}

.hero-text-content {
    border-top: 2px solid var(--secondary-color);
    /* Third value (blur) is 20px, fourth (spread) is -10px to keep it contained to the top */
    box-shadow: 0 -15px 20px -10px rgba(230, 126, 34, 0.7);
    box-shadow: 0 -15px 15px -10px rgba(230, 126, 34, 0.6);
    padding: 40px 20px;
    position: relative;
    width: 100%;
    max-width: 850px;
    margin-top: -1px; /* Overlap slightly with logo wrap for a seamless connection */
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
}

.hero-text-content::before, .hero-text-content::after {
    content: '';
    position: absolute;
    top: 0;
    width: 2px;
    height: 15px;
    background: var(--secondary-color);
}

.hero-text-content::before { left: 0; }
.hero-text-content::after { right: 0; }

.hero-content h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: var(--light-bg);
    animation: heroFadeUp 1s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.hero-content h1 span {
    color: var(--secondary-color); /* Vibrant safety orange */
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 700px;
    line-height: 1.6;
    letter-spacing: 0.5px;
    animation: heroFadeUp 1s cubic-bezier(0.23, 1, 0.32, 1) 0.2s forwards;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
    opacity: 0;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    animation: heroFadeUp 1s cubic-bezier(0.23, 1, 0.32, 1) 0.4s forwards;
    opacity: 0;
}

.hero-btns .btn {
    min-width: 240px; /* Force identical width regardless of text length */
    text-align: center;
    padding: 12px 0; /* Vertical padding only, let min-width handle horizontal */
}

.btn {
    display: inline-block;
    padding: 10px 30px;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color); /* Dark text on orange provides much better contrast (7:1) */
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #e67e00;
    box-shadow: 0 10px 20px rgba(230, 126, 34, 0.3);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
}

.btn-whatsapp {
    background: #25D366;
    color: var(--white);
}

@keyframes kenburns {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

/* Disable intensive animation on small/low-power devices if needed */
@media (max-width: 768px) {
    .hero-bg {
        animation-duration: 30s; /* Slower animation reduces CPU load */
    }
}

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.scroll-down-arrow {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--secondary-color);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
    opacity: 0.8;
    z-index: 5;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
    40% {transform: translateX(-50%) translateY(-10px);}
    60% {transform: translateX(-50%) translateY(-5px);}
}

.btn-whatsapp:hover {
    background: #1ebe57;
}

.btn-primary:hover {
    background: #e67e00;
}

/* About Section */
.about {
    padding: 8rem 0;
    position: relative;
    overflow: hidden;
}

.about-watermark { /* Z-index changed to -1 */
    position: absolute;
    bottom: -10px;
    right: -20px;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(230, 126, 34, 0.2);
    /* -webkit-text-stroke: 1px rgba(0,0,0,0.1); */
    white-space: nowrap;
    pointer-events: none;
    z-index: -1; /* Watermark behind everything */
    will-change: transform;
}

.about-wrapper {
    max-width: 950px;
    margin: 0 auto;
}

.pillar-image { /* Positioned absolutely inside .about-frame, z-index 1 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    background: url('https://images.unsplash.com/photo-1639705912758-58cea537c203?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') no-repeat center center/cover;
    filter: grayscale(100%);
    transition: filter 0.5s ease;
    width: 80px; /* Adjusted width */
    height: 100%; /* Matches height of the frame */
    z-index: 1; /* Image sliver behind the border but above watermark */
}

.about-wrapper:hover .pillar-image {
    filter: grayscale(0%);
}

.about-frame {
    position: relative;
    z-index: 2; /* Orange Pillar (border) and frame content above image sliver */
    max-width: 850px; /* Adjusted to fit within wrapper */
    padding: 40px;
    padding-left: 120px;
    border-left: 6px solid #e67e22;
    border-top: 2px solid rgba(230, 126, 34, 0.3);
    background: transparent;
    text-align: left;
    box-shadow: -12px -5px 20px -12px rgba(230, 126, 34, 0.5); /* Orange glow specifically on the left border */
}

.about-heading {
    font-family: 'Montserrat', sans-serif; /* Keep font-family */
    font-size: clamp(1.5rem, 6vw, 2.2rem); /* Fluid typography */
    font-weight: 800;
    margin: 0 0 1.5rem 0; /* Aligned with pillar top */
    text-transform: uppercase;
    letter-spacing: 2px;
}

.about-heading span:first-child { color: var(--primary-color); }
.about-heading span:last-child { color: #e67e22; }

.about-frame p {
    max-width: 650px;
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: justify; /* Justified text */
    letter-spacing: 0.5px; /* Increased letter-spacing */
}

.about-detail {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-light);
    font-weight: bold;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.leadership-line {
    width: 40px;
    height: 2px;
    background: #e67e22;
    animation: heartbeat 2.5s ease-in-out infinite; /* Boosted intensity */
    transform-origin: left;
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.5); /* Added glow */
}

@keyframes heartbeat {
    0%, 100% { opacity: 0.4; transform: scaleX(1); filter: brightness(1); }
    50% { opacity: 1; transform: scaleX(1.2); filter: brightness(1.5); }
}

/* Services Section */
.services {
    padding: 4rem 0;
    background: var(--light-bg);
    border-top: 1px solid #edf2f7; /* New: Section Transition */
    background-image: radial-gradient(rgba(0,0,0,0.05) 1px, transparent 0);
    background-size: 40px 40px;
    position: relative;
}

/* Corner 'Viewfinder' Brackets */
.services-bracket-tl,
.services-bracket-br,
.services-bracket-tr,
.services-bracket-bl {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: rgba(230, 126, 34, 0.4);
    border-style: solid;
    z-index: 1; /* Ensure brackets are behind content and header */
}

.services-bracket-tl {
    top: 40px;
    left: 40px;
    border-width: 2px 0 0 2px; /* Top and Left borders */
}

.services-bracket-br {
    bottom: 40px;
    right: 40px;
    border-width: 0 2px 2px 0; /* Bottom and Right borders */
}

/* New: Top-Right Bracket */
.services-bracket-tr {
    top: 40px;
    right: 40px;
    border-width: 2px 2px 0 0; /* Top and Right borders */
}

/* New: Bottom-Left Bracket */
.services-bracket-bl {
    bottom: 40px;
    left: 40px;
    border-width: 0 0 2px 2px; /* Bottom and Left borders */
}

.services-container {
    max-width: 1240px; /* Accommodates 3x380px cards plus gaps and padding */
}

.services-header-frame {
    position: relative;
    max-width: 850px;
    margin: 0 auto 4rem auto;
    padding: 40px;
    padding-left: 120px;
    border-left: 6px solid #e67e22;
    border-top: 2px solid rgba(230, 126, 34, 0.3);
    background: transparent !important;
    text-align: left;
    box-shadow: -12px -5px 20px -12px rgba(230, 126, 34, 0.5); /* Orange glow specifically on the left border */
}

.pillar-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 100%;
    background: rgba(26, 42, 58, 0.05); /* Technical low-opacity gray */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.pillar-icon i {
    color: #e67e22;
    font-size: 2rem;
}

.services-heading {
    font-family: 'Montserrat', sans-serif; /* Keep font-family */
    font-size: clamp(1.5rem, 6vw, 2.2rem); /* Fluid typography */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.services-heading span:first-child { color: var(--primary-color); }
.services-heading span:last-child { color: #e67e22; }

/* Optimized Services Grid */
.services-grid {
    display: grid;
    /* This creates 3 equal columns on desktop */
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

/* The Magic Fix for the bottom 2 cards: */
/* We target the last two items and center them across the 3-column grid */
.services-grid .service-card:nth-child(4) {
    grid-column: 1 / 2;
    margin-left: 50%; /* Pushes the 4th card toward the center */
}

.services-grid .service-card:nth-child(5) {
    grid-column: 2 / 3;
    margin-left: 50%; /* Pushes the 5th card toward the center */
}

.service-card {
    /* Remove 'flex: 0 0 380px' - let Grid handle the width */
    width: 100%; 
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Tablet/Mobile Responsive Override */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        justify-content: center;
    }
    
    /* Reset the centering logic for smaller screens */
    .services-grid .service-card:nth-child(4),
    .services-grid .service-card:nth-child(5) {
        grid-column: auto;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    .service-card {
        max-width: 400px;
        margin: 0 auto;
    }
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.service-card-img-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9; /* Consistent aspect ratio for images */
    border-bottom: 4px solid var(--secondary-color);
}

.service-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.service-card:hover .service-card-img {
    transform: scale(1.05);
}

.category-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 12px;
    border-top: 2px solid var(--secondary-color);
    pointer-events: none;
}

.card-header {
    display: flex;
    align-items: center; /* Vertically align icon and text */
    margin-bottom: 1rem; /* Spacing below the header block */
}

.service-card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.service-icon {
    font-size: 2.0rem;
    color: var(--secondary-color);
    margin-right: 15px; /* Space between icon and h3 */
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.service-card h3 {
    color: var(--primary-color);
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem; /* Consistent font size for all service card headers */
    line-height: 1.2; /* Ensure good line spacing */
    flex-grow: 1; /* Allow h3 to take available space */
}

.service-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.service-items {
    list-style: none;
    padding: 0;
}

.service-items li {
    padding: 5px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #edf2f7;
    color: var(--text-dark);
}

.service-items li:last-child {
    border-bottom: none;
    margin-bottom: 15px;
}

/* Enquire Button Style (Main Page) */
.enquire-btn {
    margin-top: auto;
    /* margin: auto auto 0; Pushes to bottom and centers horizontally in flex */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255, 0.5);
    color: var(--text-dark);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 450;
    border: 2px solid var(--secondary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    /* width: fit-content; */
    min-width: 220px;
    font-family: inherit;
}

.enquire-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    /* transform: translateY(-2px); */
    font-weight: 500;
    color: var(--white);
}

button.enquire-btn i {
    margin-left: 10px;
    font-size: 1.2rem;
    margin-bottom: 0;
    color: inherit;
}

/* Specialised Divisions */
.specialised {
    padding: 6rem 0;
    background: var(--white);
}

.specialised-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.spec-box {
    position: relative;
    min-height: 400px;
    height: 100%; /* Ensures equal height in grid */
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    padding: 0; /* Resetting padding to let spec-content glass pane handle it */
    color: var(--white);
    z-index: 1;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Refined Scrim & Background Logic */
.spec-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -2;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.spec-box::after {
    display: none; /* Disabling old scrim in favor of the new spec-content glass effect */
}

.fire-safety::before { background-image: url('https://images.unsplash.com/photo-1618169734586-057a06792dcd?auto=format&fit=crop&w=800'); }
.artisan-training::before { background-image: url('https://images.unsplash.com/photo-1504328345606-18bbc8c9d7d1?auto=format&fit=crop&w=800'); }

.spec-box:hover {
    transform: scale(1.05);
}

.spec-box:hover::before { 
    transform: scale(1.1) rotate(1deg); 
}

.spec-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    height: 100%; 
    width: 60%; /* Create the 'pane' look */
    padding: 40px;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
}

.spec-text-container p {
    margin-bottom: 20px;
}

.spec-text-container ul {
    padding-left: 0;
    list-style: none;
}

.spec-text-container li {
    margin-bottom: 10px;
    width: 100%; /* Ensures content takes full width */
    z-index: 2;
    display: flex;
    align-items: center;
}

.spec-text-container li::before {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #e67e22;
    margin-right: 12px;
    font-size: 0.8rem;
}

.spec-box .card-header {
    text-align: center;
    margin-bottom: 20px; /* Separates header from content body */
    flex-shrink: 0; /* Prevents header from shrinking */
}

.spec-content i,
.spec-content h3 {
    text-shadow: 0 0 15px rgba(230, 126, 34, 0.6);
}

.spec-content i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 10px; /* Space between icon and h3 */
    margin-right: 15px; /* Added space between icon and h3 */
    flex-shrink: 0;
}

.spec-text-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 40px;
    border-radius: 15px;
    width: 100%;
}

/* Accordion */
.detailed-services {
    padding: 6rem 0;
    position: relative;
    background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
    overflow: hidden;
}

.detailed-services::before {
    content: '';
    position: absolute;
    left: 5%;
    top: 10%;
    bottom: 10%;
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(230, 126, 34, 0.5), transparent);
    z-index: 0;
}

.detailed-services::after {
    content: '';
    position: absolute;
    bottom: 40px;
    right: 40px;
    width: 30px;
    height: 30px;
    border-bottom: 2px solid rgba(230, 126, 34, 0.4);
    border-right: 2px solid rgba(230, 126, 34, 0.4);
    pointer-events: none;
}

.accordion {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.accordion-item {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

.accordion-item:has(.accordion-header.active) {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.accordion-header {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(0.9rem, 4vw, 1.1rem);
    font-weight: bold;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    border-left: 4px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.accordion-header.active {
    border-left: 6px solid #e67e22;
    padding-left: 25px;
}

/* Plus/Minus Icon */
.accordion-icon {
    position: relative;
    width: 20px;
    height: 20px;
}

.accordion-icon::before,
.accordion-icon::after {
    content: '';
    position: absolute;
    background-color: var(--text-dark);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    transition: 0.3s;
}

.accordion-icon::before { width: 14px; height: 2px; } /* Horizontal bar */
.accordion-icon::after { width: 2px; height: 14px; } /* Vertical bar */

.accordion-header.active .accordion-icon::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }
.accordion-header.active .accordion-icon::before { background-color: var(--secondary-color); } /* Horizontal bar */

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: var(--white);
    padding: 0 30px;
    box-sizing: content-box;
}

.accordion-content p {
    line-height: 1.6;
    max-width: 100%;
    margin: 0;
}

/* Contact & Footer */
.contact {
    padding: 4rem 0;
    /* background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%); */
    background-color: var(--white);
    position: relative;
    overflow: hidden;
}

.contact::after {
    content: '';
    position: absolute;
    right: 10%;
    top: 10%;
    bottom: 10%;
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(230, 126, 34, 0.5), transparent);
}

.contact-frame {
    position: relative;
    padding: 60px;
    z-index: 2;
}

.contact-frame::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-top: 6px solid var(--secondary-color);
    border-right: 6px solid var(--secondary-color);
}

.contact-frame::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border-bottom: 6px solid var(--secondary-color);
    border-left: 6px solid var(--secondary-color);
}

.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    align-items: flex-start; /* Added for layout balance */
    gap: 50px;
}

.contact-info {
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e2e8f0;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 30px); }
    100% { transform: translate(0, 0); }
}

.contact-info h3 {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.contact-info p {
    margin: 25px 0;
    font-size: 1rem;
    line-height: 1.8;
}

.info-divider {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 20px auto;
    width: 120px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.social-links a {
    width: 48px; /* Increased for mobile accessibility tap targets */
    height: 48px;
    /* border: 1px solid #e2e8f0;
    border-radius: 4px; */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
}

footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 20px 0;
    text-align: center;
    border-top: var(--secondary-color) 2px solid;
}

/* Forms */
.contact-form label {
    display: block;
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.required {
    color: #e53e3e;
    margin-left: 2px;
}

.contact-form input, .contact-form select, .contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 1.5rem;
    border: none;
    border-bottom: 2px solid #e2e8f0;
    background: transparent;
    color: var(--text-dark);
    font-family: inherit;
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-bottom: 2px solid var(--secondary-color);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.1);
}

/* Validation styles */
.contact-form input:not(:placeholder-shown):invalid,
.contact-form textarea:not(:placeholder-shown):invalid,
.contact-form select:invalid:not(:focus) {
    border-color: #e53e3e; /* Red for invalid */
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.2);
}

/*
.contact-form input:not(:placeholder-shown):valid,
.contact-form textarea:not(:placeholder-shown):valid,
.contact-form select:valid {
    border-color: #38a169; /* Subtle green for valid 
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}
*/

.contact-form textarea {
    resize: none; /* Prevent users from resizing textarea */
}

/* Styling for the select dropdown arrow */
.contact-form select {
    appearance: none; /* Remove default arrow */
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e67e22' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem; /* Make space for the custom arrow */
    /* Robust method to force text color inheritance in some browsers */
    color: transparent;
    text-shadow: 0 0 0 var(--text-dark);
}

/* Styling for the dropdown menu (options) - limited direct styling */
/* This will primarily style the <select> element itself, not the opened options list */
.contact-form select option {
    font-family: inherit;
    font-size: inherit;
    color: var(--text-dark); /* Default text color for options */
    background-color: var(--white); /* Match site background for options */
    padding: 8px 12px; /* Add padding for spacious feel */
    margin: 0; /* Ensure no default margins */
}

/* Selection Highlight Hack: Apply brand orange on hover/checked states */
.contact-form select option:hover,
.contact-form select:focus option:checked {
    background-color: var(--secondary-color);
    color: var(--white);
}

.social-icon, .info-icon {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Adds a slight professional 'snap' */
}

.social-icon:hover, .info-icon:hover {
    transform: scale(1.15);
}

.contact-info p a {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: color 0.3s ease;
}

.contact-info i {
    background: var(--secondary-color);
    color: var(--white);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.2);
}

.contact-info p a:hover {
    color: var(--secondary-color);
}

.contact-btns {
    display: flex;
    gap: 15px;
}

.contact-btns .btn {
    flex: 1;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.contact-btns .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.privacy-disclaimer {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 1.5rem;
    line-height: 1.4;
    opacity: 0.8;
}

.privacy-disclaimer a,
.text-link-btn {
    color: var(--secondary-color);
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    cursor: pointer;
    font-family: inherit;
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* WhatsApp Trigger & Morphing Logic */
.whatsapp-trigger {
    position: fixed;
    width: var(--wa-btn-size);
    height: var(--wa-btn-size);
    bottom: var(--wa-edge-margin);
    right: var(--wa-edge-margin);
    background-color: var(--whatsapp-green);
    color: var(--white);
    border-radius: 50%;
    border: #FFF solid 2px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.whatsapp-trigger:hover {
    transform: scale(1.2);
}

.whatsapp-trigger i {
    position: absolute;
    font-size: 26px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.whatsapp-trigger .close-icon {
    opacity: 0;
    transform: rotate(-180deg);
}

.whatsapp-trigger.is-active {
    background-color: var(--text-dark);
}

.whatsapp-trigger.is-active .whatsapp-icon {
    opacity: 0;
    transform: rotate(180deg);
}

.whatsapp-trigger.is-active .close-icon {
    opacity: 1;
    transform: rotate(0);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background-color: var(--secondary-color);
    border: 2px solid var(--white);
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 140, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 140, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 140, 0, 0); }
}

/* Backdrop Styles */
.whatsapp-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.whatsapp-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

/* WhatsApp Popup Styles */
/* Startup Flicker Fix: Added display: none; */
.whatsapp-popup {
    position: fixed;
    bottom: calc(var(--wa-edge-margin) + var(--wa-btn-size) + var(--wa-popup-gap));
    right: var(--wa-edge-margin);
    width: 320px;
    background: var(--white);
    border-radius: 16px;
    border: 2px solid var(--secondary-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 1001;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: none; /* Hidden by default to prevent flicker */
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--wa-edge-margin) - var(--wa-btn-size) - var(--wa-popup-gap) - 20px);
}

.whatsapp-popup.is-active {
    transform: translateY(0) scale(1);
    opacity: 1;
    display: flex; /* Show when active */
    visibility: visible;
}

.popup-header {
    background: var(--secondary-color); /* Specific Brand Orange */
    color: var(--white);
    padding: 20px;
    position: relative;
    flex-shrink: 0; /* Keeps header at top */
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00e676;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 230, 118, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.status-text { font-size: 10px; font-weight: bold; }
.popup-header h3 { margin: 5px 0; font-size: 18px; }
.popup-header p { margin: 0; font-size: 13px; opacity: 0.9; }

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.popup-body {
    padding: 10px;
    overflow-y: auto;
    flex-grow: 1;
}

.chat-card {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    background: #f0f2f5;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.chat-card:hover { background: #e4e6eb; }
.chat-card i { font-size: 20px; color: var(--secondary-color); margin-right: 15px; width: 25px; text-align: center; }
.chat-card-text strong { 
    display: block; 
    font-size: 14px; 
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-card-text span { font-size: 12px; color: var(--text-light); }

/* Privacy Policy Modal */
/* Startup Flicker Fix: Added display: none; */
.privacy-modal {
    visibility: hidden; /* Changed from display: none */
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px); /* Matched WhatsApp popup blur */
    -webkit-backdrop-filter: blur(4px); /* Matched WhatsApp popup blur */
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    display: none; /* Hidden by default to prevent flicker */
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out; /* Aligned transition duration and easing */
}

.privacy-modal.is-active {
    visibility: visible; /* Changed from display: flex */
    display: flex; /* Show when active */
    opacity: 1;
}

.modal-content {
    background-color: var(--white);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 12px;
    position: relative;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Aligned transition duration and easing */
}

.privacy-modal.is-active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    overflow-y: auto;
    max-height: calc(80vh - 80px);
    color: var(--text-dark);
    line-height: 1.7;
}


.copyright {
    color: #a0aec0; /* Lighter grey for better contrast on dark navy */
}

.copyright a:hover {
    color: var(--secondary-color);
}

/* Responsive Mobile */
@media (max-width: 992px) {
    :root {
        --wa-btn-size: 40px;
        --wa-edge-margin: 30px;
    }

    .specialised-grid, .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-info {
        padding-left: 0;
        border-left: none;
    }

    .technical-label,
    .contact::after {
        display: none;
    }

    .contact-frame { padding: 20px; }

    .service-card {
        flex: 1 1 100%;
        max-width: 400px;
        width: 100%;
        margin: 0 auto;
    }

    .logo span {
        /* Hide the text "Kwena Electrical & General Construction" */
        /* display: none;  */
        font-size: smaller;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 71px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        padding: 20px 0;
        border-bottom: var(--secondary-color) 1px solid;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-central-logo-wrap {
        width: 180px;
    }

    .whatsapp-trigger i { font-size: 20px; }

    .contact-btns {
        flex-direction: column;
    }

    footer p{
        margin-left: 1vw;
        margin-right: 1vw;
        font-size: 15px;
    }

    .notification-badge {
        width: 12px;
        height: 12px;
    }

    .services-bracket-tl,
    .services-bracket-br,
    .services-bracket-tr,
    .services-bracket-bl {
        position: absolute;
        width: 20px;
        height: 20px;
    }

    .services-bracket-tl {
        top: 10px;
        left: 10px;
    }

    .services-bracket-br {
        bottom: 10px;
        right: 10px;
    }

    /* New: Top-Right Bracket */
    .services-bracket-tr {
        top: 10px;
        right: 10px;
    }

    /* New: Bottom-Left Bracket */
    .services-bracket-bl {
        bottom: 10px;
        left: 10px;
    }
}

/* Mobile Landscape Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .whatsapp-popup {
        max-height: 75vh;
        width: 300px;
    }
    
    .popup-header {
        padding: 12px 20px;
    }

    .popup-header h3 { font-size: 16px; }
    .popup-header p { font-size: 11px; }

    .popup-body { padding: 5px 10px; }

    .chat-card {
        padding: 8px 12px;
        margin-bottom: 5px;
    }
}

/* Mobile Landscape Spacing */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding-top: 100px; /* Extra clearance for the navbar */
    }
    .hero-central-logo-wrap {
        width: 160px; /* Scaled down for shorter screens */
    }
}


@media (max-width: 571px) {
    .logo span {
        /* Hide the text "Kwena Electrical & General Construction" */
        display: none;
    }

    .pillar-image {
        display: none;
    }

    .about-frame {
        padding: 40px;
    }
}

/* Target Horizontal Mobile Specifically */
@media (min-width: 480px) and (max-width: 950px) {
    .services-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Force exactly 2 columns */
        gap: 20px;
        justify-items: center;
        align-items: stretch; /* Ensures cards in a row have equal height */
    }

    .service-card {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        height: 100%; /* Force cards to fill the grid cell height */
    }

    .detailed-services::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 125vh; /* Provides enough vertical runway for logo + text + buttons */
        padding-top: 120px; /* Clearance for navbar */
        padding-bottom: 80px; /* Space for the scroll chevron */
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Prevents awkward vertical stretching */
    }

    .hero-content h1 {
        font-size: 1.6rem; /* Slightly smaller to prevent excessive line breaks */
        padding: 0 10px;
    }

    .hero-btns {
        flex-direction: column; /* Stack buttons vertically on small mobiles */
        align-items: center;
        gap: 12px;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 280px; /* Uniform width for stacked buttons */
        min-width: unset; /* Remove the 240px min-width constraint */
    }

    .spec-content {
        width: 100% !important; /* Forces the glass effect to cover the entire card */
        background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 100%); /* Adjusted gradient for full coverage */
        padding: 30px 20px; /* Tighten padding for mobile screens */
        align-items: center; /* Center-align the text for a balanced mobile look */
        text-align: center;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        justify-content: center;
    }

    .spec-text-container ul {
        display: inline-block; /* Keeps bullet points centered but aligned with each other */
        text-align: left;
        margin: 0 auto;
    }

    .spec-box .enquire-btn {
        width: 100%; /* Makes the button easy to tap on mobile */
        margin-top: 25px;
    }

    .spec-text-container li {
        font-weight: 500;
    }

    .accordion-header {
        padding: 15px 20px;
        padding-left: 5px;
    }

    .accordion-content {
        padding: 0 20px;
    }
    
    .hero-central-logo-wrap {
        width: 160px; /* Slightly smaller logo on mobile to save vertical space */
        margin-bottom: -2px; /* Pulls the logo down to sit exactly on the bar */
        z-index: 10; /* Ensures the shield sits ON TOP of the glow bar */
    }

    .connection-pulse {
        bottom: 0px; /* Aligns the pulse precisely at the junction */
    }
    
    .hero-text-content {
        margin-top: 0; /* Remove any previous top margin to ensure the connection is tight */
        padding-top: 30px; /* Give the text some breathing room below the 'docked' logo */
    }

    .accordion-header.active {
        border-left: 5px solid #e67e22;
        padding-left: 5px;
    }

    /* .detailed-services::before {
        display: none;
    } */

    .detailed-services::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 10px;
        width: 20px;
        height: 20px;
        border-top: 2px solid rgba(230, 126, 34, 0.4);
        border-left: 2px solid rgba(230, 126, 34, 0.4);
        pointer-events: none;
        background: none;
    }

    .detailed-services::after {
        bottom: 10px;
        right: 10px;
        width: 20px;
        height: 20px;
    } 
        
    /* No need to explicitly set .spec-box width/height here as it's handled by grid and flex */
}

/* Portrait Mobile Optimization */
@media (max-width: 480px) {
    .hero {
        min-height: 100vh; /* Reset to 100vh for modern mobile browsers */
        height: auto;
        padding-top: 90px; /* Reduced from 120px */
        padding-bottom: 40px;
    }
    .hero-central-logo-wrap {
        width: 130px; /* Scaled down further for narrow screens */
        margin-bottom: -2px; /* Pulls the logo down to sit exactly on the bar */
    }
    .hero-text-content {
        padding: 30px 10px 20px 10px; /* Increased top padding for docked logo */
    }
}