/* =======================
   1. FONT & VARIABLES
   ======================= */

:root {
    /* NEW Colors for a LIGHT theme */
    --color-bg-white: #FFFFFF;
    /* Main background */
    --color-bg-offwhite: #F7F7F7;
    /* Secondary background for sections */
    --color-border-grey: #E0E0E0;
    /* Borders and subtle accents */
    --color-accent-green: #8ea50b;
    /* Primary green for CTAs and highlights */
    --color-text-dark: #36454F;
    /* Main text color (Charcoal) */
    --color-text-grey: #6c757d;
    /* Secondary text color */
    --color-text-on-accent: #FFFFFF;
    /* Text for on top of green buttons */
    --color-white-pure: #ffffff;

    /* NEW Fonts */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Poppins', sans-serif;
    --transition-speed: 0.4s;
}

/* =======================
   2. GLOBAL & RESET
   ======================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
    overflow-x: hidden; /* <-- ADD THIS LINE */
}

body {
    font-family: var(--font-secondary);
    font-size: 1.6rem;
    line-height: 1.7;
    color: var(--color-text-dark);
    background-color: var(--color-bg-white);
    overflow-x: hidden; /* <-- ADD THIS LINE (important for redundancy) */
    position: relative;  /* <-- This can help establish a solid positioning context */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    color: var(--color-text-dark);
    /* Dark titles */
    line-height: 1.2;
}

p {
    margin-bottom: 1.5rem;
    color: var(--color-text-grey);
    /* Grey for body text */
}

a {
    color: var(--color-accent-green);
    /* Links are green */
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    filter: brightness(1.1);
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 120rem;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding {
    padding: 8rem 0;
}

.section-title {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.section-subtitle {
    font-size: 1.8rem;
    color: var(--color-text-grey);
    opacity: 0.9;
    margin-bottom: 4rem;
}

.text-center {
    text-align: center;
}

/* Grid System (Restored) */
.grid {
    display: grid;
    gap: 4rem;
    align-items: center;
}

.grid--2-cols {
    grid-template-columns: 1fr;
}

.grid--3-cols {
    grid-template-columns: 1fr;
}

.grid--4-cols {
    grid-template-columns: repeat(2, 1fr);
}


/* =======================
   3. HEADER & NAVIGATION
   ======================= */
.header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 2rem 0;
    background-color: transparent;
    transition: background-color var(--transition-speed) ease, box-shadow 0.3s ease;
}

.header.scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* Add shadow on scroll */
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__logo {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-dark);
    z-index: 1001;
    
    /* --- NEW STYLES START HERE --- */
    
    /* 1. Use Flexbox to align the image and text */
    display: flex;
    align-items: center; /* This vertically centers them */
    gap: 1.2rem; /* This adds a nice space between the logo and text */
    text-decoration: none; /* Ensure no underline on the logo link */
}

/* 2. Style the logo image itself */
.header__logo img {
    height: 65px; /* Adjust the height of your logo as needed */
    width: auto;  /* Let the width adjust automatically to keep the aspect ratio */
}

.header__toggle {
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
}

.header__toggle img {
    width: 2.8rem;
    height: 2.8rem;
}

.header__toggle .icon-close {
    display: none;
}


/* Mobile Nav Overlay */
.header__nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-bg-white);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    visibility: hidden;
}

.header__nav .nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.header__nav .nav-links a {
    font-family: var(--font-primary);
    font-size: 2.4rem;
    color: var(--color-text-dark);
}

body.nav-open .header__nav {
    transform: translateX(0);
    visibility: visible;
}

body.nav-open .header__toggle .icon-hamburger {
    display: none;
}

body.nav-open .header__toggle .icon-close {
    display: block;
}

body.nav-open {
    overflow: hidden;
}


/* =======================
   4. HERO SECTION
   ======================= */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white-pure);
    overflow: hidden;
}

.hero__slideshow,
.hero__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero__slide {
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    transform: scale(1.05);
}

.hero__slide.active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 1.5s ease-in-out, transform 8s linear;
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.hero__content {
    position: relative;
    z-index: 2;
    padding: 0 2rem;
}

.hero__title {
    font-size: 5rem;
    margin-bottom: 1rem;
    color: var(--color-white-pure);
}

.hero__subtitle {
    font-size: 2.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    color: var(--color-white-pure);
}

.hero__nav-dots {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 1.5rem;
}

