@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary: #E65100;
    --primary-dark: #BF360C;
    --secondary: #1A1A1A;
    --accent: #F5F5F7;
    --text-dark: #2D2D2D;
    --text-light: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --- Preloader --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: transparent;
}

.loader-panels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 1.2s cubic-bezier(0.85, 0, 0.15, 1);
}

.loader-panel {
    flex: 1;
    background-color: #ffffff;
    background-image: url('./img/white-horizontal-wood.png');
    background-size: 450px;
    background-repeat: repeat;
    border-bottom: 2px solid #f0f0f0;
    box-shadow: inset 0 -10px 20px rgba(0,0,0,0.02);
}

.preloader.fade-out {
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s 2s;
}

.preloader.fade-out .loader-panels {
    transform: translateY(-100%);
}

.loader-content {
    position: relative;
    z-index: 10000;
    text-align: center;
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.preloader.fade-out .loader-content {
    opacity: 0;
    transform: translateY(-50px);
}

.loader-logo {
    font-size: 2.8rem;
    margin-bottom: 30px;
}

/* Windows 10/11 style spinner */
.windows-spinner {
    position: relative;
    width: 50px;
    height: 50px;
    margin: 0 auto;
}

.windows-spinner .dot {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: rotate(225deg);
    animation: spinner-dots 5.5s infinite;
}

.windows-spinner .dot::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.windows-spinner .dot:nth-child(2) { animation-delay: 240ms; }
.windows-spinner .dot:nth-child(3) { animation-delay: 480ms; }
.windows-spinner .dot:nth-child(4) { animation-delay: 720ms; }
.windows-spinner .dot:nth-child(5) { animation-delay: 960ms; }

@keyframes spinner-dots {
    0% { transform: rotate(225deg); opacity: 1; animation-timing-function: ease-out; }
    7% { transform: rotate(345deg); animation-timing-function: linear; }
    30% { transform: rotate(455deg); animation-timing-function: ease-in-out; }
    39% { transform: rotate(570deg); animation-timing-function: linear; }
    70% { transform: rotate(815deg); opacity: 1; animation-timing-function: ease-out; }
    75% { transform: rotate(945deg); animation-timing-function: ease-out; }
    76% { transform: rotate(945deg); opacity: 0; }
    100% { transform: rotate(945deg); opacity: 0; }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: #ffffff;
}

h1, h2, h3 {
    font-weight: 800;
    line-height: 1.1;
}

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

ul {
    list-style: none;
}

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

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.9rem;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: #f8f8f8;
    color: var(--primary-dark);
}

.btn-outline {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.btn-outline:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: #ffffff;
    color: #ffffff;
}

/* --- Animations --- */

/* Garage Door Entrance */
@keyframes garageOpen {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

@keyframes panelReveal {
    0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
    100% { transform: scaleY(1); transform-origin: top; opacity: 1; }
}

.reveal-panel {
    animation: panelReveal 0.8s ease forwards;
    opacity: 0;
}

.reveal-panel[data-delay="1"] { animation-delay: 0.2s; }
.reveal-panel[data-delay="2"] { animation-delay: 0.4s; }
.reveal-panel[data-delay="3"] { animation-delay: 0.6s; }

/* Sections */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.section-title p {
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    padding: 15px 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: var(--transition);
}

header.scrolled {
    padding: 10px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.logo span {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a:hover {
    color: var(--primary);
}

.garage-panels {
    display: flex;
    gap: 2rem;
}

.g-panel {
    display: flex;
    align-items: center;
}

.g-panel a {
    color: var(--secondary);
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

/* Burger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--secondary);
    border-radius: 10px;
    transition: var(--transition);
}

/* Burger Animation */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background: var(--primary);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background: var(--primary);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    padding-top: 80px;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), 
                url('./img/mc-garage-door-hero.jpg') no-repeat center center/cover;
}

@media (min-width: 769px) {
    .hero {
        background-attachment: fixed;
    }
}

/* The "Garage Door" Overlay Animation */
.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 4.5rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    color: #ccc;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.hero-btns .btn-primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
}

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

.hero-btns .btn-outline {
    background: #ffffff;
    color: var(--primary);
    border: 1px solid #ffffff;
}

.hero-btns .btn-outline:hover {
    background: #f0f0f0;
    color: var(--primary-dark);
}

/* Gallery Section */
.gallery-section {
    padding: 100px 0;
    background: #fdfdfd;
    overflow-x: hidden; /* Prevent bleed on mobile carousel */
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.gallery-grid img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-overlay i {
    color: white;
    font-size: 2rem;
    transform: scale(0.5);
    transition: var(--transition);
}

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

.gallery-item:hover .gallery-overlay i {
    transform: scale(1);
}

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

/* Lightbox Modal Stylings */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    /* Perfect Centering */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.lightbox-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through to lightbox background for closing */
}

.lightbox-content, #lightbox-caption {
    pointer-events: auto; /* Re-enable for the actual content */
}

.lightbox-content {
    width: 80%;
    max-width: 1200px;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 10px;
    animation-name: zoom;
    animation-duration: 0.6s;
    cursor: zoom-in;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.lightbox-content.zoomed {
    transform: scale(1.6);
    cursor: zoom-out;
}

#lightbox-caption {
    width: 80%;
    max-width: 1200px;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.lightbox-content.zoomed + #lightbox-caption {
    opacity: 0;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--primary);
    text-decoration: none;
}

