/* ========================================= */
/* --- CSS VARIABLES (Edit Site Here) --- */
/* ========================================= */
:root {
    /* --- COLORS (Light Mode Default) --- */
    --primary-color: #2c3e50;    /* Dark Slate Blue */
    --primary-hover: #34495e;    
    --accent-color: #2980b9;     /* Bright Blue Links */
    
    --text-main: #333333;        
    --text-light: #666666;       
    --text-inverse: #ffffff;     /* White text on dark bg */
    
    --bg-body: #f9f9f9;          /* Main Page Background */
    --bg-card: #ffffff;          /* White Cards */
    --bg-secondary: #eef1f3;     /* Light Grey for Showcase/Bubbles */
    --bg-footer: #1a1a1a;        
    
    --border-color: #eeeeee;     /* Card Borders */

    /* --- LAYOUT --- */
    --max-width: 1100px;
    --section-spacing: 60px;
    --border-radius: 8px;
    --main-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ========================================= */
/* --- DARK MODE OVERRIDES (Automatic) --- */
/* ========================================= */
@media (prefers-color-scheme: dark) {
    :root {
        /* Flip Colors for Dark Mode */
        --primary-color: #4a6fa5;    /* Lighter blue to pop on dark */
        --primary-hover: #5d82b8;
        --accent-color: #5dade2;     /* Bright Cyan/Blue */
        
        --text-main: #e0e0e0;        /* Off-white text */
        --text-light: #b0b0b0;       /* Light grey text */
        --text-inverse: #ffffff;     
        
        --bg-body: #121212;          /* Almost Black */
        --bg-card: #1e1e1e;          /* Dark Grey Cards */
        --bg-secondary: #252525;     /* Slightly lighter dark grey */
        --bg-footer: #000000;        
        
        --border-color: #333333;
    }
    
    /* Add transparency to images in dark mode so they aren't too jarring */
    img { opacity: 0.9; }
    img:hover { opacity: 1; }

    /* INVERT LOGO: Makes black text white */
    .logo-img img {
        filter: invert(1);
    }
}

/* ========================================= */
/* --- RESET & BASIC STYLES --- */
/* ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
    font-family: var(--main-font);
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth dark mode switch */
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- UTILITIES --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: var(--text-inverse);
    text-transform: uppercase;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.3s;
    cursor: pointer;
    border: none;
}

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

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--text-inverse);
    color: var(--text-inverse);
}

.btn-outline:hover {
    background-color: var(--text-inverse);
    color: #333; /* Always dark text on hover since button turns white */
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-padding {
    padding: var(--section-spacing) 0;
}

/* --- HEADER --- */
header {
    background-color: var(--bg-card);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

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

.logo-img img {
    max-height: 60px;
    display: block;
    transition: filter 0.3s ease;
}

.contact-bar {
    font-size: 0.9rem;
    text-align: right;
}

.contact-bar a {
    margin-left: 15px;
    font-weight: 600;
    color: var(--accent-color);
}

/* --- HERO SLIDESHOW CSS --- */
.hero {
    position: relative;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-inverse);
    overflow: hidden;
    
    /* IMAGE 1 (Base Layer) */
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                url('https://ckwindowcoverings.ca/img/ck-window-coverings-hero.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1; /* Establishes stacking context */
}

/* IMAGE 2 (Overlay Animation) */
.hero-bg-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                url('https://ckwindowcoverings.ca/img/ck-window-coverings-high-end.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1; /* Behind text, on top of base image */
    opacity: 0;
    animation: fadeEffect 12s infinite ease-in-out;
}

/* Keyframes for the fade */
@keyframes fadeEffect {
    0% { opacity: 0; }
    40% { opacity: 0; }  /* Stay hidden for 40% of time (showing Img 1) */
    50% { opacity: 1; }  /* Fade IN */
    90% { opacity: 1; }  /* Stay visible for 40% of time (showing Img 2) */
    100% { opacity: 0; } /* Fade OUT */
}

.hero-content {
    position: relative;
    z-index: 10; /* Ensures text is always on top */
}
.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- INTRO / TRUST --- */
.intro {
    text-align: center;
    background: var(--bg-card);
}

.intro p {
    max-width: 700px;
    margin: 0 auto 20px auto;
    color: var(--text-light);
}

.features-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.feature-item {
    background: var(--bg-secondary);
    padding: 15px 25px;
    border-radius: 50px;
    font-weight: 600;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

/* --- PRODUCTS GRID --- */
.products {
    background-color: var(--bg-card);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.product-img {
    height: 200px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-img img {
    height: 200px;
    width: 100%;
    object-fit: cover;
    display: block;
}

.product-info {
    padding: 20px;
    text-align: center;
}

.product-info h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.product-info p {
    color: var(--text-light);
}

/* --- INSTALLATION SHOWCASE --- */
.showcase-section {
    background-color: var(--bg-secondary);
}

.split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.split-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.split-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.split-item p {
    color: var(--text-main);
}

/* --- MOTORIZATION --- */
.motorization {
    background-color: var(--primary-color); 
    color: #ffffff; 
    text-align: center;
}

.motorization h2 {
    color: #ffffff;
}

.motorization p {
     color: #eeeeee;
}

.motorization-types {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.motor-type {
    max-width: 200px;
}

.motor-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

/* --- TESTIMONIALS --- */
.testimonials {
    background: var(--bg-card);
    text-align: center;
}

.testimonial-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.review {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 400px;
    font-style: italic;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.author {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    font-style: normal;
    color: var(--accent-color);
}

/* --- GALLERY --- */
.gallery-section {
    background-color: var(--bg-body);
    text-align: center;
}

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

.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--border-radius);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-grid img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

/* --- FOOTER --- */
footer {
    background-color: var(--bg-footer);
    color: #cccccc;
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid #333;
}

.footer-cta {
    margin-bottom: 30px;
}

.footer-cta h3 {
    color: #ffffff;
    margin-bottom: 15px;
}

.copyright {
    font-size: 0.8rem;
    margin-top: 20px;
    border-top: 1px solid #444;
    padding-top: 20px;
}

.copyright a {
    color: var(--accent-color);
    transition: color 0.3s;
}

.copyright a:hover {
    color: #ffffff;
}

/* --- MOBILE MEDIA QUERIES --- */
@media (max-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-bar {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
    }
    .contact-bar {
        margin-top: 10px;
        text-align: center;
    }
    .hero h1 { font-size: 2rem; }
    .motorization-types { flex-direction: column; align-items: center; }
    .split-grid { grid-template-columns: 1fr; gap: 30px; }
    .split-item img { height: 250px; }
}

@media (max-width: 600px) {
    .gallery-grid { grid-template-columns: 1fr; }
}