/* /assets/css/style.css */

/* 1. CSS VARIABLES (The Foundation)
  These represent your brand colors and standard fonts. 
  If you ever need to change a color, you only change it here.
*/
:root {
    --brand-blue: #0310a9;
    --brand-red: #ff0000;
    --dark-gray: #3c3c3c;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border-color: #dddddd;
}

/* 2. GLOBAL RESETS
  This ensures the site looks consistent across all browsers
  and prevents unwanted margins or padding.
*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    color: var(--dark-gray);
    background-color: var(--light-bg);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensures footer stays at bottom */
}

a {
    text-decoration: none;
    color: var(--brand-blue);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-red);
}

/* 3. TOP UTILITY BAR
  The thin red bar at the very top of the site.
*/
.top-bar {
    background-color: var(--brand-red);
    color: var(--white);
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.top-bar a {
    color: var(--white);
    text-decoration: underline;
}

.top-bar a:hover {
    color: #ffd7d7;
}

/* 4. HEADER & NAVIGATION
  The sticky white area containing your logo and links.
*/
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000; /* Keeps the header above other content when scrolling */
}

.nav-container {
    max-width: 1600px; /* Increased for wider screens */
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
}

.logo-area {
    display: flex;
    flex-direction: column;
}

.logo-area img {
    max-height: 80px; /* Adjust this value if your logo looks too big or small */
    width: auto;
}

.tagline {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--brand-blue);
    margin-top: 5px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    font-weight: bold;
    color: var(--dark-gray);
    padding: 0.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a.active {
    border-bottom: 3px solid var(--brand-red);
    color: var(--brand-blue);
}

/* 5. MAIN CONTENT AREA
  The wrapper for the actual page content (everything between header and footer).
*/
main {
    flex: 1; 
    max-width: 1600px; /* Increased for wider screens */
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
}

/* Typography specifics */
h1, h2, h3 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    color: var(--brand-blue);
    font-size: 2.5rem;
}

h2 {
    color: var(--dark-gray);
    font-size: 1.8rem;
    border-bottom: 2px solid var(--brand-red);
    padding-bottom: 0.5rem;
    display: inline-block;
}

p {
    margin-bottom: 1.5rem;
}

/* 6. HOME PAGE SPECIFICS
  Styles specific to elements on the index page.
*/
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero-section h1 {
    margin-bottom: 1rem;
}

/* The Grid System for Products */
.product-grid {
    display: grid;
    /* This creates columns that auto-adjust based on screen size */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden; /* Keeps the overlay neatly inside the rounded corners */
}

.card a {
    display: block;
    padding: 2rem 1.5rem; /* Padding moved here so the overlay can stretch perfectly */
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.card img {
    max-width: 100%;
    height: auto;
}

/* --- NEW HOVER OVERLAY --- */
.card .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 16, 169, 0.95); /* RCS Brand Blue with slight transparency */
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease; /* Smooth fade animation */
    padding: 1.5rem;
}

.card:hover .overlay {
    opacity: 1; /* Shows on hover */
}

.card .overlay h3 {
    color: var(--white);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--brand-red);
    padding-bottom: 0.25rem;
    font-style: italic; /* This makes the text italic */
}

.card .overlay p {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.4;
}

.callout-box {
    text-align: center;
    margin: 4rem auto;
    padding: 2rem;
    background-color: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    max-width: 800px;
}

.callout-box h2 {
    color: var(--brand-red);
    font-size: 2.5rem;
    border-bottom: none;
}

/* 7. FOOTER
  The bottom section of the site.
*/
footer {
    background-color: #222222;
    color: var(--white);
    padding: 3rem 1rem;
    margin-top: auto; /* Ensures it stays at the bottom */
}

.footer-container {
    max-width: 1600px; /* Increased for wider screens */
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    text-align: center;
}

.footer-container h3 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-container p {
    margin-bottom: 0.5rem;
}

.footer-container a {
    color: #cccccc;
}

.footer-container a:hover {
    color: var(--white);
}

.dealers-wanted {
    border: 2px dashed var(--brand-red);
    padding: 1.5rem;
    border-radius: 8px;
}

.dealers-wanted h3 {
    color: var(--brand-red);
    text-transform: uppercase;
}

/* 8. MOBILE RESPONSIVENESS (Media Queries)
  When the screen shrinks below 768px (tablets/phones), apply these styles.
*/
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .nav-links {
        justify-content: center;
        gap: 0.8rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .callout-box h2 {
        font-size: 2rem;
    }
}

/* --- MODERN HERO SLIDER --- */
.slider-container {
    position: relative;
    max-width: 1600px; /* Increased for wider screens */
    margin: 0 auto 3rem auto;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    background-color: var(--dark-gray);
}

/* NEW: This creates a long track to hold all the slides side-by-side */
.slider-track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.8s ease-in-out;
}

.hero-slide {
    /* Each slide takes up exactly 100% of the container width */
    flex: 0 0 100%; 
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
}

/* (Note: We removed the .hero-slide.active block completely because we don't need opacity anymore) */

/* Dark overlay so white text is always readable */
.hero-slide::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.slide-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    padding: 2rem;
    max-width: 800px;
}

.slide-content h2 {
    color: var(--white);
    font-size: 3rem;
    border-bottom: none;
    margin-bottom: 0.5rem;
}

.slide-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.slider-btn {
    display: inline-block;
    background-color: var(--brand-red);
    color: var(--white);
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s;
}

.slider-btn:hover {
    background-color: #cc0000;
    color: var(--white);
}

@media (max-width: 768px) {
    /* Turns off the sticky header on mobile screens */
    header { position: static; }
    
    .slider-container { height: 350px; }
    .slide-content h2 { font-size: 2rem; }
}

/* 9. MEDIA PAGE STYLES */
.video-grid {
    display: grid;
    /* Auto-adjusts to 1 column on phones, 2 on desktop */
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Creates a perfect 16:9 ratio box that YouTube iframes stretch to fit */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; 
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    width: 100%;
    height: 250px;
    object-fit: cover; /* Crops image cleanly to fit the box without stretching */
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

/* --- LIGHTBOX MODAL (Image Zoom Overlay) --- */
.lightbox-modal {
    display: none; /* Hidden until clicked */
    position: fixed;
    z-index: 2000; /* Stays above the sticky header */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

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

.close-lightbox:hover {
    color: var(--brand-red);
}

@keyframes zoomIn {
    from {transform: scale(0.9); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

@media (max-width: 768px) {
    .video-grid { grid-template-columns: 1fr; }
    .gallery-item { height: 200px; }
}