.lightbox-zoom {
    position: absolute;
    top: 20px;
    right: 90px;
    color: #f1f1f1;
    font-size: 24px;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-zoom:hover {
    color: var(--primary);
}

.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 2001;
    border: none;
    transform: translateY(-50%);
    border-radius: 5px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: var(--primary);
    color: #fff;
}

@media (max-width: 768px) {
    .lightbox-prev, .lightbox-next {
        padding: 12px;
        font-size: 20px;
        background-color: rgba(0, 0, 0, 0.5);
    }
    .lightbox-next { right: 10px; }
    .lightbox-prev { left: 10px; }
    .lightbox-content {
        width: 90%;
        max-height: 60vh;
    }
    .lightbox-content.zoomed {
        transform: scale(2.2);
    }
    #lightbox-caption {
        font-size: 0.9rem;
        width: 90%;
        padding: 10px 0;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding: 0 20px 20px;
        margin: 0 -20px; /* Bleed out to edges */
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }

    .gallery-grid::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }

    .gallery-item {
        min-width: 85%;
        scroll-snap-align: center;
        height: 250px;
    }
    
    .gallery-grid img {
        height: 100%;
    }
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--accent);
    padding: 40px;
    border-radius: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    background: #fff;
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.service-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    display: block;
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.service-card p {
    font-size: 0.95rem;
    color: #666;
}

/* About Section */
.about {
    background: var(--accent);
}

.about-flex {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-image {
    flex: 1;
    position: relative;
}

.about-image img {
    border-radius: 30px;
    box-shadow: var(--shadow);
    transform: scaleX(-1);
}

.about-content {
    flex: 1;
}

.about-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.badge {
    background: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* Contact Section */
.contact-flex {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 30px;
}

.contact-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    margin-bottom: 40px;
}

.info-item a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.info-item a:hover {
    color: var(--primary);
}

.info-item i {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
}


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

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

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
}

/* Map area */
.map-container {
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 60px;
}

/* Footer */
footer {
    background: var(--secondary);
    color: #fff;
    padding: 80px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 80px;
    margin-bottom: 60px;
}

.footer-col:nth-child(2),
.footer-col:nth-child(3) {
    text-align: right;
}

.footer-logo {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary) !important; /* MC in Orange */
}

.footer-logo span {
    color: #ffffff !important; /* GARAGE DOOR in White */
}

.footer-col h4 {
    margin-bottom: 25px;
    font-size: 1.1rem;
}

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

.footer-col ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: #333;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    text-decoration: none;
    font-size: 1.1rem;
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-3px);
    color: #fff;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #333;
    font-size: 0.9rem;
    color: #888;
}

/* --- Responsive --- */

@media (max-width: 992px) {
    .about-flex, .contact-flex {
        flex-direction: column;
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
    position: fixed;
    top: 55px; /* Stay below header */
    left: 0;
    width: 100%;
    height: calc(100vh - 55px);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    z-index: 1000;
    perspective: 1000px;
}

.nav-links.active {
    visibility: visible;
}

.garage-panels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; /* Stack vertically on mobile */
    gap: 0;
}

.g-panel {
    flex: 1;
    background: #ffffff;
    border-bottom: 2px solid #eee;
    transform: rotateX(-95deg);
    transform-origin: top;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-links.active .g-panel {
    transform: rotateX(0deg);
    opacity: 1;
}

/* Realistic cascading opening for panels */
.nav-links.active .g-panel:nth-child(1) { transition-delay: 0.0s; }
.nav-links.active .g-panel:nth-child(2) { transition-delay: 0.1s; }
.nav-links.active .g-panel:nth-child(3) { transition-delay: 0.2s; }
.nav-links.active .g-panel:nth-child(4) { transition-delay: 0.3s; }
.nav-links.active .g-panel:nth-child(5) { transition-delay: 0.4s; }
.nav-links.active .g-panel:nth-child(6) { transition-delay: 0.5s; }

.g-panel a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-links.active .g-panel a {
    opacity: 1;
    transform: translateY(0);
}

/* Link specific fade-in delays */
.nav-links.active .g-panel:nth-child(1) a { transition-delay: 0.1s; }
.nav-links.active .g-panel:nth-child(2) a { transition-delay: 0.2s; }
.nav-links.active .g-panel:nth-child(3) a { transition-delay: 0.3s; }
.nav-links.active .g-panel:nth-child(4) a { transition-delay: 0.4s; }
.nav-links.active .g-panel:nth-child(5) a { transition-delay: 0.5s; }

    .section-title h2 {
        font-size: 2rem;
    }
    
    footer .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .footer-col:first-child {
        grid-column: span 2;
        text-align: center;
        margin-bottom: 30px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-col:nth-child(2),
    .footer-col:nth-child(3) {
        text-align: center; /* Better for mobile 2-col layout */
    }

    .footer-col h4 {
        margin-bottom: 15px;
    }

    .contact-details-grid {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .service-card {
        padding: 20px 15px;
    }

    .service-card i {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }

    .service-card h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .service-card p {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}
