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

:root {
    --primary-green: #2D5016;
    --light-green: #4A7C3A;
    --accent-green: #6B9F5A;
    --primary-blue: #1E3A5F;
    --light-blue: #3A5F8F;
    --accent-blue: #5A8FBF;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --dark-gray: #333333;
    --text-gray: #666666;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

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

.nav-brand {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 1rem;
}

.logo-img {
    height: 80px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: none; /* Hidden by default, shown when loaded */
}

.logo-img.loaded {
    display: block; /* Show when successfully loaded */
}

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

.logo-text {
    color: var(--primary-green);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    display: block; /* Always visible as fallback */
}

/* Text visibility controlled by JavaScript */

.nav-brand .logo-link:hover .logo-text {
    color: var(--primary-green);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-green);
    transition: width 0.3s ease;
}

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

.nav-menu a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary-green);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-blue) 100%);
    color: var(--white);
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease 0.2s both;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background: var(--white);
    color: var(--primary-green);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.4s both;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Products Section */
.products-section {
    padding: 80px 0;
    background: var(--light-gray);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-green);
    margin-bottom: 3rem;
    font-weight: 700;
}

.products-grid {
    display: grid;
    gap: 3rem;
}

.product-category {
    background: var(--white);
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.category-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--light-green);
}

.category-header h3 {
    font-size: 2rem;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
}

.category-header p {
    color: var(--text-gray);
    font-size: 1.1rem;
}

.product-subsection {
    margin-bottom: 2rem;
}

.product-subsection:last-child {
    margin-bottom: 0;
}

.product-subsection h4 {
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid var(--accent-blue);
}

.product-display {
    display: grid;
    grid-template-columns: 1.3fr 1fr; /* Give images 30% more space (56.5% vs 43.5%) */
    gap: 2rem;
    align-items: center;
}

.product-images-container {
    width: 100%;
    min-height: 400px;
    overflow: hidden; /* Keep contained */
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
}

.placeholder-message {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-gray);
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
    border-radius: 10px;
    border: 2px dashed var(--light-green);
}

/* Carousel Styles */
.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden; /* Keep contained */
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden; /* Keep contained */
    border-radius: 10px;
}

.carousel-track {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-transition: -webkit-transform 0.5s ease-in-out;
    transition: -webkit-transform 0.5s ease-in-out;
    -o-transition: transform 0.5s ease-in-out;
    transition: transform 0.5s ease-in-out;
    transition: transform 0.5s ease-in-out, -webkit-transform 0.5s ease-in-out;
    gap: 0; /* Remove gap for seamless slides */
}

.carousel-slide {
    flex: 0 0 100%; /* Each slide takes full container width */
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    overflow: hidden; /* Clip larger images */
}

.carousel-image {
    width: 130%; /* Images are 30% larger within their contained slide */
    height: auto;
    min-height: 375px;
    aspect-ratio: 16/10; /* Modern browsers - well supported */
    -o-object-fit: cover;
    object-fit: cover;
    -o-object-position: center;
    object-position: center;
    border-radius: 10px;
    max-width: none; /* Allow images to be larger */
    margin: 0 auto; /* Center the larger image */
}

.carousel-btn {
    position: absolute;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.carousel-btn:hover:not(:disabled),
.carousel-btn:active:not(:disabled) {
    background: var(--primary-green);
    color: var(--white);
    -webkit-transform: translateY(-50%) scale(1.1);
    -ms-transform: translateY(-50%) scale(1.1);
    transform: translateY(-50%) scale(1.1);
    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-btn-prev {
    left: 10px;
}

.carousel-btn-next {
    right: 10px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--light-gray);
    border: 2px solid var(--primary-green);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--primary-green);
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: var(--light-green);
    transform: scale(1.1);
}

.gallery-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    background: var(--light-gray);
}

.gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 10;
    position: relative;
}

