﻿/* ===================================
   CSS Variables & Design Tokens
   =================================== */
:root {
    /* Colors */
    /* Primary Color Configuration - Edit these to change the theme */
    --primary-hue: 239;
    --primary-saturation: 91%;
    --primary-lightness: 56%;

    --primary-color: hsl(var(--primary-hue), var(--primary-saturation), var(--primary-lightness));
    --primary-color-dark: hsl(var(--primary-hue), var(--primary-saturation), calc(var(--primary-lightness) - 10%));
    --primary-color-light: hsl(var(--primary-hue), var(--primary-saturation), calc(var(--primary-lightness) + 10%));

    --secondary-color: hsl(140, 80%, 40%);
    --secondary-color-dark: hsl(140, 80%, 30%);

    --accent-color: hsl(var(--primary-hue), 60%, 20%);
    --accent-color-dark: hsl(var(--primary-hue), 70%, 15%);

    --white: hsl(0, 0%, 100%);
    --light-gray: hsl(210, 20%, 95%);
    --medium-gray: hsl(210, 10%, 75%);
    --dark-gray: hsl(210, 10%, 30%);

    /* Typography */
    /* Typography */
    --font-family: 'Kanit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 800;
    /* Thicker bold */
    --font-weight-extrabold: 900;
    /* Maximum impact */

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 2px 4px hsla(0, 0%, 0%, 0.05);
    --shadow-md: 0 4px 12px hsla(0, 0%, 0%, 0.1);
    --shadow-lg: 0 8px 24px hsla(0, 0%, 0%, 0.15);
    --shadow-xl: 0 16px 48px hsla(0, 0%, 0%, 0.2);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ===================================
   Reset & Base Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--white);
    overflow-x: hidden;
    padding-top: 90px;
    /* Space for fixed navbar */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===================================
   Navigation Bar
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    height: 90px;
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0;
    height: 100%;
}

.nav-logo {
    height: 100%;
    display: flex;
    align-items: center;
    margin-right: 25px;
    /* Reserve space for the scaled logo */
}

.nav-logo a {
    font-size: 1.75rem;
    font-weight: var(--font-weight-extrabold);
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-logo a:hover {
    color: var(--primary-color-light);
}

.nav-logo img {
    height: 100%;
    max-height: 90px;
    /* Use full navbar height */
    width: auto;
    object-fit: contain;
    transform: scale(1.25);
    /* Make it visibly larger */
    transform-origin: left center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    list-style: none;
    margin: 0;
}

.nav-link {
    font-size: 1.05rem;
    /* Slightly larger */
    font-weight: 800;
    /* Extra Bold for thickness */
    color: var(--dark-gray);
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
    letter-spacing: 0.5px;
    /* Slight spacing for readability */
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--primary-color);
    transition: transform var(--transition-base);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-color-dark) 100%);
    color: var(--white) !important;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px hsla(140, 80%, 40%, 0.3);
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px hsla(140, 80%, 40%, 0.4);
    color: var(--white) !important;
}