.hero__nav-dots .dot {
    width: 1.2rem;
    height: 1.2rem;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.hero__nav-dots .dot.active {
    background-color: var(--color-accent-green);
    transform: scale(1.2);
}

/* =======================
   5. BUTTONS & FORMS
   ======================= */
.btn {
    display: inline-block;
    padding: 1.2rem 3.2rem;
    font-size: 1.6rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 5rem;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn--gold {
    background-color: var(--color-accent-green);
    color: var(--color-text-on-accent);
    border-color: var(--color-accent-green);
}

.btn--gold:hover {
    background-color: transparent;
    color: var(--color-accent-green);
}

.btn--large {
    padding: 1.5rem 4rem;
    font-size: 1.8rem;
}

.btn--full {
    width: 100%;
    text-align: center;
}

/* Contact Form */
.contact-form .form-group {
    position: relative;
    margin-bottom: 2.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1.5rem;
    background-color: var(--color-white-pure);
    border: 1px solid var(--color-border-grey);
    border-radius: 5px;
    color: var(--color-text-dark);
    font-size: 1.6rem;
    font-family: var(--font-secondary);
    transition: border-color var(--transition-speed);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-accent-green);
}

.contact-form label {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    color: var(--color-text-grey);
    pointer-events: none;
    transition: all var(--transition-speed);
}

.contact-form input:focus+label,
.contact-form input:not(:placeholder-shown)+label,
.contact-form textarea:focus+label,
.contact-form textarea:not(:placeholder-shown)+label {
    top: -1rem;
    left: 1rem;
    font-size: 1.2rem;
    color: var(--color-accent-green);
    background-color: var(--color-bg-offwhite);
    padding: 0 0.5rem;
    z-index: 1;
}

.contact-form input:focus::placeholder,
.contact-form input:not(:placeholder-shown)::placeholder,
.contact-form textarea:focus::placeholder,
.contact-form textarea:not(:placeholder-shown)::placeholder {
    color: transparent;
}

/* =======================
   6. CONTENT SECTIONS
   ======================= */
.about-us__image-container {
    border-radius: 5px;
    overflow: hidden;
}

.about-us__content .certifications {
    margin-top: 3rem;
    font-size: 1.4rem;
    font-style: italic;
    opacity: 0.7;
}

.about-us__image-container video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the video cover the entire container */
    border-radius: 5px; /* Match the container's border-radius */
}

/* Services */
.services {
    background-color: var(--color-bg-offwhite);
}

.service-card {
    background-color: var(--color-white-pure);
    padding: 4rem;
    border-radius: 5px;
    border: 1px solid var(--color-border-grey);
     -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.service-card__icon {
    margin-bottom: 2rem;
}

.service-card__icon img {
    width: 5rem;
    height: 5rem;
}

.service-card__title {
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
    color: var(--color-accent-green);
}

/* Why Choose Us (Restored original stacked layout and grid) */
.why-us__subtitle {
    margin-bottom: 6rem;
}

.why-us__stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
    margin-top: 6rem;
}

.why-us__grid {
    /* This is the class used in the original HTML */
    display: grid;
    gap: 2rem;
    /* Adjusted gap */
    grid-template-columns: 1fr;
    /* Mobile default */
}

.why-us-card {
    width: 100%;
    max-width: 75rem;
    background: transparent;
    border-radius: 5px;
    border-left: 3px solid var(--color-accent-green);
    text-align: left;
    padding: 2rem;
}

.why-us-card h4 {
    font-size: 2rem;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
}

.why-us-card p {
    font-size: 1.5rem;
    opacity: 0.8;
}

/* Contact Section */
.contact {
    background-color: var(--color-bg-offwhite);
}

.contact__info address {
    font-style: normal;
    font-size: 1.8rem;
    line-height: 1.8;
}

/* Footer */
.footer {
    padding: 3rem 0;
    text-align: center;
    font-size: 1.4rem;
    color: var(--color-text-grey);
    border-top: 1px solid var(--color-border-grey);
}

/* =======================
   7. ANIMATIONS & PRELOADER
   ======================= */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}