.gallery-image.loading {
    opacity: 0.5;
    background: linear-gradient(90deg, var(--light-gray) 25%, var(--white) 50%, var(--light-gray) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Lightbox for full-size image view */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--white);
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.lightbox-close:hover {
    transform: rotate(90deg);
}

.product-details h5 {
    font-size: 1.3rem;
    color: var(--dark-gray);
    margin-bottom: 1rem;
}

.view-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.color-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.projects-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-blue) 100%);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    font-family: 'Inter', sans-serif;
}

.projects-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--light-green) 0%, var(--light-blue) 100%);
}

.projects-btn.active {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-blue) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
}

.projects-btn .btn-icon {
    font-size: 1.2rem;
}

.projects-btn .btn-text {
    font-size: 1rem;
}

.color-option {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-option:hover {
    transform: scale(1.1);
    border-color: var(--primary-green);
}

.color-option.selected {
    border-color: var(--primary-blue);
    border-width: 4px;
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.selected-color {
    font-weight: 600;
    color: var(--primary-green);
    font-size: 1.1rem;
}

.selected-color .color-name {
    color: var(--primary-blue);
    text-transform: capitalize;
    font-weight: 600;
}

/* Accessories Section */
.accessories-section {
    padding: 80px 0;
    background: var(--white);
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.accessories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.accessory-category {
    background: var(--light-gray);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.accessory-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.accessory-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-green);
}

.accessory-header h3 {
    font-size: 1.8rem;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
}

.accessory-header p {
    color: var(--text-gray);
    font-size: 1rem;
}

.accessory-images-container {
    width: 100%;
    min-height: 200px;
}

/* About Section */
.about-section {
    padding: 80px 0;
    background: var(--light-gray);
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.about-intro {
    margin-bottom: 3rem;
    text-align: center;
}

.about-intro h3 {
    font-size: 2rem;
    color: var(--primary-green);
    margin-bottom: 1.5rem;
}

.about-intro p {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.welcome-section {
    margin: 4rem 0;
    padding: 3rem;
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
    border-radius: 15px;
}

.welcome-section h3 {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 2rem;
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h4 {
    font-size: 1.5rem;
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-gray);
    line-height: 1.7;
}

.decking-intro {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-blue) 100%);
    border-radius: 15px;
    color: var(--white);
}

.decking-intro h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.decking-intro p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Contact Section */
.contact-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.contact-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
}

.contact-item h4 {
    color: var(--primary-green);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.contact-item p {
    color: var(--text-gray);
    line-height: 1.8;
}

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

.contact-item a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* Footer */
.footer {
    background: var(--primary-green);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    height: 100px;
    width: auto;
    max-width: 350px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Makes logo white for footer */
}

/* Animations */
@-webkit-keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        -ms-transform: translateY(30px);
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        -ms-transform: translateY(0);
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .logo-img {
        height: 60px;
        max-width: 220px;
    }

    .logo-text {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .product-display {
        grid-template-columns: 1fr;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .product-images-container {
        min-height: 300px;
    }

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

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

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

    .section-title {
        font-size: 2rem;
    }

    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 2.5rem;
    }

    .footer-logo {
        height: 80px;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 50px;
        max-width: 180px;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .product-category {
        padding: 1.5rem;
    }

    .color-selector {
        justify-content: center;
    }

    .projects-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .projects-btn .btn-text {
        font-size: 0.9rem;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .carousel-slide {
        flex: 0 0 100%;
        overflow: hidden; /* Clip larger images */
    }

    .carousel-image {
        width: 130%; /* 30% larger on mobile too */
        margin: 0 auto; /* Center the larger image */
        min-height: 280px;
        aspect-ratio: 16/10;
        max-height: 400px;
    }

    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }

    .carousel-btn-prev {
        left: 5px;
    }

    .carousel-btn-next {
        right: 5px;
    }

    .product-images-container {
        min-height: 250px;
    }
}