.nav-icon {
    width: 1.125rem;
    height: 1.125rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.nav-toggle span {
    width: 28px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}


/* ===================================
   Typography
   =================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: var(--font-weight-bold);
    color: var(--accent-color-dark);
}

/* ===================================
   Container
   =================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-whatsapp {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-color-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 16px hsla(140, 80%, 40%, 0.3);
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px hsla(140, 80%, 40%, 0.4);
}

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

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* ===================================
   Hero Section with Carousel
   =================================== */
.hero {
    position: relative;
    /* Immersive full screen height minus navbar */
    height: calc(100vh - 90px);
    /* Fallback for older browsers */
    height: calc(100dvh - 90px);
    /* Modern dynamic viewport height */
    min-height: 500px;
    /* Prevent it from being too short on landscape phones */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Carousel Container */
.carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            hsla(var(--primary-hue), var(--primary-saturation), var(--primary-lightness), 0.45) 0%,
            hsla(215, 70%, 15%, 0.50) 100%);
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

/* Carousel Controls */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 50px;
    height: 50px;
    background: hsla(0, 0%, 100%, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid hsla(0, 0%, 100%, 0.3);
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-control:hover {
    background: hsla(0, 0%, 100%, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-control svg {
    width: 24px;
    height: 24px;
}

.carousel-control.prev {
    left: var(--spacing-lg);
}

.carousel-control.next {
    right: var(--spacing-lg);
}

/* Carousel Indicators */
.carousel-indicators {
    position: absolute;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: var(--spacing-sm);
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: hsla(0, 0%, 100%, 0.4);
    border: 2px solid hsla(0, 0%, 100%, 0.6);
    cursor: pointer;
    transition: all var(--transition-base);
    padding: 0;
}

.indicator:hover {
    background: hsla(0, 0%, 100%, 0.6);
    transform: scale(1.2);
}

.indicator.active {
    background: var(--white);
    width: 32px;
    border-radius: 6px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, hsla(215, 70%, 15%, 0.3) 100%);
    pointer-events: none;
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%,
            hsla(var(--primary-hue), var(--primary-saturation), var(--primary-lightness), 0.2) 0%,
            transparent 50%);
    pointer-events: none;
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: var(--spacing-3xl) 0;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: var(--font-weight-extrabold);
    color: var(--white);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 24px hsla(0, 0%, 0%, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    color: var(--white);
    margin-bottom: var(--spacing-xl);
    opacity: 0.95;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    animation: fadeIn Up 0.8s ease-out 0.4s both;
}

/* Alternative hero titles for slides 2-4 */
.hero-title-alt {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: var(--font-weight-extrabold);
    color: var(--white);
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 2px 24px hsla(0, 0%, 0%, 0.3);
    animation: fadeInUp 0.8s ease-out;
    text-align: center;
}

.hero-quote {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--white);
    opacity: 0.95;
    font-style: italic;
    font-weight: var(--font-weight-light);
    text-align: center;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* ===================================
   Sections
   =================================== */
.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: var(--font-weight-bold);
    color: var(--accent-color-dark);
    margin-bottom: var(--spacing-xl);
    position: relative;
    padding-bottom: var(--spacing-md);
    display: inline-block;
}

/* Animated golden underline */
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg,
            transparent 0%,
            hsl(45, 100%, 50%) 20%,
            hsl(40, 100%, 45%) 50%,
            hsl(45, 100%, 50%) 80%,
            transparent 100%);
    animation: lineExpand 1.5s ease-out forwards;
}

@keyframes lineExpand {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
        max-width: 200px;
    }
}

.section-title.centered {
    display: block;
    text-align: center;
}

.section-title.white {
    color: var(--white);
}

/* ===================================
   About Section
   =================================== */
.about {
    padding: var(--spacing-3xl) 0;
    background: var(--light-gray);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}



.about-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--dark-gray);
}

.about-text strong {
    color: var(--primary-color);
    font-weight: var(--font-weight-bold);
}

.about-image-wrapper {
    position: relative;
    /* Ensure shadows from children don't get clipped if we had overflow hidden here */
}

.about-image {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

/* SICEP Seal Animation */
.sicep-seal {
    position: absolute;
    bottom: -40px;
    right: -80px;
    width: 320px;
    z-index: 10;
    opacity: 0;
    transform: scale(2);
    /* Initial state for stamp animation */
    pointer-events: none;
    /* Let clicks pass through to image/wrapper if needed */
}

.sicep-seal.stamped {
    animation: stampIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.sicep-seal img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
}

@keyframes stampIn {
    0% {
        opacity: 0;
        transform: scale(3) rotate(-15deg);
    }

    70% {
        opacity: 1;
        transform: scale(0.9) rotate(2deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@media (max-width: 768px) {
    .sicep-seal {
        width: 220px;
        right: -60px;
        bottom: -30px;
    }

    .about-image-wrapper {
        overflow: visible;
        /* Ensure seal can be seen */
    }

    /* Prevent horizontal scroll if seal sticks out too much */
    .about-grid {
        overflow-x: clip;
        padding: 10px;
        /* Add padding to prevent cut off */
    }
}

/* ===================================
   Mission & Vision Section
   =================================== */
.mission-vision {
    padding: var(--spacing-3xl) 0;
    background: var(--white);
}

/* Clean Grid Layout */
/* Horizontal Scroll Layout for > Mobile */
.services-grid {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding: 1rem 1rem 2rem 1rem;
    /* Extra bottom padding for visible scrollbar */
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* smooth scrolling on iOS */
}

/* Custom Scrollbar ("Indicador") */
.services-grid::-webkit-scrollbar {
    height: 10px;
}

.services-grid::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 5px;
    margin: 0 1rem;
    /* spacing from edges */
}

.services-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    /* Your primary color for the indicator */
    border-radius: 5px;
    border: 2px solid var(--light-gray);
    /* Creates a padded look */
}

.services-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color-dark);
}

