/* General Styles */
:root {
    --background-color: #f4f4f4; /* Changed to light gray */
    --background-color-rgb: 244, 244, 244; /* RGB values for background color */
    --text-color: #333333;
    --primary-color: #c00000; /* A deeper red */
    --primary-color-rgb: 192, 0, 0; /* RGB values for primary color */
    --primary-color-dark: #a00000; /* Darker shade for hover */
    --secondary-color: #666666;
    --light-gray: #f0f0f0;
    --border-color: #d2d2d7;
    --accent-color: #f9f9f9; /* Used for subtle backgrounds */
    --container-width: 1100px;
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Inter', sans-serif;
}

body {
    font-family: var(--body-font);
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 22px;
}

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

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

/* Header */
header {
    background: rgba(255, 255, 255, 0.95); /* Explicitly white background */
    backdrop-filter: saturate(180%) blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Always apply subtle shadow */
}

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

.logo img {
    height: 40px;
    vertical-align: middle;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--heading-font);
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 5px rgba(var(--primary-color-rgb), 0.3); /* Subtle text shadow on hover */
}

.menu-icon {
    display: none; /* Hidden by default */
    font-size: 28px;
    cursor: pointer;
    color: var(--text-color);
}

#darkModeToggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-left: 20px;
    transition: transform 0.2s ease;
}

#darkModeToggle:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    nav {
        justify-content: flex-end; /* Push content to the right */
    }
    nav .logo {
        margin-right: auto; /* Push logo to the left */
    }
    #darkModeToggle {
        margin-left: 10px; /* Add some space between icons */
    }
    .menu-icon {
        margin-left: 10px; /* Add some space between icons */
    }

    nav .nav-links {
        position: fixed;
        top: 0;
        left: -250px; /* Start off-screen */
        width: 250px; /* Width of the off-canvas menu */
        height: 100vh; /* Use viewport height */
        background-color: #ffffff; /* Use background-color variable */
        padding-top: 60px; /* Space for header */
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease; /* Smooth slide-in */
        z-index: 101; /* Above header */
        display: flex; /* Always flex, visibility controlled by 'left' */
        flex-direction: column;
        align-items: flex-start; /* Align items to the start */
        gap: 0; /* Reset gap */
    }

    .menu-icon {
        display: block; /* Show menu icon on small screens */
    }

    nav .nav-links.active {
        left: 0; /* Slide into view */
    }

    nav .nav-links li {
        width: 100%; /* Full width for menu items */
        text-align: left; /* Align text to the left */
        margin: 0; /* Remove vertical margin */
    }

    nav .nav-links li a {
        font-size: 18px;
        padding: 15px 20px; /* More padding for better touch targets */
        display: block;
        border-bottom: 1px solid var(--border-color); /* Separator */
    }
    nav .nav-links li:last-child a {
        border-bottom: none; /* No border for the last item */
    }
}

/* Hero Section */
.hero {
    padding-top: 150px;
    padding-bottom: 100px;
    text-align: center;
    background-color: #f9f9f9;
}

.hero h1 {
    font-family: var(--heading-font);
    font-size: 58px; /* Slightly reduced */
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--text-color);
}

.hero p {
    font-family: var(--body-font);
    font-size: 20px; /* Slightly reduced */
    margin-top: 20px;
    color: var(--secondary-color);
}

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

h2 {
    text-align: center;
    font-family: var(--heading-font);
    font-size: 42px; /* Slightly reduced */
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 42px;
    }

    .hero p {
        font-size: 18px;
    }

    h2 {
        font-size: 36px;
    }
}

/* Brands */
.brand-logos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.brand {
    background-color: transparent; /* No background */
    border: none; /* No border */
    border-radius: 0; /* No border-radius */
    padding: 0; /* No padding */
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Keep transitions if hover effects are desired */
}

.brand:hover {
    transform: none; /* No transform */
    box-shadow: none; /* No shadow */
}

.brand svg {
    border-radius: 10px;
}

.brand h3 {
    font-family: var(--heading-font);
    font-size: 32px;
    font-weight: 700;
    margin-top: 20px;
    color: var(--primary-color);
}

.brand p {
    font-family: var(--body-font);
    font-size: 18px;
    line-height: 1.6;
    color: var(--secondary-color);
    max-width: 350px;
    margin: 15px auto 0;
}

/* Contact Us */
#contact {
    background-color: var(--accent-color); /* Use accent-color variable */
}

.contact-info {
    text-align: center;
    margin-bottom: 40px;
}

.contact-info p {
    font-family: var(--body-font);
    font-size: 18px;
    margin: 10px 0;
    color: var(--secondary-color);
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    text-decoration: underline;
}

#contact-form {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
}

#contact-form input,
#contact-form textarea {
    background: transparent; /* No background */
    border: 1px solid var(--border-color); /* Keep a subtle border for definition */
    color: var(--text-color);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 0; /* No border-radius */
    font-family: var(--body-font);
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2); /* Subtle focus shadow */
}

#contact-form input.is-invalid,
#contact-form textarea.is-invalid {
    border-color: #e74c3c; /* Red border for invalid fields */
}

.error-message {
    color: #e74c3c; /* Red text for error messages */
    font-size: 14px;
    margin-top: -15px; /* Adjust spacing */
    margin-bottom: 15px;
    font-family: var(--body-font);
}

#contact-form button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 15px;
    font-family: var(--heading-font);
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease; /* Added transform */
}

#contact-form button:hover {
    background: var(--primary-color-dark); /* Use darker primary color */
    transform: translateY(-2px); /* Subtle lift effect */
}

/* Footer */
footer {
    background: var(--text-color); /* Use text-color for dark background */
    color: var(--accent-color); /* Use accent-color for light text */
    padding: 40px 0;
    font-family: var(--body-font);
    font-size: 14px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: left; /* Align text left within columns */
    margin-bottom: 30px;
}

.footer-section h4 {
    color: #ffffff;
    font-family: var(--heading-font);
    font-size: 18px;
    margin-bottom: 15px;
}

.footer-section p,
.footer-section ul {
    color: #cccccc;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-section ul li a {
    color: #cccccc;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block; /* Make links block level for better click area */
    margin-bottom: 8px;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color); /* Use border-color variable */
    color: var(--secondary-color); /* Use secondary-color variable */
}

.social-media {
    margin-top: 20px;
    display: flex; /* Use flexbox for social icons */
    justify-content: flex-start; /* Align icons to the left */
    gap: 15px; /* Space between icons */
}

.social-media a {
    color: var(--accent-color); /* Use accent-color variable */
    font-size: 22px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-media a:hover {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr; /* Stack columns on small screens */
        text-align: center; /* Center text on small screens */
    }

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

    .social-media {
        justify-content: center; /* Center social icons on small screens */
    }
}

/* Scroll-to-Top Button */
#scrollToTopBtn {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed position */
    bottom: 30px; /* Place the button at the bottom of the page */
    right: 30px; /* Place the button at the right */
    z-index: 99; /* Make sure it does not overlap */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background-color: var(--primary-color); /* Set a background color */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 15px 20px; /* Some padding */
    border-radius: 50%; /* Rounded shape */
    font-size: 24px; /* Increase font size */
    line-height: 1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

#scrollToTopBtn:hover {
    background-color: var(--primary-color-dark); /* Darker background on hover */
    transform: translateY(-3px);
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--background-color-rgb), 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
    opacity: 1; /* Initially visible */
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none; /* Allow clicks through once hidden */
}

.spinner {
    border: 8px solid var(--light-gray);
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark Mode Styles */
body.dark-mode {
    --background-color: #1a1a1a;
    --text-color: #f0f0f0;
    --secondary-color: #b0b0b0;
    --light-gray: #333333;
    --border-color: #444444;
    --accent-color: #2a2a2a;
}

body.dark-mode header {
    background: rgba(26, 26, 26, 0.95);
    border-bottom-color: var(--border-color);
}

body.dark-mode nav ul li a {
    color: var(--text-color);
}

body.dark-mode .menu-icon {
    color: var(--text-color);
}

body.dark-mode nav .nav-links {
    background-color: #1a1a1a;
}

body.dark-mode .hero {
    background-color: var(--accent-color);
}

body.dark-mode #products {
    background-color: var(--accent-color);
}

body.dark-mode .tab-button {
    color: var(--secondary-color);
}

body.dark-mode .tab-button.active {
    color: var(--primary-color);
}

body.dark-mode .product-image,
body.dark-mode .product-info {
    /* Removed background-color */
}

body.dark-mode #contact {
    background-color: var(--accent-color);
}

body.dark-mode #about-us,
body.dark-mode #products {
    background-color: transparent;
}

body.dark-mode #contact-form input,
body.dark-mode #contact-form textarea {
    background: var(--light-gray);
    border-color: var(--border-color);
    color: var(--text-color);
}

body.dark-mode footer {
    background: #000000; /* Even darker background for dark mode footer */
    border-top-color: var(--light-gray); /* Use light-gray for border in dark mode */
}

body.dark-mode .footer-section h4 {
    color: var(--text-color);
}

body.dark-mode .footer-section p,
body.dark-mode .footer-section ul li a {
    color: var(--secondary-color);
}

body.dark-mode .social-media a {
    color: var(--text-color);
}

body.dark-mode #scrollToTopBtn {
    background-color: var(--primary-color);
    color: var(--text-color);
}

body.dark-mode .spinner {
    border-color: var(--light-gray);
    border-top-color: var(--primary-color);
}
