/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 460px; /* Adjust height to prevent overlapping when scrolling */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: flex;
    margin: 50px;
    gap: 20px;
    align-items: center;
    /*flex-wrap: wrap;  TBC */
}

.col, .col-md-4 {
    padding: 15px;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.75rem, 6vw, 2.5rem); 
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

h2::after {
    content: '';
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

h2.no-underline::after {
    content: none;
}

h3 {
    font-size: clamp(1.25rem, 4vw, 1.5rem); 
    color: #34495e;
}

h4 {
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    color: #34495e;
}

p {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem); 
    margin-bottom: 1rem;
    color: #5a6c7d;
}

/* Header Styles */
.topbar {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    font-size: 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.topbar span {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    padding: 14px 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    color: white;
    font-size: clamp(20px, 5vw, 25px);
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
}

.navbar .logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* Mobile Menu Toggle */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.navbar-toggle:hover {
    background: rgba(255,255,255,0.1);
}
/* Mobile Menu Toggle - END */

.nav-menu {
    list-style: none;
    display: flex;
    gap: 35px;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: block;
    /*white-space: nowrap; TBC */
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.nav-menu .has-sub:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .has-sub {
    position: static; /* Allow full width dropdown without being constrained */
}

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0; /* Ensure dropdown starts from far-left of the browser */
    width: 100vw;
    background: white;
    display: flex;
    justify-content: flex-start;
    gap: 50px;
    padding: 40px 60px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-top: 3px solid #3b82f6;
    z-index: 1001;
    list-style: none;
    padding-top: 0;
}

.sub-menu li a {
    color: #2c3e50;
    padding: 10px 20px;
    border-radius: 0;
    font-weight: 400;
}

.sub-menu li a:hover {
    background: #f8f9fa;
    color: #3b82f6;
    transform: none;
}

/* Hero Section */
.hero-slider {
    background: url('/images/microlux-design.png') center center / cover no-repeat;
    min-height: 80vh; /* TBC */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    padding: 2rem 0; 
}

.slide {
    position: relative; /* TBC */
    z-index: 2;
    max-width: 90%; /* TBC */
    padding: 0 20px;
}

.slide h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.slide p {
    font-size: clamp(1rem, 4vw, 1.3rem);
    margin-bottom: 2rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 35px;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-width: 120px; /* TBC */
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Sections */
section {
    padding: 80px 0;
    position: relative;
}

.bg-light {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

/* About Section */
.about {
    background: white;
    scroll-margin-top: 70px;
}

.about .container {
    max-width: 800px;
    text-align: center;
}

.about p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: #5a6c7d;
    line-height: 1.8;
}

/* Products Section */
.products {
    background: rgb(234, 231, 231);
    scroll-margin-top: 70px;
}

.prod-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    min-height: 665px; /* TBC */
    margin-bottom: 30px; /* TBC */
}

.prod-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.prod-card:hover::before {
    transform: scaleX(1);
}

.prod-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.prod-card img {
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
}

.prod-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
}

.prod-card p {
    color: #5a6c7d;
    font-size: clamp(0.9rem, 2.5vw, 1rem); 
}

/* Transducer product section */
.main-image-container {
    padding-top: 20px;
    align-items: center;
    text-align: center; /* TBC */
}