/* Service Card adjustments for flex layout */
.service-card {
    /* Keep existing styles, add flex properties */
    background: #ffffff;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: auto;
    /* Allow height to fit content, or 100% of parent */
    position: relative;
    overflow: hidden;

    /* Flex specific */
    flex: 0 0 calc((100% - 4rem) / 3);
    /* Default to 3 cards: (100% - 2 gaps of 2rem) / 3 */
    scroll-snap-align: start;
}

/* Tablet/Laptop: Show 2 cards */
@media (max-width: 1200px) and (min-width: 769px) {
    .service-card {
        flex: 0 0 calc((100% - 2rem) / 2);
        /* (100% - 1 gap of 2rem) / 2 */
    }
}

/* Mobile specific overrides */
@media (max-width: 768px) {
    .services-grid {
        display: grid;
        grid-template-columns: 1fr;
        overflow-x: visible;
        /* No scroll on mobile, just stack */
        padding-bottom: 1rem;
    }

    .service-card {
        width: 100%;
        flex: none;
        /* Reset flex */
    }

    .service-arrow {
        display: none !important;
    }
}

/* Services Carousel Controls */
.services-carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    width: 100%;
}

.services-grid {
    flex: 1;
    width: 100%;
    /* Ensure it takes available width */
}

.service-arrow {
    background: var(--white);
    border: 1px solid var(--medium-gray);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.service-arrow:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: scale(1.1);
}

.service-arrow svg {
    width: 20px;
    height: 20px;
}



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

/* Animated Bottom Line */
.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 4px;
    background-color: var(--primary-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateX(-50%);
}

.service-card:hover::after {
    width: 100%;
}

.service-icon {
    width: 260px;
    /* Increased to 260px */
    height: 260px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    background-color: transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    padding: 4px;
    /* Reduced from 8px to maximize image */
}

.service-card:hover .service-icon {
    background-color: var(--primary-color);
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: none;
    transition: transform 0.4s ease;
}

.service-card:hover .service-icon img {
    transform: scale(1.15);
    /* filter: brightness(0) invert(1); Optional: if user wants icon white on blue */
}

/* ===================================
   Service Modal Specific Styles
   =================================== */
.service-modal-content {
    max-width: 900px;
    /* Wider modal for 2 columns */
    padding: 0;
    overflow: hidden;
    /* For image corners */
    display: flex;
    flex-direction: column;
}

.service-modal-body {
    display: flex;
    padding: 0;
    align-items: stretch;
}

.service-modal-image {
    flex: 1;
    min-width: 40%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.service-modal-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    /* Or cover depending on image aspect ratio preference */
    border-radius: var(--radius-lg);
}

.service-modal-text {
    flex: 1.5;
    padding: 3rem;
    overflow-y: auto;
    max-height: 80vh;
    /* Scrolly text if too long */
}

.service-modal-text h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
}

.service-modal-text h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
}

.service-modal-text p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

/* Responsive Service Modal */
@media (max-width: 768px) {
    .service-modal-body {
        flex-direction: column;
    }

    .service-modal-image {
        min-height: 200px;
        padding: 1.5rem;
        background-color: #f9f9f9;
        border-bottom: 1px solid #eee;
    }

    .service-modal-image img {
        max-height: 200px;
    }

    .service-modal-text {
        padding: 1.5rem;
        max-height: 60vh;
    }

    .service-modal-text h3 {
        font-size: 1.5rem;
    }
}

.service-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.service-title {
    color: var(--primary-color-dark);
    /* Darker blue */
    font-size: 1.4rem;
    /* Larger title */
    font-weight: 800;
    /* Extract bold */
    margin: 0;
    line-height: 1.3;
}

.service-description {
    color: #222222;
    /* Almost black for maximum contrast */
    font-size: 1.05rem;
    /* Larger text */
    line-height: 1.5;
    margin: 0;
    font-weight: 500;
    /* Medium weight for "texture" */
}

/* ===================================
   Portfolio Section
   =================================== */
.portfolio {
    padding: var(--spacing-3xl) 0;
    background: var(--light-gray);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.portfolio-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    aspect-ratio: 3/2;
    background: var(--medium-gray);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.portfolio-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            hsla(var(--primary-hue), var(--primary-saturation), var(--primary-lightness), 0.7) 0%,
            hsla(215, 70%, 15%, 0.7) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 1;
}

.portfolio-item:hover::before {
    opacity: 1;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-button {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-xl);
}

/* ===================================
   Testimonials Section
   =================================== */
.testimonials {
    padding: var(--spacing-3xl) 0;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
    position: relative;
}

.testimonials::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 70% 50%,
            hsla(var(--primary-hue), var(--primary-saturation), var(--primary-lightness), 0.15) 0%,
            transparent 50%);
    pointer-events: none;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

.testimonial-card {
    background: var(--white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.testimonial-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.testimonial-stars {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    color: hsl(45, 100%, 50%);
}

.testimonial-text {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--dark-gray);
    margin-bottom: var(--spacing-md);
}

.testimonial-author {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-color);
}

/* ===================================
   Floating WhatsApp Button
   =================================== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-color-dark) 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px hsla(140, 80%, 40%, 0.4);
    z-index: 999;
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(100px) scale(0.8);
    pointer-events: none;
}

.whatsapp-float.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.whatsapp-float:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 24px hsla(140, 80%, 40%, 0.5);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
}

.whatsapp-float::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-color-dark) 100%);
    opacity: 0.3;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* ===================================
   Location Section
   =================================== */
.location {
    padding: var(--spacing-3xl) 0;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
    position: relative;
}

.location::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 70% 50%,
            hsla(var(--primary-hue), var(--primary-saturation), var(--primary-lightness), 0.15) 0%,
            transparent 50%);
    pointer-events: none;
}

.location-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

.location-info-card {
    background: var(--white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.location-branch-title {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--primary-color);
}

.branch-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary-color);
}

