:root {
    --primary: #1B4332;
    --secondary: #2D5A3D;
    --accent: #52B788;
    --light: #D8F3DC;
    --dark: #081C15;
    --text: #212529;
    --gray: #6C757D;
    --white: #FFFFFF;
    --success: #40916C;
    --gradient-primary: linear-gradient(135deg, #1B4332 0%, #2D5A3D 50%, #40916C 100%);
    --gradient-secondary: linear-gradient(45deg, #2D5A3D 0%, #52B788 100%);
    --shadow-light: 0 4px 20px rgba(27, 67, 50, 0.1);
    --shadow-medium: 0 8px 30px rgba(27, 67, 50, 0.15);
    --shadow-heavy: 0 15px 50px rgba(27, 67, 50, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --top-banner-height: 35px;
}

/* Desktop and large screens: larger image sizing */
@media screen and (min-width: 1025px) {
    .modal-content-container {
        width: 98%;
        max-width: 1600px;
        height: 96%;
        max-height: 96vh;
        margin: 2vh auto;
    }
    .product-details-card {
        width: 350px; /* fixed sidebar width for more image space */
    }
    #galleryImage {
        max-width: calc(100vw - 120px);
        max-height: calc(100vh - 160px); /* more vertical space than mobile */
        width: auto;
        height: auto;
    }
}
/* Ensure anchored sections are fully visible below the fixed header */
#about, #services, #products, #contact {
    scroll-margin-top: calc(var(--header-height, 80px) + 8px);
}

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

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: linear-gradient(135deg, #f8fffe 0%, #e8f5f0 100%);
    overflow-x: hidden;
    position: relative;
}

/* Moving Banner Styles */
.moving-banner {
    width: 100%;
    background: var(--gradient-primary);
    color: var(--white);
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 100;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(27, 67, 50, 0.2);
    margin: 0;
    transform: translateZ(0); /* simpler GPU hint */
}

.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    height: var(--top-banner-height);
    min-height: var(--top-banner-height);
    max-height: var(--top-banner-height);
    background: linear-gradient(135deg, #1B4332 1px, #2D5A3D 50%, #40916C 100%);
    box-shadow: 0 1px 0 rgba(27, 67, 50, 0.25); /* bottom hairline masks subpixel gaps */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Hairline overlap to mask subpixel seams under banner */
.top-banner::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(135deg, #1B4332 1px, #2D5A3D 50%, #40916C 100%);
    pointer-events: none;
    opacity: 0.999;
}

/* Make bottom banner identical to top banner */
.bottom-banner {
    background: var(--gradient-primary) !important;
    height: var(--top-banner-height);
    min-height: var(--top-banner-height);
    max-height: var(--top-banner-height);
    color: var(--white);
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 100;
    font-weight: 500;
    font-size: 14px;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}
@media (max-width: 768px) {
    .bottom-banner {
        padding: 6px 0 !important;
        height: var(--top-banner-height) !important;
        min-height: var(--top-banner-height) !important;
        max-height: var(--top-banner-height) !important;
    }
}
@media (max-width: 480px) {
    :root { --top-banner-height: 34px; } /* slightly larger to avoid fractional px */
    .bottom-banner { padding: 4px 0 !important; }
}

.banner-content {
    display: inline-block;
    animation: scrollText 30s linear infinite;
    padding-left: 100%;
    will-change: transform;
    transform: translateZ(0);
}

.banner-content span {
    display: inline-block;
    letter-spacing: 1px;
}

@keyframes scrollText {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Adjust body padding for top banner */
body {
    padding-top: var(--top-banner-height);
}

/* Ensure no spacing between bottom banner and footer */
.bottom-banner {
    margin-bottom: 0 !important;
    padding-bottom: 8px !important;
}

footer {
    margin-top: 0 !important;
    padding-top: 60px !important;
}

/* Mobile specific fixes */
@media (max-width: 768px) {
    .bottom-banner {
        padding-bottom: 6px !important;
    }
    
    footer {
        padding-top: 40px !important;
    }
}

@media (max-width: 480px) {
    .bottom-banner {
        padding-bottom: 4px !important;
    }
    
    footer {
        padding-top: 25px !important;
    }
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Removed duplicate 'pulse' keyframes; kept single definition later */

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Scroll animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-slow);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

h1, h2, h3, h4, h5 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
}

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

/* Header Styles */
header {
    background: linear-gradient(135deg, #1B4332 1px, #2D5A3D 50%, #40916C 100%);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: var(--top-banner-height); /* sit directly below top banner */
    z-index: 1000;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    margin-top: 0; /* no overlap; hairlines handle seams */
    position: sticky;
}

/* Hairline overlaps to mask seams above and below header during resize */
header::before,
header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(135deg, #1B4332 1px, #2D5A3D 50%, #40916C 100%);
    pointer-events: none;
    opacity: 0.999;
}

header::before { top: -1px; }
header::after { bottom: -1px; }

@media (max-width: 991px) {
    header {
        padding: 0.8rem 0;
    }
}

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

/* Custom Logo */
.custom-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    gap: 15px;
    transition: var(--transition);
    animation: fadeInLeft 1s ease-out;
    -webkit-tap-highlight-color: transparent;
    /* avoid will-change to prevent composition jumps during resize */
}

.custom-logo:hover { transform: none; }

@media (max-width: 991px) {
    .custom-logo {
        transition: all 0.2s ease-out;
    }
    
    .custom-logo:hover {
        transform: scale(1.01);
    }
    
    .custom-logo:active {
        transform: scale(0.98);
        transition: all 0.1s ease-out;
    }
}

.logo-image {
    height: 80px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: var(--shadow-light);
}

.logo-image:hover { box-shadow: var(--shadow-medium); }

.logo-text { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; }

.logo-main {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--white);
    line-height: 1.1;
    transition: var(--transition);
    transform: translateZ(0);
}

.logo-tagline {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    margin-top: 3px;
    transition: var(--transition);
    transform: translateZ(0);
}

/* Tablet and larger mobile screens */
@media (max-width: 768px) {
    .logo-image {
        height: 90px;
        width: 90px;
        border-radius: 50%;
        object-fit: cover;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        align-self: center;
    }
    
    .logo-text { display: flex !important; flex-direction: column; text-align: center; justify-content: center; align-items: center; }
    
    .logo-main {
        font-size: 1.3rem;
        font-weight: 700;
        line-height: 1.1;
        letter-spacing: 0.5px;
    }
    
    .logo-tagline {
        font-size: 0.65rem;
        font-weight: 500;
        margin-top: 1px;
        opacity: 0.9;
        letter-spacing: 0.5px;
    }
}

/* Mobile portrait and smaller screens */
@media (max-width: 480px) {
    .custom-logo {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        margin: 0 auto;
    }

    .logo-image {
        height: 200px;
        width: 200px;
        border-radius: 50%;
        object-fit: cover;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        margin: 0 auto;
        padding: 0;
        display: block;
        line-height: 0;
        transform: none; /* prevent layout shift during resize */
    }
    
    .logo-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        margin: 6px 0 0 0;
        padding: 0;
        min-height: 40px; /* stabilize height to reduce vertical jitter */
    }
    
    .logo-main {
        font-size: 1.8rem;
        font-weight: 700;
        line-height: 0.9;
        letter-spacing: 0.5px;
        margin: 0;
        padding: 0;
    }
    
    .logo-tagline {
        font-size: 0.85rem;
        font-weight: 500;
        margin: 4px 0 0 0;
        padding: 0;
        line-height: 1.1;
        opacity: 0.9;
        letter-spacing: 0.5px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .logo-image {
        height: 110px;
        width: 110px;
        border-radius: 50%;
        object-fit: cover;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        align-self: center;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .header-container { padding: 0 20px !important; }
    .mobile-toggle { left: 8px !important; width: 36px !important; height: 36px !important; padding: 8px !important; }
    .hamburger-line { width: 16px !important; height: 2px !important; }
    .logo-image { height: 76px !important; width: 76px !important; }
    .logo-main { font-size: 1.35rem !important; line-height: 1.05 !important; }
    .logo-tagline { font-size: 0.68rem !important; line-height: 1.1 !important; }
    .custom-logo { gap: 0 !important; }
    .logo-text { margin-top: -2px !important; min-height: 26px !important; gap: 0 !important; }
    .logo-tagline { margin-top: 0 !important; }
    nav ul { width: 300px !important; top: 0 !important; padding-top: 75px !important; }
}

/* Smooth alignment during stacked->inline transition */
@media (min-width: 481px) and (max-width: 640px) {
    .custom-logo { gap: 8px; align-items: center; }
    .logo-text { margin-top: 0; justify-content: center; align-items: center; }
    .logo-main { line-height: 1.05; }
    .logo-tagline { margin-top: 0; }
}

/* Very small screens - horizontal orientation */
@media (max-width: 400px) {
    .header-container {
        padding: 0 50px !important;
    }
    
    .mobile-toggle {
        left: 6px !important;
        width: 32px !important;
        height: 32px !important;
        padding: 6px !important;
    }
    
    .hamburger-line {
        width: 14px !important;
        height: 1.5px !important;
    }
    
    .logo-image {
        height: 38px !important;
        width: 38px !important;
    }
    
    .logo-main {
        font-size: 1rem !important;
    }
    
    .logo-tagline {
        font-size: 0.5rem !important;
    }
    
    nav ul {
        width: 240px !important;
    }
}

/* Mobile portrait with desktop content - prevent overlap */
@media screen and (max-width: 991px) and (orientation: portrait) {
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    .hero {
        padding: 80px 20px 60px;
        min-height: 70vh;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 20px;
    }
    
    .hero p {
        font-size: 1.1rem;
        margin-bottom: 30px;
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .cta-button {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    
    .section-title h2 {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .section-title p {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .about-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .contact-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .contact-info {
        order: 2;
    }
    
    .contact-form {
        order: 1;
    }
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    animation: fadeInRight 1s ease-out 0.3s both;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px 20px;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    display: inline-block;
    -webkit-tap-highlight-color: transparent; /* prevent sticky highlight on touch */
}

/* Shimmer effect on hover */
nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

nav a:hover::before {
    left: 100%;
}

/* Bottom accent line */
nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 2px;
    left: 50%;
    background: var(--accent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px;
}

nav a:hover::after {
    width: 70%;
}

nav a.active::after {
    width: 0;
    background: var(--accent);
}

nav a.active:hover::after {
    width: 70%;
    background: var(--accent);
}

nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    color: var(--white);
}

nav a.active {
    background: transparent;
    color: var(--white);
}

nav a.active:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 1002;
    padding: 10px;
    border-radius: 12px;
    transition: var(--transition);
    position: relative;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    backdrop-filter: blur(10px);
    /* Prevent any unwanted scrolling behavior */
    outline: none;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.hamburger-line {
    width: 20px;
    height: 2.5px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mobile-toggle:hover .hamburger-line {
    background: var(--accent);
}

.mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-toggle:active {
    transform: scale(0.95);
}

/* Hamburger Animation States */
.mobile-toggle.active .hamburger-line:nth-child(1) {
    transform: none;
}

.mobile-toggle.active .hamburger-line:nth-child(2) {
    opacity: 1;
    transform: none;
}

.mobile-toggle.active .hamburger-line:nth-child(3) {
    transform: none;
}

/* Hide toggle button when active so no icon is visible */
.mobile-toggle.active {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Ensure mobile toggle doesn't inherit unwanted button behaviors */
.mobile-toggle {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    color: inherit !important;
    font: inherit !important;
    margin: 0 !important;
    padding: 10px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    vertical-align: baseline !important;
    text-align: center !important;
    text-decoration: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    /* Prevent any scroll behavior */
    scroll-behavior: auto !important;
    -webkit-overflow-scrolling: auto !important;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(27, 67, 50, 0.9), rgba(45, 90, 61, 0.8));
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--white);
    text-align: center;
    padding: 140px 20px;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 70%, rgba(82, 183, 136, 0.3) 0%, transparent 50%), 
                radial-gradient(circle at 70% 30%, rgba(64, 145, 108, 0.2) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

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

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--white);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease 0.2s both;
    font-weight: 700;
}

.hero p {
    font-size: 1.5rem;
    max-width: 800px;
    margin: 0 auto 3rem;
    font-weight: 300;
    animation: fadeInUp 1s ease 0.4s both;
    opacity: 0.95;
    line-height: 1.7;
}

.cta-buttons {
    animation: fadeInUp 1s ease 0.6s both;
}

.cta-button {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    padding: 16px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    border: 2px solid var(--accent);
    margin: 0 10px 10px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: var(--shadow-light);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--white);
    transition: var(--transition);
    z-index: -1;
}

.cta-button:hover::before {
    width: 100%;
}

.cta-button:hover {
    color: var(--primary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-heavy);
}

.cta-button.secondary {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.cta-button.secondary::before {
    background: var(--white);
}

.cta-button.secondary:hover {
    background: var(--white);
    color: var(--primary);
}

/* About Section */
.about {
    padding: 100px 0;
    background: var(--light);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 70%, rgba(82, 183, 136, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(64, 145, 108, 0.12) 0%, transparent 50%);
    opacity: 0.25;
    z-index: 0;
}

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

.section-title {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    display: inline-block;
    position: relative;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 70%;
    height: 4px;
    background: var(--secondary);
    bottom: -10px;
    left: 15%;
    border-radius: 2px;
    animation: expandLine 1.5s ease;
}

.about-content {
    display: flex;
    gap: 50px;
    align-items: center;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.info-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
    border-left: 4px solid var(--accent);
}

.info-card p {
    margin: 5px 0;
    font-size: 0.95rem;
}

.info-card strong {
    color: var(--dark);
}

.about-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

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

/* Services Section */
.services {
    padding: 100px 0;
    background: white;
    position: relative;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(27, 67, 50, 0.06), rgba(82, 183, 136, 0.06));
    opacity: 1;
    z-index: 0;
}

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

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

.service-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    text-align: center;
    padding: 40px 25px;
    border-bottom: 4px solid var(--secondary);
    position: relative;
    z-index: 1;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--light);
    z-index: -1;
    transition: var(--transition);
}

.service-card:hover::before {
    height: 100%;
}

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

.service-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.2);
    color: var(--accent);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

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

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image {
    height: 250px;
    background: #ffffff;
    overflow: hidden;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
    border: none;
    outline: none;
    box-shadow: none;
}

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

.product-card:hover .product-image img {
    transform: scale(1.03);
}

.product-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.product-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.product-card:hover {
    transform: translateY(-10px);
}

/* Contact Section */
.contact {
    padding: 100px 0;
    background: white;
    position: relative;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(27, 67, 50, 0.05), rgba(82, 183, 136, 0.05));
    opacity: 1;
    z-index: 0;
}

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

.contact-container {
    display: flex;
    gap: 50px;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary);
}

.contact-details {
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    margin-bottom: 20px;
    transition: var(--transition);
    padding: 15px;
    border-radius: 8px;
}

.contact-item:hover {
    background: var(--light);
    transform: translateX(5px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 15px;
    flex-shrink: 0;
    transition: var(--transition);
}

.contact-item:hover .contact-icon {
    background: var(--accent);
    transform: rotate(10deg);
}

.contact-text h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.contact-form {
    flex: 1;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 0;
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

@media (max-width: 900px) {
    .footer-container {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
}

@media (max-width: 600px) {
    .footer-container {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .footer-col {
        margin-bottom: 20px;
    }
    .footer-col:last-child {
        margin-bottom: 0;
    }
    .footer-content {
        padding-bottom: 0;
    }
    .logo-image {
        display: block;
        margin: 0 auto 20px auto;
        max-width: 120px;
    }
    
    /* Ensure moving banner is properly positioned on mobile */
    .bottom-banner {
        margin-top: 0;
        margin-bottom: 0;
        padding: 6px 0;
    }
    
    footer {
        padding: 40px 0 0;
        margin-top: 0;
    }
    
    /* Force remove any spacing between banner and footer */
    .bottom-banner + footer {
        margin-top: 0 !important;
        padding-top: 40px !important;
    }
}

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

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1532012197267-da84d127e765?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=10') center/cover;
    opacity: 0.05;
    z-index: 0;
}

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

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    position: relative;
    color: white;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background: var(--secondary);
    bottom: -10px;
    left: 0;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #aaa;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    transition: var(--transition);
    text-decoration: none;
}

.social-links a:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Lightbox effects (from enhanced-animations.css) */
@keyframes logoGlow {
    0% {
        box-shadow:
            0 0 50px rgba(82, 183, 136, 0.6),
            0 0 100px rgba(82, 183, 136, 0.4),
            0 0 150px rgba(82, 183, 136, 0.2),
            0 20px 40px rgba(0, 0, 0, 0.3);
        transform: scale(1);
    }
    100% {
        box-shadow:
            0 0 70px rgba(82, 183, 136, 0.8),
            0 0 140px rgba(82, 183, 136, 0.6),
            0 0 200px rgba(82, 183, 136, 0.4),
            0 25px 50px rgba(0, 0, 0, 0.4);
        transform: scale(1.02);
    }
}

@keyframes textGlow {
    0% { text-shadow: 0 0 20px rgba(82, 183, 136, 0.8); }
    100% {
        text-shadow:
            0 0 30px rgba(82, 183, 136, 1),
            0 0 40px rgba(82, 183, 136, 0.8),
            0 0 50px rgba(82, 183, 136, 0.6);
    }
}

/* Removed duplicate fadeInDown (not referenced) */

/* Removed duplicate fadeInUp (already defined at top) */

@keyframes expandLine {
    from { width: 0; }
    to { width: 70%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 0 30px;
    }
}

@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .hero {
        padding: 100px 20px;
        background-attachment: scroll;
    }
    
    .about-content,
    .contact-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .about-image {
        order: -1;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 991px) {
    /* Products section adjustments for mobile */
    .products {
        padding: 40px 0;
        overflow: hidden;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }
    
    .mobile-toggle {
        display: flex !important;
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
        margin: 0;
    }
    
    /* Center contact section on mobile */
    .contact-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .contact-info, 
    .contact-form {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .contact-details {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .contact-item {
        width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .contact-text {
        text-align: center;
    }
    
    .contact-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 10px 0;
    }
    
    .contact-icon {
        margin: 0 0 10px 0;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .contact-text h4 {
        margin-top: 5px;
    }
    
    /* Center info card in about section on mobile */
    .about .info-card {
        max-width: 400px;
        margin: 20px auto;
        text-align: center;
        padding: 20px;
    }
    
    .about .info-card p {
        text-align: left;
        display: inline-block;
        width: 100%;
    }
    
    /* Center footer content and make green line symmetrical */
    .footer-container {
        justify-items: center;
        text-align: center;
    }
    
    .footer-col {
        width: 100%;
        max-width: 300px;
        text-align: center;
        margin: 0 auto 30px;
    }
    
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-links {
        padding: 0;
        display: inline-block;
        text-align: center;
    }
    
    .footer-links li {
        text-align: center;
    }
    
    /* Center social media icons in footer */
    .social-links {
        justify-content: center;
        margin: 25px auto 0;
        width: 100%;
    }
    
    .social-links a {
        margin: 0 5px;
    }
    
    .header-container {
        padding: 0 48px; /* bring logo/text closer on small screens */
        position: relative;
        justify-content: center;
        align-items: center;
        min-height: 70px;
        gap: 8px;
    }
    
    .custom-logo {
        flex: 0 0 auto;
        justify-content: center;
        align-items: center; /* keep vertical centering when switching layout */
        gap: 6px; /* slightly tighter */
        min-width: 0;
        padding: 0;
        margin: 0 auto;
    }
    
    .custom-logo .logo-text {
        min-width: 0;
        flex-shrink: 0;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center; /* ensure text block is centered against logo */
    }
    
    nav ul {
        position: fixed;
        top: 0;
        left: -320px;
        flex-direction: column;
        background: rgba(27, 67, 50, 0.95);
        width: 300px;
        padding: 80px 20px 30px 20px;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        gap: 5px;
        height: 100vh;
        z-index: 1000;
        backdrop-filter: blur(20px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
        border-radius: 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Close button inside mobile menu */
    .mobile-close {
        position: absolute;
        top: 18px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.35);
        background: rgba(255, 255, 255, 0.08);
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0.55;
        cursor: pointer;
        z-index: 1100; /* above list items */
        transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
        backdrop-filter: blur(6px);
    }

    .mobile-close:hover { opacity: 0.85; }
    .mobile-close:active { transform: translateX(-50%) scale(0.96); }
    .mobile-close i { pointer-events: none; }
    
    nav ul.active {
        left: 0;
        transform: translateX(0);
    }
    
    nav ul li {
        margin: 8px 0;
        opacity: 0;
        transform: translateX(-20px);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    nav ul.active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    nav ul.active li:nth-child(1) { transition-delay: 0.1s; }
    nav ul.active li:nth-child(2) { transition-delay: 0.15s; }
    nav ul.active li:nth-child(3) { transition-delay: 0.2s; }
    nav ul.active li:nth-child(4) { transition-delay: 0.25s; }
    nav ul.active li:nth-child(5) { transition-delay: 0.3s; }
    
    nav a {
        font-size: 1rem;
        padding: 14px 20px; /* symmetric padding */
        border-radius: 10px;
        display: block;
        text-align: center; /* centered for symmetry */
        color: var(--white);
        margin: 2px 0;
        transition: all 0.2s ease-out;
        border-left: none; /* remove asymmetry */
        position: relative;
        left: 0; /* remove horizontal shift */
    }
    
    nav a:hover {
        background: rgba(255, 255, 255, 0.15);
        color: var(--white);
        transform: none; /* keep centered/symmetric */
    }
    
    /* Avoid sticky hover/active highlight on touch devices */
    @media (hover: none) {
        nav a:hover { background: transparent !important; }
    }
    
    /* Avoid default focus/active background so items don't appear selected unintentionally */
    nav a:focus,
    nav a:active {
        background: transparent !important;
        outline: none;
    }
    
    nav a.active {
        background: transparent;
        color: var(--white);
    }
    
    nav a.active:hover {
        background: rgba(255, 255, 255, 0.2);
        color: var(--white);
        transform: scale(1.05);
    }
    
    .hero {
        padding: 60px 15px;
        min-height: 80vh;
        background-attachment: scroll;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1.3rem;
        margin-bottom: 2rem;
    }
    
    .cta-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .cta-button {
        margin: 0;
        width: 80%;
        max-width: 300px;
        text-align: center;
        padding: 18px 24px;
    }
    
    .section-title h2 {
        font-size: 2.2rem;
    }
    
    .section-title p {
        font-size: 1.1rem;
    }
    
    .logo-text {
        display: flex;
        flex-direction: column;
        min-width: 140px; /* Ensure enough space for the tagline */
    }
    
    .logo-tagline {
        font-size: 0.65rem !important;
        white-space: nowrap;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* Removed unused slideInLeft keyframes */

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero {
        padding: 40px 10px;
    }
    
    .cta-button {
        width: 90%;
        font-size: 1rem;
        padding: 16px 20px;
    }
    
    .logo-image {
        height: 60px;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .mobile-toggle {
        font-size: 1.3rem;
    }
    
    nav a {
        font-size: 1.2rem;
        padding: 12px 16px;
    }
    
    /* Fix footer and moving banner spacing on small screens */
    footer {
        padding: 25px 0 0;
        margin-top: 0;
    }
    
    .bottom-banner {
        padding: 4px 0;
        margin-bottom: 0;
    }
    
    .moving-banner {
        padding: 4px 0;
    }
    
    /* Force remove any spacing between banner and footer */
    .bottom-banner + footer {
        margin-top: 0 !important;
        padding-top: 25px !important;
    }
}

/* Gallery Navigation Buttons */
.gallery-modal .prev,
.gallery-modal .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    color: var(--primary);
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s;
    user-select: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.gallery-modal .prev {
    left: 15px;
}

.gallery-modal .next {
    right: 15px;
}

/* Make buttons smaller on mobile */
@media (max-width: 768px) {
    .gallery-modal .prev,
    .gallery-modal .next {
        width: 32px;
        height: 32px;
        margin-top: -16px;
        font-size: 18px;
    }
    
    .gallery-modal .prev {
        left: 10px;
    }
    
    .gallery-modal .next {
        right: 10px;
    }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent);
    transform: translateY(-5px);
}

/* Enhanced Centered Notification */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background-color: var(--success);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(64, 145, 108, 0.4);
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 90vw;
    width: auto;
    animation: slideInDown 0.4s ease forwards, slideOutUp 0.4s ease 3.5s forwards;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-icon {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .notification {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: translateY(-100%);
        min-width: auto;
        max-width: none;
        padding: 10px 16px;
    }
    
    .notification-message {
        text-align: center;
    }
}

/* Removed unused slideInRight/slideOutRight keyframes */

@keyframes slideInDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes slideOutUp {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Removed duplicate modal rules (consolidated below) */


/* Product card styles */
.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image {
    width: 100%;
    height: 200px;
    background: #ffffff;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #f8f9fa;
}

/* Gallery modal styles */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.gallery-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

.modal-content-container {
    display: flex;
    width: 95%;
    max-width: 1400px;
    height: 95%;
    max-height: 95vh;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    position: relative;
}

.image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #f5f5f5;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    position: relative;
    perspective: 1000px;
    touch-action: pan-y;
    min-width: 0;
    box-sizing: border-box;
}

#galleryImage {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    touch-action: pan-y;
    transition: transform 0.2s ease-out;
    cursor: zoom-in;
}

#galleryImage.zoomed {
    cursor: zoom-out;
}

/* Cool slide/fade/blur animations for gallery transitions */
.img-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.slide-enter {
    opacity: 0;
    transform: translateX(40px); /* no scale/tilt to avoid zoomed-out look */
}
.slide-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.slide-exit {
    opacity: 1;
    transform: translateX(0);
}
.slide-exit-active {
    opacity: 0;
    transform: translateX(-40px);
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    .slide-enter,
    .slide-enter-active,
    .slide-exit,
    .slide-exit-active {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

.product-details-card {
    width: clamp(300px, 32vw, 380px);
    padding: 0;
    overflow: hidden;
    background: white;
    border-left: 1px solid #eee;
    position: relative;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.product-details-card::-webkit-scrollbar {
    width: 4px;
}

.product-details-card::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.product-details-card::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
}

.product-details-card h3 {
    color: var(--primary);
    margin: 0;
    padding: 15px 20px 10px;
    font-size: 1.25rem;
    line-height: 1.2;
    letter-spacing: 0.2px;
    border-bottom: 2px solid var(--light);
    position: sticky;
    top: 0;
    background: white;
    z-index: 3;
    line-height: 1.3;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.product-details {
    line-height: 1.7;
    color: var(--text);
    font-size: 0.95rem;
    padding: 0 30px 30px;
    overflow-y: auto;
    flex: 1;
    position: relative;
    z-index: 1;
}

.detail-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
    transition: all 0.3s ease;
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-item:hover {
    border-bottom-color: var(--primary-light);
}

.detail-item strong {
    color: var(--primary);
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.detail-item p {
    margin: 5px 0 0 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Animation for detail items */
@keyframes fadeInUpDetail {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-item {
    animation: fadeInUpDetail 0.4s ease-out forwards;
    animation-delay: calc(var(--index) * 0.1s);
    opacity: 0;
}

.close-gallery {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #333;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-gallery:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.gallery-content .prev,
.gallery-content .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.gallery-content .prev {
    left: 20px;
}

.gallery-content .next {
    right: 20px;
}

.gallery-content .prev:hover,
.gallery-content .next:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

/* Disabled state */
.prev[style*="pointer-events: none"],
.next[style*="pointer-events: none"] {
    opacity: 0.3 !important;
    cursor: not-allowed;
    transform: translateY(-50%) !important;
}

/* Responsive adjustments */
@media screen and (max-width: 1200px) {
    .modal-content-container {
        width: 95%;
        height: 85%;
    }
    
    .product-details-card {
        width: 300px;
        padding: 25px;
    }
}

@media screen and (max-width: 992px) {
    .modal-content-container {
        height: 90%;
    }
    
    .product-details-card {
        width: 280px;
        padding: 20px;
    }
    
    .product-details strong {
        min-width: 100px;
    }
}
/* Tablet portrait: stack like mobile (image on top, details below) */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    .modal-content-container {
        flex-direction: column;
        width: 98%;
        height: 92%;
        max-height: 92vh;
    }
    .image-container {
        width: 100%;
        min-height: 40vh;
        max-height: 55vh;
        padding: 16px;
    }
    #galleryImage {
        max-width: calc(100vw - 80px);
        /* subtract space for close button and bottom controls */
        max-height: calc(55vh - 40px);
        width: 100%;
        height: auto;
    }
    .product-details-card {
        width: 100%;
        border-left: none;
        border-top: 1px solid #eee;
        max-height: 45vh;
        overflow-y: auto;
        padding: 0;
    }
}

/* Large Tablets and Small Laptops (769px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .product-image {
        height: 300px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
        max-width: 1200px;
        margin: 40px auto 0;
    }
}

/* Standard Tablets (601px - 768px) */
@media screen and (min-width: 601px) and (max-width: 768px) {
    .product-image {
        height: 280px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 700px;
        margin: 40px auto 0;
    }
}

/* Small Tablets (481px - 600px) */
@media screen and (min-width: 481px) and (max-width: 600px) {
    .product-image {
        height: 240px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        max-width: 550px;
        margin: 30px auto 0;
    }
}

/* Mobile (up to 480px) */
@media screen and (max-width: 480px) {
    .product-image {
        height: 200px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        max-width: 350px;
        margin: 20px auto 0;
        gap: 20px;
    }
}

/* Modal responsive styles */
@media screen and (max-width: 768px) {
    /* Make gallery image comfortable on tablets */
    .modal-content-container {
        width: 98%;
        height: 96%;
        max-height: 96vh;
        margin: 2vh auto;
    }
    
    #galleryImage {
        max-width: 100%;
        max-height: 90vh;
        max-height: min(50vh, calc(100vh - 220px));
    }
    .gallery-content {
        /* reduce top padding to utilize space below close button */
        padding: 44px 16px 20px;
    }
    .modal-content-container {
        flex-direction: column;
        height: 90%;
        max-height: 90vh;
        width: 98%;
        overflow-y: auto;
        padding: 0;
    }
    
    .image-container {
        min-height: 200px;
        max-height: 55vh;
        padding: 20px;
        width: 100%;
    }
    
    .product-details-card {
        width: 100%;
        padding: 0;
        border-left: none;
        border-top: 1px solid #eee;
    }
    .product-details-card h3 {
        font-size: 1.05rem;
        padding: 12px 18px 10px;
        line-height: 1.2;
    }
    
    #galleryImage {
        max-height: min(50vh, calc(100vh - 220px));
        max-width: calc(100vw - 80px);
        width: 100%;
        height: auto;
    }
    
    .gallery-content .prev,
    .gallery-content .next {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: auto;
        bottom: 20px;
        transform: none;
        background: white;
        color: var(--primary);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        position: fixed;
    }
    
    .gallery-content .prev {
        left: 20px;
        right: auto;
        position: fixed;
    }
    
    .gallery-content .next {
        right: 20px;
        left: auto;
        position: fixed;
    }
    
    .gallery-content .prev:hover,
    .gallery-content .next:hover {
        background: var(--primary);
        color: white;
        transform: scale(1.1);
    }
    
    .close-gallery {
        top: 10px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        font-size: 28px;
        background: white;
        color: #333;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1200; /* above content but padding prevents overlap */
    }
    
    .close-gallery:hover {
        background: var(--primary);
        color: white;
    }
}

@media screen and (max-width: 767px) {
    .modal-content-container {
        width: 96%;
        height: auto;
        max-height: 90vh;
        margin: 10px auto;  /* Centered with equal top/bottom margin */
    }
    .gallery-content {
        padding: 20px 10px 20px;  /* Balanced top and bottom padding */
    }
    
    .image-container {
        min-height: 180px;
        padding: 15px;
    }
    
    .product-details-card {
        padding: 20px 15px;
    }
    
    .product-details-card h3 {
        font-size: 1rem;
        margin: 0;
        padding: 10px 16px 8px;
        line-height: 1.15;
    }
    
    .product-details {
        padding: 0 25px 25px;
    }
    
    .product-details strong {
        min-width: 90px;
        display: block;
        margin-bottom: 5px;
    }
    
    .gallery-content .prev,
    .gallery-content .next {
        width: 36px;
        height: 36px;
        font-size: 20px;
        top: auto;
        bottom: 15px;
        transform: none;
        position: fixed;
    }
    
    .gallery-content .prev:hover,
    .gallery-content .next:hover {
        transform: scale(1.1) translateZ(0);
        will-change: transform;
    }
    
    .close-gallery {
        width: 36px;
        height: 36px;
        font-size: 24px;
        top: 10px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

/* Animation for modal content */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content-container {
    animation: fadeInUp 0.4s ease-out forwards;
}

/* Smooth scrolling for details */
.product-details-card {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(0, 0, 0, 0.1);
}

.product-details-card::-webkit-scrollbar {
    width: 6px;
}

.product-details-card::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.product-details-card::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 3px;
}

/* Loading state for image */
.image-container.loading {
    position: relative;
    background: #f5f5f5;
}

.image-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Desktop and large screens: ensure larger image area overrides previous rules */
@media screen and (min-width: 1025px) {
    .modal-content-container {
        width: 90%;  /* Reduced from 95% */
        max-width: 1300px;  /* Reduced from 1400px */
        height: 92%;
        max-height: 92vh;
    }
    .gallery-content {
        padding: 16px 12px; /* tighter side gutters on desktop */
    }
    .product-details-card {
        width: 320px; /* slightly narrower sidebar to free space for image */
    }
    #galleryImage {
        max-width: calc(100vw - 120px) !important;
        max-height: 85vh !important; /* allow much taller image on desktop */
        width: auto;
        height: auto;
    }
    .image-container {
        padding: 16px; /* shrink internal padding around image */
    }
    .gallery-modal .prev { left: 10px; }
    .gallery-modal .next { right: 10px; }
}

/* Print styles */
@media print {
    .gallery-modal {
        position: static;
        display: block !important;
        background: white;
        height: auto;
    }
    
    .modal-content-container {
        flex-direction: row;
        height: auto;
        max-height: none;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .image-container {
        min-height: 400px;
    }
    
    .product-details-card {
        height: auto;
        overflow: visible;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .close-gallery,
    .gallery-content .prev,
    .gallery-content .next {
        display: none !important;
    }
}