@keyframes pulse {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

/* =======================
   8. MEDIA QUERIES (Layouts Restored)
   ======================= */
@media (min-width: 48em) {

    /* 768px */
    .section-title {
        font-size: 4.8rem;
    }

    .hero__title {
        font-size: 7rem;
    }

    .grid--2-cols {
        grid-template-columns: repeat(2, 1fr);
        gap: 6rem;
    }

    .grid--3-cols {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid--4-cols {
        grid-template-columns: repeat(4, 1fr);
    }

    .why-us__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 2 columns on tablet */
    .about-us__image-container {
        order: -1;
    }

    .header__toggle {
        display: none;
    }

    .header__nav {
        position: static;
        height: auto;
        width: auto;
        background: none;
        transform: none;
        visibility: visible;
    }

    .header__nav .nav-links {
        flex-direction: row;
        gap: 3rem;
    }

    .header__nav .nav-links a {
        font-size: 1.6rem;
        font-weight: bold;
        text-transform: uppercase;
        color: var(--color-text-dark);
        position: relative;
    }

    .header__nav .nav-links a::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: var(--color-accent-green);
        transform: scaleX(0);
        transform-origin: right;
        transition: transform var(--transition-speed) ease-out;
    }

    .header__nav .nav-links a:hover::after {
        transform: scaleX(1);
        transform-origin: left;
    }

    .nav-links .btn {
        margin-left: 2rem;
    }
}

@media (min-width: 75em) {

    /* 1200px */
    .section-padding {
        padding: 12rem 0;
    }

    .container {
        padding: 0;
    }

    .why-us__grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* 4 columns on desktop */
}

/* =======================
   9. PRODUCT & SERVICE DETAIL PAGES
   ======================= */
.service-card a.service-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.service-card__learn-more {
    display: inline-block;
    margin-top: 2rem;
    color: var(--color-accent-green);
    font-weight: bold;
    transition: transform var(--transition-speed) ease;
}

.service-card:hover .service-card__learn-more {
    transform: translateX(5px);
}

.detail-hero {
    height: 60vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white-pure);
    background-size: cover;
    background-position: center;
}

.service-detail-content .container,
.product-detail-content .container {
    max-width: 80rem;
}

.service-content-wrapper p,
.product-content p {
    font-size: 1.8rem;
    line-height: 1.8;
    color: var(--color-text-grey);
    margin-bottom: 2rem;
}

.service-content-wrapper h3,
.product-content h3 {
    font-family: var(--font-primary);
    color: var(--color-accent-green);
    font-size: 2.8rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.product-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 4rem;
}

.main-image-container { /* We need to style the container for the fallback */
    position: relative;
    width: 100%;
    padding-top: 75%; /* This creates a 4:3 aspect ratio (3 / 4 = 0.75) */
    overflow: hidden;
    border-radius: 5px;
}

.main-image {
    /* The image now fills the container */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: opacity 0.3s ease;
}

/* We still add the modern property for modern browsers */
@supports (aspect-ratio: 4/3) {
    .main-image-container {
        padding-top: 0; /* Turn off the old hack */
        aspect-ratio: 4/3;
    }
    .main-image {
        position: static; /* Let the aspect-ratio do the work */
    }
}

.thumbnail-strip {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.thumbnail {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumbnail.active {
    border-color: var(--color-accent-green);
}

.product-content h1 {
    font-size: 4.5rem;
    color: var(--color-accent-green);
    margin-bottom: 2rem;
}

.product-content h2 {
    font-size: 3rem;
    margin-top: 4rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border-grey);
    padding-bottom: 1rem;
}

.benefits-list {
    list-style: none;
    padding-left: 0;
}

.benefits-list li {
    padding-left: 2rem;
    position: relative;
    margin-bottom: 1rem;
}

.benefits-list li::before {
    content: '✓';
    color: var(--color-accent-green);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--color-border-grey);
    margin-bottom: 2rem;
}

.tab-link {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--color-text-grey);
    font-size: 1.6rem;
    font-weight: bold;
    position: relative;
    opacity: 0.7;
}

.tab-link.active {
    color: var(--color-text-dark);
    opacity: 1;
}

.tab-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-accent-green);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-link.active::after {
    transform: scaleX(1);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.5s;
}

.specs-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border-grey);
}

.specs-table td:first-child {
    font-weight: bold;
}

@media (max-width: 47.99em) {
    .tabs-nav {
        flex-wrap: wrap;
        border-bottom: none;
    }

    .tab-link {
        border-bottom: 2px solid var(--color-border-grey);
        flex-grow: 1;
        text-align: center;
    }

    .tab-link::after {
        height: 2px;
        bottom: -2px;
    }

    .tab-link.active {
        border-color: var(--color-accent-green);
    }
}

@media (min-width: 768px) {
    .product-gallery {
        grid-template-columns: 80px 1fr;
    }

    .thumbnail-strip {
        flex-direction: column;
        overflow-x: visible;
    }

    .thumbnail {
        width: 80px;
        height: 60px;
    }
}

/* Overflow fixes */
.service-content-wrapper,
.product-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all;
}

.service-content-wrapper img,
.product-content img {
    max-width: 100%;
    height: auto;
}

/* ==================================
   10. DROPDOWN MENU
   ================================== */
.nav-item-dropdown {
    position: relative;
}

@media (min-width: 48em) {
    .dropdown-toggle i {
        font-size: 0.8em;
        margin-left: 5px;
        transition: transform 0.3s;
    }

    .nav-item-dropdown:hover .dropdown-toggle i {
        transform: rotate(180deg);
    }

    .dropdown-menu {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--color-white-pure);
        list-style: none;
        padding: 1rem 0;
        margin-top: 10px;
        border-radius: 5px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        min-width: 220px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        border: 1px solid var(--color-border-grey);
    }

    .nav-item-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .dropdown-menu li a {
        padding: 0.8rem 1.5rem;
        display: block;
        color: var(--color-text-dark);
        white-space: nowrap;
    }

    .dropdown-menu li a:hover {
        background-color: var(--color-accent-green);
        color: var(--color-text-on-accent);
    }
}

@media (max-width: 47.99em) {
    .nav-item-dropdown>a.dropdown-toggle {
        display: block !important;
        font-size: 2.4rem;
        font-family: var(--font-primary);
    }

    .dropdown-menu {
        display: none;
        list-style: none;
        padding-left: 2rem;
        background: none;
        box-shadow: none;
    }

    .nav-item-dropdown.submenu-open>.dropdown-menu {
        display: block;
    }

    .dropdown-menu li a {
        font-size: 2rem;
        color: var(--color-text-grey);
    }
}

/* =======================================
   11. FLOATING ACTION BUTTONS
   ======================================= */

.floating-action-buttons {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999999; /* High z-index to be on top of most elements */
    display: flex;
    flex-direction: column; /* Stack the icons vertically */
    gap: 15px; /* Space between the icons */
}

.fab {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%; /* Make it a perfect circle */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: var(--color-white-pure);
    font-size: 2.8rem; /* Size of the icon */
    transition: all 0.3s ease;

    /* Entrance animation */
    transform: scale(0);
    animation: fab-scale-in 0.5s ease-out 1s forwards; /* Animate in after 1 second */
}

/* Specific colors for each button */
.fab-whatsapp {
    background-color: #25D366; /* Official WhatsApp green */
}

.fab-call {
    background-color: var(--color-accent-green); /* Use your brand's green */
}

/* Hover effect */
.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: var(--color-white-pure); /* Ensure icon color stays white on hover */
}

/* Keyframe animation for the entrance */
@keyframes fab-scale-in {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    .floating-action-buttons {
        bottom: 15px;
        right: 15px;
    }

    .fab {
        width: 55px;
        height: 55px;
        font-size: 2.4rem;
    }
}

/* =======================================
   12. GALLERY (OUR WORK) PAGE STYLES
   ======================================= */

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile-first: 1 column */
    gap: 2rem;
    margin-top: 4rem;
}

.gallery-item {
    /* display, width, margin, and break-inside are no longer needed */
    
    /* Card styling */
    background-color: var(--color-white-pure);
    border: 1px solid var(--color-border-grey);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Ensure images and videos fill their container */
.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item-info {
    padding: 1.5rem 2rem;
}

.gallery-item-info h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-dark);
}

.gallery-item-info p {
    font-size: 1.4rem;
    color: var(--color-text-grey);
    margin-bottom: 0;
}

/* Responsive columns for the grid */
@media (min-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =======================================
   13. CONTENT PROTECTION STYLES
   ======================================= */

/* --- 1. Prevent image selection and pointer events for casual users --- */
.gallery-item img,
.gallery-item video {
    pointer-events: none; /* Disables click/drag interaction on the element itself */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    user-select: none; /* Standard */
}

/* --- 2. Screenshot Blocking Overlay (Mobile-Only) --- */
@media (max-width: 768px) {
    #secure-wrapper {
        position: relative; /* Establish positioning context */
    }

    #secure-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: transparent; /* It's invisible */
        pointer-events: none; /* User can still interact with content underneath */
        
        /* The "magic" property that can block screenshots on some systems */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* =======================================
   14. LIGHTBOX GALLERY STYLES
   ======================================= */
/* --- 1. Styling for Video Thumbnails in the Grid --- */
.video-thumbnail-wrapper {
    position: relative;
    /* This removes the small gap that can appear under images */
    line-height: 0; 
}

.play-icon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* A gentle dark overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-white-pure);
    font-size: 4rem; /* Adjust size of the play icon */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
}

/* Show the play icon on hover */
.gallery-item-link:hover .play-icon-overlay {
    opacity: 1;
}


/* --- 2. Lightbox Overlay Styles --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 99990;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;

    /* --- START OF FIX --- */
    
    /* 1. By default, the lightbox is completely removed from the layout */
    display: none;
    
    /* 2. We will use an "active" class to control the fade-in animation */
    opacity: 0;
    transition: opacity 0.4s ease;

    /* --- END OF FIX --- */
}

/* 3. This new class will be added by JS to show the lightbox */
.lightbox.active {
    display: flex; /* Makes the lightbox visible */
}

/* 4. A separate class to control the fade-in for a smoother effect */
.lightbox.fade-in {
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background-color: var(--color-white-pure);
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    
    /* Animation for the content window */
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.visible .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background-color: var(--color-accent-green);
    color: var(--color-white-pure);
    border: none;
    border-radius: 50%;
    font-size: 2.8rem;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10; /* Ensure it's on top of the media */
}

.lightbox-media-container {
    max-height: 80vh; /* Limit media height */
    overflow: hidden;
    display: flex; /* Helps center content */
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-media-container img,
.lightbox-media-container video {
    max-width: 100%;
    max-height: calc(80vh - 4rem); /* Respect container padding */
    display: block;
    height: auto;
    width: auto;
}

.lightbox-title {
    padding: 1rem 2rem 2rem 2rem;
    font-size: 1.8rem;
    text-align: center;
    color: var(--color-text-dark);
    border-top: 1px solid var(--color-border-grey);
    margin: 0;
}

/* =======================================
   14. E-COMMERCE PRODUCTS & POPUP (CORRECTED)
   ======================================= */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 3rem; margin-top: 4rem; }
.product-card { background: var(--color-white-pure); border: 1px solid var(--color-border-grey); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; flex-direction: column; }
.product-card a { text-decoration: none; }
.product-card-image { aspect-ratio: 1/1; overflow: hidden; }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .product-card-image img { transform: scale(1.05); }
.product-card-content { padding: 2rem; flex-grow: 1; }
.product-card-content h3 { font-size: 2rem; color: var(--color-text-dark); margin-bottom: 1rem; }
.product-card-content p { font-size: 1.4rem; color: var(--color-text-grey); }
.product-card-footer { padding: 0 2rem 2rem 2rem; border-top: 1px solid var(--color-border-grey); }
.product-card-footer .btn { width: 100%; margin-top: 1.5rem; }

/* --- Popup Styles (THIS IS THE CRITICAL PART) --- */
.featured-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center; /* <-- CHANGE BACK to center */
    padding: 2rem;
    /* REMOVE overflow-y: auto; if it exists */

    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.4s, opacity 0.4s ease;
}

.featured-popup.is-visible {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.popup-content {
    background: var(--color-white-pure);
    padding: 3rem;
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.4s ease;
    
    /* --- START OF FIX --- */
    margin: auto 0; /* This helps with vertical centering on desktop */
    /* --- END OF FIX --- */
}

/* On desktop, we can re-center it if we want */
@media (min-height: 700px) { /* Only apply true vertical centering on taller screens */
    .featured-popup {
        align-items: center;
    }
}

.featured-popup.is-visible .popup-content {
    transform: translateY(0);
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 3rem;
    cursor: pointer;
    color: var(--color-text-grey);
}
.popup-content h2 { margin-bottom: 2rem; }
.popup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2rem; margin-bottom: 3rem; }
.popup-grid .product-card { box-shadow: none; }
.popup-grid .product-card-image { aspect-ratio: 1/1; }
.popup-grid h3 { font-size: 1.6rem; }

/* ===================================================
   15. RESPONSIVE FIXES FOR POP-UP ON MOBILE
   =================================================== */

@media (max-width: 576px) {

    /* Shrink the main content box padding */
    .popup-content {
        padding: 2rem 1.5rem;
    }

    /* Reduce the title size and spacing */
    .popup-content h2 {
        font-size: 2.4rem;
        margin-bottom: 1.5rem;
    }

    /* --- THIS IS THE KEY PART FOR THE 2x2 GRID --- */
    .popup-grid {
        /* Force a 2-column grid */
        grid-template-columns: repeat(2, 1fr);
        /* Reduce the gap between items */
        gap: 1.5rem;
        /* Reduce space below the grid */
        margin-bottom: 2.5rem;
    }

    /* Reduce the font size of the product titles inside the popup grid */
    .popup-grid h3 {
        font-size: 1.3rem;
        line-height: 1.4;
    }
    
    /* Shrink the "Show More Products" button */
    #show-more-products {
        font-size: 1.4rem;
        padding: 1rem 2rem;
    }
}