.info-item {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.info-icon {
    width: 1.75rem;
    height: 1.75rem;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-item h4 {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    color: var(--accent-color-dark);
    margin-bottom: var(--spacing-xs);
}

.info-item p {
    font-size: 0.95rem;
    color: var(--dark-gray);
    line-height: 1.6;
}

.location-map {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    min-height: 400px;
    border: 3px solid var(--white);
}

.location-map iframe {
    display: block;
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--accent-color-dark);
    color: var(--white);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}

.footer-section h3 {
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: var(--spacing-sm);
}

.footer-section h4 {
    font-size: 1.125rem;
    color: var(--white);
    margin-bottom: var(--spacing-sm);
}

.footer-section p {
    color: hsla(0, 0%, 100%, 0.8);
    line-height: 1.8;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid hsla(0, 0%, 100%, 0.1);
    color: hsla(0, 0%, 100%, 0.7);
}

.social-links {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsla(0, 0%, 100%, 0.1);
    border-radius: 50%;
    color: var(--white);
    transition: all var(--transition-base);
    text-decoration: none;
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.social-icon:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px hsla(var(--primary-hue), var(--primary-saturation), var(--primary-lightness), 0.4);
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Responsive Design
   =================================== */
@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .hero {
        min-height: 700px;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 90px;
        /* Matches navbar height */
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.active {
        max-height: 500px;
        padding: var(--spacing-md) 0;
    }

    .nav-item {
        border-bottom: 1px solid var(--light-gray);
    }

    .nav-link {
        display: block;
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .nav-link::after {
        display: none;
    }

    .nav-cta {
        margin: var(--spacing-md) var(--spacing-lg);
        justify-content: center;
    }

    .carousel-control {
        display: none;
    }

    .carousel-control svg {
        width: 20px;
        height: 20px;
    }

    .carousel-control.prev {
        left: var(--spacing-sm);
    }

    .carousel-control.next {
        right: var(--spacing-sm);
    }

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

    .location-map {
        min-height: 350px;
    }
}

@media (max-width: 640px) {
    body {
        padding-top: 70px;
    }

    .navbar {
        height: 70px;
    }

    .nav-wrapper {
        padding: 0;
    }

    .nav-menu {
        top: 70px;
        /* Adjust for smaller mobile navbar */
    }



    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .carousel-indicators {
        bottom: var(--spacing-lg);
    }

    .whatsapp-float {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}

/* Portfolio Overlay Styles */
.portfolio-item {
    position: relative;
    /* Ensure overlay is positioned relative to item */
    cursor: pointer;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: hsla(var(--primary-hue), var(--primary-saturation), var(--primary-lightness), 0.9);
    /* Primary color with opacity */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-md);
    z-index: 10;
    /* Ensure overlay and button are above the ::before pseudo-element */
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay span {
    color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.9);
    /* High contrast white background */
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid white;
    padding: 12px 24px;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.portfolio-overlay span:hover {
    background-color: white;
    transform: scale(1.05);
}

/* ===================================
   Portfolio Modal
   =================================== */
/* ===================================
   Portfolio Modal
   =================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal.show {
    display: flex;
    /* Changed from block to flex for centering */
    align-items: center;
    /* Vertical centering */
    justify-content: center;
    /* Horizontal centering */
    opacity: 1;
}

.modal-content {
    background-color: var(--white);
    margin: 0;
    /* Removed auto margin */
    width: 90%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    position: relative;
    transform: translateY(50px);
    /* Adjust initial transform */
    transition: transform var(--transition-base);
    overflow: hidden;
    max-height: 90vh;
    /* Prevent it from being taller than viewport */
    display: flex;
    /* Ensure body takes height properly */
    flex-direction: column;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: var(--dark-gray);
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    z-index: 10;
    transition: color var(--transition-fast);
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        /* Use more width on mobile */
        max-height: 85vh;
        /* Allow more height */
        margin: 0;
        border-radius: var(--radius-md);
    }

    .modal-body {
        flex-direction: column;
        overflow-y: auto;
        /* Enable scrolling within body if needed */
    }

    .modal-image-container {
        flex: none;
        /* Don't stretch */
        height: 250px;
        /* Fixed height for image area */
        min-height: auto;
    }

    .modal-text {
        flex: none;
        /* Allow content to flow naturally */
        padding: var(--spacing-lg);
    }

    .modal-text h3 {
        font-size: 1.25rem;
        margin-top: 0;
    }

    .modal-text p {
        font-size: 0.95rem;
    }

    .close-modal {
        top: 10px;
        right: 15px;
        background: rgba(255, 255, 255, 0.8);
        /* readable background */
        border-radius: 50%;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        line-height: 1;
    }
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
    }
}

.modal-image-container {
    flex: 3;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-text {
    flex: 2;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-text h3 {
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
    font-size: 1.5rem;
}

.modal-text p {
    color: var(--dark-gray);
    line-height: 1.6;
}

/* Success Modal Specifics */
.modal-content.success-content {
    max-width: 450px;
    /* Smaller width for success message */
}

/* Override flex direction for success modal body */
.modal-body.centered-body {
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl);
    gap: var(--spacing-md);
}

.success-icon {
    margin-bottom: var(--spacing-sm);
    animation: scaleCheck 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleCheck {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.error-icon {
    margin-bottom: var(--spacing-sm);
    animation: shake 0.5s ease-in-out forwards;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* ===================================
   Contact Section
   =================================== */
/* ===================================
   Contact Section
   =================================== */
.contact {
    padding: var(--spacing-3xl) 0;
    background: var(--light-gray);
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 50%;
    height: 60%;
    background: radial-gradient(circle, hsla(var(--primary-hue), var(--primary-saturation), var(--primary-lightness), 0.05) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.contact-wrapper {
    max-width: 800px;
    /* Increased max-width for grid layout */
    margin: 0 auto;
    background: var(--white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: var(--font-weight-semibold);
    color: var(--dark-gray);
    margin-left: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 1rem 1.25rem;
    border: 2px solid transparent;
    background-color: #f8f9fa;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--dark-gray);
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    background-color: #f1f3f5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    background-color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-hue), var(--primary-saturation), var(--primary-lightness), 0.1);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    cursor: pointer;
}

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

.submit-btn {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover .btn-icon-right {
    transform: translateX(4px) translateY(-2px);
}

.btn-icon-right {
    transition: transform 0.3s ease;
}

@media (max-width: 640px) {
    .contact {
        padding: var(--spacing-xl) 0;
    }

    .contact-wrapper {
        padding: var(--spacing-lg);
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}


/* ===================================
   Brands Ribbon Section
   =================================== */
.brands-ribbon {
    background-color: #ffffff;
    /* White background for logo clarity */
    padding: 2.5rem 0;
    overflow: hidden;
    position: relative;
    /* Borders removed as requested */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    /* Depth */
}

.brands-container {
    max-width: 100%;
    margin: 0 auto;
}

.brands-track {
    display: flex;
    width: max-content;
    animation: scroll 40s linear infinite;
    /* Slow consistent speed */
}

.brands-track:hover {
    animation-play-state: paused;
    /* Optional: pause on hover */
}

.brand-item {
    padding: 0 4rem;
    /* Increased spacing */
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(0%);
    /* Ensure colors are vibrant */
}

.brand-item img {
    height: 80px;
    /* Significantly larger */
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.brand-item img:hover {
    transform: scale(1.15);
}

/* Specific fix for smaller logos */
.brand-scale-up {
    transform: scale(1.6);
    margin: 0 1.5rem;
    /* Adjust margin to compensate for scaling */
}

.brand-scale-up:hover {
    transform: scale(1.75) !important;
    /* Scale up further on hover */
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
        /* Move half the width (since we duplicated) */
    }
}

/* ===================================
   Dynamic Service Modal Styles (Premium)
   =================================== */
.service-modal-content {
    max-width: 900px;
    width: 90%;
    background: #fdfdfd;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: relative;
    /* Ensure specific stacking context */
}

/* Ensure close button is always visible & clickable */
.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    z-index: 2000;
    /* Force it well above scrollable content */
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: var(--dark-gray);
}

.close-modal-btn:hover {
    color: var(--white);
    background: var(--primary-color);
    transform: rotate(90deg);
    box-shadow: 0 6px 16px rgba(var(--primary-hue), var(--primary-saturation), var(--primary-lightness), 0.4);
}

.close-modal-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

#serviceModalDynamicContent {
    width: 100%;
    flex: 1;
    padding: var(--spacing-lg) var(--spacing-xl);
    max-height: 80vh;
    overflow-y: auto;
    /* Custom scrollbar setup */
    scrollbar-width: thin;
    scrollbar-color: var(--medium-gray) transparent;
}

#serviceModalDynamicContent::-webkit-scrollbar {
    width: 8px;
}

#serviceModalDynamicContent::-webkit-scrollbar-track {
    background: transparent;
}

#serviceModalDynamicContent::-webkit-scrollbar-thumb {
    background-color: var(--medium-gray);
    border-radius: 20px;
    border: 3px solid transparent;
    background-clip: content-box;
}

.service-modal-main-title {
    color: var(--primary-color-dark);
    font-size: 2.25rem;
    font-weight: var(--font-weight-extrabold);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-color-light);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.service-modal-section {
    margin-bottom: var(--spacing-xl);
    background: #fff;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform var(--transition-base);
}

.service-modal-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.service-modal-section h4 {
    color: var(--accent-color);
    font-size: 1.4rem;
    margin-bottom: var(--spacing-md);
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
}

.service-modal-section h4::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background: var(--secondary-color);
    margin-right: var(--spacing-sm);
    border-radius: 2px;
}

.service-modal-section p {
    color: var(--dark-gray);
    line-height: 1.7;
    margin-bottom: var(--spacing-lg);
    font-size: 1.05rem;
}

.service-modal-images {
    width: 100%;
}

/* Image styling */
.service-modal-images img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    width: 100%;
    /* Allow full height for single images */
    height: auto;
    max-height: 500px;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: zoom-in;
    background-color: var(--light-gray);
    /* subtle background for letterboxing */
}

.service-modal-images img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* Grid layout for multiple images */
.service-modal-images.multiple-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

/* Enforce fixed height for consistency in grid */
.service-modal-images.multiple-images img {
    height: 250px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .service-modal-main-title {
        font-size: 1.75rem;
    }

    #serviceModalDynamicContent {
        padding: var(--spacing-md);
    }

    .service-modal-section {
        padding: var(--spacing-md);
    }

    .service-modal-images.multiple-images {
        grid-template-columns: 1fr;
    }

    .service-modal-images img {
        height: 200px;
    }
}

/* ===================================
   Service Subtype Carousel
   =================================== */
.subtype-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.subtype-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.subtype-card.media-only-card {
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
}

.subtype-card.media-only-card .subtype-slideshow {
    margin-top: 0;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 75vh;
    border-radius: var(--radius-lg);
    background-color: var(--light-gray);
}

.subtype-card.media-only-card .subtype-slide {
    object-fit: contain;
}

.subtype-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color-dark);
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.subtype-text {
    font-size: 1rem;
    color: var(--dark-gray);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.subtype-gallery-container {
    position: relative;
    margin-top: 1rem;
    padding: 0 4px;
    /* Space for shadow */
}

.subtype-gallery-track {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding-bottom: 0.5rem;
    /* Hide scrollbar but allow functionality */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.subtype-gallery-track::-webkit-scrollbar {
    display: none;
}

.subtype-image-wrapper {
    flex: 0 0 auto;
    width: 280px;
    height: 200px;
    scroll-snap-align: start;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.subtype-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.subtype-image-wrapper:hover img {
    transform: scale(1.1);
}

.subtype-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    color: var(--primary-color);
}

.subtype-nav:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.subtype-nav.prev {
    left: -20px;
}

.subtype-nav.next {
    right: -20px;
}

/* Hide navigation if on mobile to prevent overlap with screen edges */
@media (max-width: 768px) {
    .subtype-nav {
        display: none;
    }

    .subtype-image-wrapper {
        width: 85%;
        /* Larger on mobile */
    }
}

/* Service Subtype Slideshow */
.subtype-slideshow {
    position: relative;
    height: 450px;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    margin-top: 15px;
    background-color: var(--light-gray);
    /* Light background to blend with modal */
}

@media (max-width: 768px) {
    .subtype-slideshow {
        height: 300px;
    }
}

.subtype-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure full image is visible */
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    cursor: pointer;
}

.subtype-slide.active {
    opacity: 1;
    z-index: 1;
}

.subtype-slide:hover {
    transform: scale(1.05);
    transition: transform 0.4s ease, opacity 0.8s ease-in-out;
}

/* ===================================
   Portfolio Dynamic Grid & Pagination
   =================================== */

.portfolio-grid {
    display: grid;
    /* 4 columns for desktop as requested */
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.portfolio-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    aspect-ratio: 16/9;
    /* Standardize aspect ratio */
    background: var(--medium-gray);
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay span {
    color: var(--white);
    font-weight: var(--font-weight-bold);
    background: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* Pagination Controls */
.portfolio-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.pagination-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color-dark);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.pagination-btn:disabled {
    background: var(--medium-gray);
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.pagination-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pagination-info {
    font-size: 1.1rem;
    font-weight: var(--font-weight-semibold);
    color: var(--dark-gray);
    letter-spacing: 0.5px;
}

/* ===================================
   Enhanced Portfolio Modal
   =================================== */

.portfolio-modal-wrapper {
    display: none;
    position: fixed;
    z-index: 2500;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.portfolio-modal-wrapper.show {
    display: flex;
    opacity: 1;
}

.portfolio-modal-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Modal Header/Close */
.portfolio-modal-header {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2600;
}

.portfolio-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

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

.portfolio-close-btn svg {
    width: 24px;
    height: 24px;
}

/* Main Content Area */
.portfolio-modal-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 80px;
    /* Space for arrows */
    overflow: hidden;
    position: relative;
}

.portfolio-main-image {
    max-width: 100%;
    max-height: 70vh;
    /* Leave room for thumbnails */
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Navigation Arrows in Modal */
.portfolio-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    z-index: 2550;
}

.portfolio-nav-btn:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.portfolio-nav-btn.prev {
    left: 30px;
}

.portfolio-nav-btn.next {
    right: 30px;
}

.portfolio-nav-btn svg {
    width: 32px;
    height: 32px;
}

/* Modal Footer & Thumbnails */
.portfolio-modal-footer {
    height: 160px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 var(--spacing-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.portfolio-caption {
    text-align: center;
    color: var(--white);
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
}

.portfolio-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
    justify-content: center;
    /* Center if few items */
}

/* Hide scrollbar forthumbnails */
.portfolio-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.portfolio-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.portfolio-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.thumb-item {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.thumb-item:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.thumb-item.active {
    opacity: 1;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 cols tablet */
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 cols mobile landscape */
        gap: var(--spacing-sm);
    }

    .portfolio-modal-content {
        padding: 10px;
    }

    .portfolio-nav-btn {
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.5);
        /* More visible on mobile */
    }

    .portfolio-nav-btn svg {
        width: 20px;
        height: 20px;
    }

    .portfolio-nav-btn.prev {
        left: 10px;
    }

    .portfolio-nav-btn.next {
        right: 10px;
    }

    .portfolio-thumbnails {
        justify-content: flex-start;
        /* scrollable on mobile */
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        /* 1 col phone */
    }

    .pagination-info {
        font-size: 0.9rem;
    }

    .portfolio-caption {
        font-size: 1rem;
    }

    .portfolio-modal-footer {
        height: 140px;
        padding: 0 var(--spacing-md);
    }
}