/* ============================================
   K Stewart Electrical - Stylesheet
   Colors: Orange (#E8740C) & Navy (#1B2A4A)
   ============================================ */

/* --- CSS Variables --- */
:root {
    --orange: #E8740C;
    --orange-light: #F59E3F;
    --orange-dark: #C45F00;
    --navy: #1B2A4A;
    --navy-light: #2A3F6B;
    --navy-dark: #111D35;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.3s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--orange);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--orange-dark);
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--navy);
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: 1.1rem; }

/* --- Utility Classes --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.bg-light { background: var(--gray-50); }

.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header p {
    max-width: 600px;
    margin: 12px auto 0;
    color: var(--gray-500);
    font-size: 1.1rem;
}

.section-tag {
    display: inline-block;
    color: var(--orange);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--orange);
    color: var(--white);
    border-color: var(--orange);
}

.btn-primary:hover {
    background: var(--orange-dark);
    border-color: var(--orange-dark);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--navy);
}

.btn-outline-white {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline-white:hover {
    background: var(--white);
    color: var(--navy);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo-img {
    height: 70px;
    width: auto;
}

.nav-list {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--navy);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--orange);
    background: rgba(232, 116, 12, 0.08);
}

.header-cta {
    padding: 10px 24px;
    font-size: 0.9rem;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--navy);
    border-radius: 2px;
    transition: all var(--transition);
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-top: 80px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(27,42,74,0.88) 0%, rgba(27,42,74,0.6) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    color: var(--white);
    padding: 40px 0;
}

.hero-content h1 {
    color: var(--white);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 32px;
    opacity: 0.9;
    line-height: 1.7;
}

.hero-btns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.hero-licence {
    font-size: 0.9rem;
    opacity: 0.7;
    font-weight: 500;
    letter-spacing: 1px;
}

/* --- Page Hero (inner pages) --- */
.page-hero {
    background: var(--navy);
    padding: 120px 0 60px;
    margin-top: 80px;
    text-align: center;
}

.page-hero h1 {
    color: var(--white);
    margin-bottom: 12px;
}

.page-hero p {
    color: rgba(255,255,255,0.7);
    font-size: 1.15rem;
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.about-text h2 {
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 16px;
    color: var(--gray-600);
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 28px 0;
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--navy);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(232, 116, 12, 0.1);
    border-radius: 50%;
    color: var(--orange);
    flex-shrink: 0;
}

/* --- Services Overview (Homepage) --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.service-card {
    background: var(--white);
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all var(--transition);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(232, 116, 12, 0.1);
    border-radius: 50%;
    color: var(--orange);
    margin-bottom: 20px;
}

.service-card h3 {
    margin-bottom: 12px;
}

.service-card p {
    color: var(--gray-500);
    margin-bottom: 20px;
    line-height: 1.7;
}

.service-link {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--orange);
}

.service-link:hover {
    color: var(--orange-dark);
}

/* --- Service Detail (Services page) --- */
.service-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.service-detail-grid.reverse .service-detail-content {
    order: 1;
}

.service-detail-grid.reverse .service-detail-image {
    order: 2;
}

.service-detail-content h2 {
    margin-bottom: 16px;
}

.service-detail-content p {
    color: var(--gray-600);
    margin-bottom: 16px;
    line-height: 1.8;
}

.service-list {
    margin: 20px 0 24px;
}

.service-list li {
    position: relative;
    padding: 8px 0 8px 28px;
    font-weight: 500;
    color: var(--gray-700);
}

.service-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 10px;
    height: 10px;
    background: var(--orange);
    border-radius: 50%;
}

.service-detail-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    height: 450px;
    object-fit: cover;
}

/* --- Why Choose Us --- */
.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.why-item {
    text-align: center;
    padding: 32px 24px;
}

.why-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(232, 116, 12, 0.1);
    border-radius: 50%;
    color: var(--orange);
    margin-bottom: 16px;
}

.why-item h4 {
    color: var(--navy);
}

/* --- CTA Section --- */
.cta {
    background: var(--navy);
    color: var(--white);
}

.cta h2 {
    color: var(--white);
    margin-bottom: 12px;
}

.cta p {
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    margin-bottom: 28px;
}

.cta-btns {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Gallery --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(27, 42, 74, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.gallery-overlay span {
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 10px 24px;
    border: 2px solid var(--white);
    border-radius: var(--radius);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    text-align: center;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius);
    margin: 0 auto;
}

.lightbox-caption {
    color: var(--white);
    margin-top: 16px;
    font-size: 0.95rem;
    opacity: 0.8;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10001;
    transition: opacity var(--transition);
    line-height: 1;
}

.lightbox-close:hover { opacity: 0.7; }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    padding: 16px 20px;
    border-radius: var(--radius);
    transition: background var(--transition);
    z-index: 10001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* --- Contact Section --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-info h2 {
    margin-bottom: 12px;
}

.contact-info > p {
    color: var(--gray-500);
    margin-bottom: 28px;
}

.contact-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 36px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(232, 116, 12, 0.1);
    border-radius: var(--radius-lg);
    color: var(--orange);
    flex-shrink: 0;
}

.contact-card h4 {
    margin-bottom: 2px;
    font-size: 0.85rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-card a,
.contact-card p {
    color: var(--navy);
    font-weight: 600;
    font-size: 0.95rem;
}

.contact-card a:hover {
    color: var(--orange);
}

.service-areas h3 {
    margin-bottom: 8px;
}

.service-areas > p {
    color: var(--gray-500);
    margin-bottom: 12px;
}

.service-areas ul {
    margin-bottom: 12px;
}

.service-areas li {
    position: relative;
    padding: 4px 0 4px 20px;
    color: var(--gray-600);
}

.service-areas li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 8px;
    height: 8px;
    background: var(--orange);
    border-radius: 50%;
}

/* --- Contact Form --- */
.contact-form-wrap {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.contact-form-wrap h3 {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--navy);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-700);
    transition: border-color var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--orange);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-success {
    text-align: center;
    padding: 40px 20px;
    color: var(--orange);
}

.form-success h3 {
    color: var(--navy);
    margin: 16px 0 8px;
}

.form-success p {
    color: var(--gray-500);
}

/* --- Map --- */
.map-section {
    line-height: 0;
}

.map-section iframe {
    width: 100%;
    height: 400px;
}

/* --- Footer --- */
.footer {
    background: var(--navy-dark);
    color: rgba(255,255,255,0.7);
    padding-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 2px;
}

.footer-licence {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 16px;
}

.footer ul li {
    margin-bottom: 8px;
}

.footer ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer ul li a:hover {
    color: var(--orange);
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.footer-contact svg {
    flex-shrink: 0;
    color: var(--orange);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .about-grid {
        gap: 40px;
    }

    .services-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    .why-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-detail-grid {
        gap: 40px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    /* Mobile Nav */
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        box-shadow: var(--shadow-lg);
        transition: right var(--transition);
        z-index: 1000;
        padding: 100px 24px 24px;
    }

    .nav.open {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 4px;
    }

    .nav-link {
        padding: 14px 18px;
        font-size: 1.05rem;
        display: block;
    }

    .header-cta {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    /* Mobile overlay */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Hero */
    .hero {
        min-height: 70vh;
    }

    .hero-content {
        padding: 20px 0;
    }

    .hero-btns {
        flex-direction: column;
    }

    .hero-btns .btn {
        text-align: center;
        justify-content: center;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-image img {
        height: 300px;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    /* Why */
    .why-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .why-item {
        padding: 20px;
        display: flex;
        align-items: center;
        gap: 16px;
        text-align: left;
    }

    .why-icon {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    /* Service Detail */
    .service-detail-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .service-detail-grid.reverse .service-detail-content {
        order: 0;
    }

    .service-detail-grid.reverse .service-detail-image {
        order: 0;
    }

    .service-detail-image img {
        height: 300px;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-form-wrap {
        padding: 28px 24px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* Lightbox */
    .lightbox-prev,
    .lightbox-next {
        padding: 12px 14px;
        font-size: 1.5rem;
    }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        min-height: 60vh;
    }

    .page-hero {
        padding: 100px 0 40px;
    }

    .cta-btns {
        flex-direction: column;
        align-items: center;
    }
}