.main-image-container img{
    width: 500px;
    height: 500px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

/* Thumbnail carousel container */
.thumbnail-carousel {
    position: relative;
    width: 500px;
    margin: 20px auto; /* TBC */
    display: flex;
    padding-bottom: 80px;
    justify-content: center; /* TBC */
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.thumbnail-grid {
    display: flex;
    gap: 20px;
    transition: transform 0.3s ease;
    padding-left: 20px;
    padding-top: 20px;
    padding-bottom: 80px;
    flex-wrap: nowrap; /* Prevents wrapping to new row */
    overflow: visible; /* Prevents wrapping to new row */
    overflow-x: auto; /* TBC */
}

.thumbnail-grid img {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail-grid img:hover,
.thumbnail-grid img.active {
    transform: scale(1.1);
    box-shadow: 0 0 12px #3b82f6;
    border-color: #3b82f6;
}

/* Navigation arrows */
.nav-arrow {
    position: absolute;
    top: 25%;
    transform: translateY(-50%);
    background: rgba(59, 130, 246, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-arrow:hover {
    background: rgba(59, 130, 246, 1);
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow:disabled {
    background: rgba(0, 0, 0, 0.2);
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

.nav-arrow.prev {
    left: -80px;
}

.nav-arrow.next {
    right: -80px;
}
/* end */

/* Optional: horizontal scrolling bar
.thumbnail-grid::-webkit-scrollbar {
    height: 8px;
}

.thumbnail-grid::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}
*/

/* Enquire now button */
.enquire-now-container {
    margin-top: 30px;
    text-align: center; /* aligns with downloads section */
    padding: 0 20px; /* TBC */
}

.enquire-now-btn {
    display: inline-block;
    padding: 15px 35px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-size: clamp(1rem, 3vw, 1.25rem); 
    font-weight: bold;
    border-radius: 100px;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
    transition: all 0.3s ease;
    position: relative;
    animation: pulse 1.8s infinite;
    min-width: 200px; /* TBC */
}

.enquire-now-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f6cab);
    box-shadow: 0 8px 20px rgba(41, 128, 185, 0.5);
    transform: translateY(-2px);
}

/* Smooth pulsing animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(52, 152, 219, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}


/* Contact Section */
.contact {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    text-align: center;
    padding: 50px 0;
}

.contact h2 {
    color: white;
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 2rem;
}

.contact h2::after {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.contact p {
    color: rgba(255,255,255,0.9);
    font-size: clamp(0.9rem, 2.5vw, 1rem); 
    margin-bottom: 10px;
}

/* Footer */
.site-footer {
    background: #1a202c;
    color: #a0aec0;
    text-align: center;
    padding: 25px 0;
    font-size: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* TBC */
@media (max-width: 1024px) {
    .nav-arrow.prev {
        left: -40px;
    }
    
    .nav-arrow.next {
        right: -40px;
    }
    
    .sub-menu {
        gap: 30px;
        padding: 30px 40px;
    }
}
/* TBC -END */

/* TBC */
@media (max-width: 768px) {
    /* Hide desktop navigation, show mobile toggle */
    .navbar-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #1e3a8a, #3b82f6);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }
    
    .nav-menu.active {
        max-height: 600px; /* Increased for dropdown menus */
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        padding: 15px 20px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 16px;
    }
    
    .nav-menu .has-sub {
        position: relative;
    }
    
    .sub-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        background: rgba(255,255,255,0.1);
        margin: 0;
        border-radius: 0;
        padding: 0;
        width: 100%;
        flex-direction: column;
        border-top: none;
        gap: 0;
        display: none; /* Initially hidden */
    }
    
    .nav-menu .has-sub:hover .sub-menu,
    .nav-menu .has-sub.active .sub-menu {
        display: flex;
    }
    
    .sub-menu li a {
        color: rgba(255,255,255,0.8);
        padding: 12px 40px;
        font-size: 14px;
    }
    
    .sub-menu li a:hover {
        background: rgba(255,255,255,0.1);
        color: white;
        transform: none;
    }
    
    /* Hide navigation arrows on mobile */
    .nav-arrow {
        display: none;
    }
    
    /* Mobile layout adjustments */
    .row {
        flex-direction: column;
        margin: 20px 0;
        gap: 15px;
    }
    
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Topbar mobile */
    .topbar .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* Hero mobile adjustments */
    .hero-slider {
        min-height: 60vh;
        padding: 3rem 0;
    }
    
    /* Product cards mobile */
    .prod-card {
        margin-bottom: 30px;
        padding: 25px;
    }
    
    /* Thumbnail grid mobile scrolling */
    .thumbnail-grid {
        justify-content: flex-start;
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .thumbnail-grid img {
        width: 70px;
        height: 70px;
    }
    
    /* Main image mobile */
    .main-image-container img {
        max-width: 100%;
        height: auto;
        min-height: 250px;
    }
    
    /* Button mobile adjustments */
    .btn {
        padding: 12px 25px;
        min-width: 140px;
    }
    
    .enquire-now-btn {
        min-width: 180px;
        padding: 12px 30px;
    }
}

@media (max-width: 480px) {
    /* Extra small mobile adjustments */
    .container {
        padding: 0 10px;
    }
    
    section {
        padding: 40px 0;
    }
    
    .hero-slider {
        min-height: 50vh;
        padding: 2rem 0;
    }
    
    .slide {
        max-width: 95%;
        padding: 0 15px;
    }
    
    .prod-card {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .thumbnail-grid img {
        width: 60px;
        height: 60px;
    }
    
    .main-image-container img {
        min-height: 200px;
    }
    
    .enquire-now-btn {
        min-width: 160px;
        padding: 10px 25px;
    }
    
    /* Contact section mobile */
    .contact {
        padding: 40px 0;
    }
    
    /* Typography adjustments for very small screens */
    h2 {
        margin-bottom: 2rem;
    }
    
    p {
        line-height: 1.6;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .prod-card:hover,
    .navbar .logo:hover,
    .nav-menu a:hover {
        transform: none; /* Disable hover transforms on touch devices */
    }
    
    /* Increase touch targets */
    .nav-menu a {
        padding: 18px 20px;
    }
    
    .btn {
        min-height: 48px; /* Minimum touch target size */
    }
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px;
    }
    
    body {
        -webkit-overflow-scrolling: touch;
    }
}
/* TBC -END */


/* Animation Enhancements */
.animate__animated {
    animation-duration: 0.8s;
    animation-fill-mode: both;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }