/* 
   Dhani Enterprises - Minimalist Theme
   Theme: Pure White, Strong Typography, No Fancy Colors
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #ffffff;
    --text-primary: #111111;
    /* Almost black */
    --text-secondary: #555555;
    --border-color: #e5e5e5;
    --container-width: 1200px;
    --font-main: 'Inter', sans-serif;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: 120px;
    /* Compensate for fixed header */
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 60px 0;
    /* Reduced from 100px to fix spacing */
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 24px;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1.125rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--text-primary);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid var(--text-primary);
    border-radius: 4px;
    /* Minimal radius */
}

.btn:hover {
    background: transparent;
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--text-primary);
    color: #fff;
}

/* Header */
#header-placeholder {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-color);
    /* Ensure opacity */
    transition: box-shadow 0.3s ease;
}

/* Landing Page Overrides (Non-sticky header) */
body.landing-page {
    padding-top: 0;
}

body.landing-page #header-placeholder {
    position: relative;
}

#header-placeholder.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* Soft scroll shadow */
}

header {
    padding: 15px 0;
    /* Reduced from 20px */
    background: var(--bg-color);
    /* Position fixed handled by wrapper */
    border-bottom: none;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 70px;
    /* Increased from 50px */
    width: auto;
    display: block;
}

nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
}

nav a {
    font-weight: 600;
    font-size: 1.125rem;
    /* Increased from 0.95rem */
    color: var(--text-secondary);
}

nav a:hover,
nav a.active {
    color: var(--text-primary);
}

/* Hero */
.hero {
    padding: 40px 0;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.hero .container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-image img {
    width: 100%;
    /* Grayscale filter for extra minimalism? Let's leave color for products */
    max-height: 500px;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.15));
    /* Shadow for the PNG itself */
}

/* About Brief */
.about-brief {
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

/* Features/Products */
.products-section {
    background: var(--bg-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.product-card {
    transition: var(--transition);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    /* Center align text inside cards */
}

.product-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    /* Distinct shadow on hover */
    transform: translateY(-5px);
    background-color: #ffffff;
}

.product-card img {
    /* bg removed */
    width: 100%;
    height: 300px;
    object-fit: contain;
    padding: 30px;
    margin-bottom: 24px;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.25));
    /* Shadow for product PNGs */
}

.product-card h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.product-card .link-arrow {
    font-weight: 600;
    border-bottom: 1px solid var(--text-primary);
}

/* Footer */
footer {
    padding: 80px 0;
    /* border-top: 1px solid var(--border-color); Removed to fix artifact */
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.footer-right {
    text-align: right;
}

/* Partners Section */
.partners-section img:hover {
    filter: grayscale(0%) !important;
    opacity: 1 !important;
    transform: scale(1.05);
}

/* Dark Footer Hover Effects */
footer a:hover {
    color: #ffffff !important;
}

/* Responsive */
@media (min-width: 992px) {

    .mobile-menu-btn,
    .mobile-drawer,
    .mobile-overlay {
        display: none !important;
    }
}

@media (max-width: 991px) {

    html,
    body {
        overflow-x: hidden;
        /* Prevent horizontal scroll of the entire page */
        width: 100%;
        position: relative;
    }

    .mobile-menu-btn {
        display: block !important;
        color: var(--text-primary);
        font-size: 28px;
        /* Position relative to flow in flex container */
        position: static;
        margin-left: auto;
        /* Push to right if needed, but flex justify-between handles it */
        cursor: pointer;
    }

    /* Compact Header for Mobile */
    .logo img {
        height: 40px;
        /* Smaller logo */
        display: block;
        /* Remove inline-block spacing */
    }

    header {
        padding: 10px 0;
        /* Smaller header */
    }

    body {
        padding-top: 60px;
        /* Match new header height */
    }

    /* Force fixed header on mobile for landing page */
    body.landing-page #header-placeholder {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        /* Explicit height to prevent layout shifts */
    }

    /* Override landing page specific overrides */
    body.landing-page {
        padding-top: 60px;
    }

    nav {
        display: none;
    }

    .hero .container,
    .about-grid,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Swipeable Product Grid */
    .products-grid {
        display: flex;
        overflow-x: auto;
        gap: 20px;
        padding-bottom: 20px;
        /* Space for scrollbar if visible */
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll on iOS */
        margin: 0 -24px;
        /* Negative margin to pull to edges */
        padding: 0 24px 20px 24px;
        /* Padding to restore content spacing */
    }

    .products-grid::-webkit-scrollbar {
        display: none;
        /* Hide scrollbar for cleaner look */
    }

    .product-card {
        min-width: 85vw;
        /* Show partial next card */
        max-width: 85vw;
        flex-shrink: 0;
        /* Prevent shrinking to fit */
        scroll-snap-align: center;
        margin-right: 0;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        border: 1px solid var(--border-color);
        padding: 16px;
    }

    .product-card img {
        height: 180px;
        /* Reduced specific mobile height */
        padding: 10px;
        margin-bottom: 15px;
    }

    .product-card h3 {
        font-size: 1.25rem;
        /* Slightly smaller title */
    }

    .product-card p {
        font-size: 0.95rem;
        padding: 0 10px;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        max-width: 100%;
    }

    .hero {
        text-align: center;
        padding-top: 20px !important;
        /* Small buffer */
        padding-bottom: 40px;
    }

    .hero .container {
        display: flex;
        flex-direction: column;
        /* Normal order, we will reorder items manually */
    }

    .hero-text {
        display: contents;
        /* Unwrap children so they become flex items of container */
    }

    .product-label {
        order: 1;
        justify-content: center !important;
        /* Center the label */
        margin-bottom: 20px !important;
    }

    .product-label span {
        display: none !important;
        /* Hide the line */
    }

    .hero-image {
        order: 2;
        margin-bottom: 20px;
    }

    .hero-text h1 {
        order: 3;
    }

    .hero-text p {
        order: 4;
    }

    .hero-text .btn {
        order: 5;
    }

    /* Hero Section Mobile Optimization */
    .hero-slider {
        height: auto !important;
        min-height: 100vh;
        position: relative;
    }

    .slide {
        /* Reset from desktop absolute positioning to avoid overlap */
        position: absolute;
        width: 100%;
        top: 0;
        left: 0;
        opacity: 0 !important;
        /* Hide by default */
        z-index: 0;
        transition: opacity 0.5s ease;
        padding-bottom: 60px;
        /* Space for arrows */
        display: flex;
        /* Prepare for flex layout */
        pointer-events: none;
        /* Prevent clicking hidden slides */
    }

    .slide.active {
        position: relative;
        /* Make the active slide take up actual space */
        opacity: 1 !important;
        z-index: 5;
        pointer-events: auto;
    }

    /* WE NEED TO OVERRIDE THE SLIDER LOGIC FOR LIST VIEW OR KEEP SLIDER? 
       The request was "optimize", usually meaning keep it working. 
       Let's resize the hero to be content-fit or safe 100vh.
    */

    /* Typography Updates for "Small" feel */
    h1 {
        font-size: 1.75rem !important;
        /* Reduced from default/2rem */
    }

    h2 {
        font-size: 1.5rem !important;
        /* Reduced from 2.5rem */
        margin-bottom: 12px;
    }

    p {
        font-size: 0.9rem !important;
        line-height: 1.5;
    }

    .hero h1 {
        font-size: 1.75rem !important;
        /* Specific hero override */
        line-height: 1.2;
        margin-bottom: 10px;
    }

    .hero-text p {
        font-size: 0.9rem !important;
        margin-bottom: 16px;
    }

    /* Adjust specific hero layout for mobile */
    .slide .container {
        flex-direction: column !important;
        justify-content: flex-start;
        padding-top: 60px;
        /* Reduced further */
        padding-bottom: 60px;
        height: 100%;
    }

    .hero-text {
        order: 2 !important;
        flex-direction: column !important;
        display: flex;
        align-items: center;
        text-align: center;
        width: 100%;
        padding: 0 10px;
        /* Minimized side padding */
    }

    /* ... keep existing hero-image styles ... */
    .hero-image {
        width: 100%;
        max-width: 260px;
        /* Slightly smaller image max-width */
        max-height: 220px;
        object-fit: contain;
        margin-bottom: 5px;
        /* Minimal space between image and text */
        order: 1 !important;
        padding: 0;
    }


    /* Hide the huge watermark text on mobile to clean up layout */
    .hero-watermark {
        display: none !important;
    }

    .hero-image img {
        height: auto;
        max-height: 250px;
        /* Limit height */
    }

    /* Carousel Arrows mobile sizing */
    .carousel-arrow {
        width: 36px;
        height: 36px;
        font-size: 16px;
        background: rgba(255, 255, 255, 0.8);
        /* More visible */
    }

    .carousel-arrow.prev {
        left: 10px;
    }

    .carousel-arrow.next {
        right: 10px;
    }

    /* Stack footer columns on mobile */
    footer .container>div:first-child {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 40px;
    }

    footer .logo {
        justify-content: center;
    }

    footer h4 {
        margin-top: 0;
    }

    .footer-right {
        text-align: center;
        margin-top: 20px;
    }

    /* FIX: Force inline grids to stack on mobile (About & Partners Page) */
    .container>div[style*="grid-template-columns"],
    .section .container>div[style*="display: grid"],
    .section .container>div[style*="grid-template-columns"],
    .section .container ul[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* Partners Page Specific Overrides */

    /* Reduce massive padding on the white card */
    .section .container>div[style*="padding: 60px"] {
        padding: 30px 20px !important;
    }

    /* Fix Thermo Fisher Logo overflow */
    img[alt="Thermo Fisher Scientific"] {
        height: auto !important;
        max-width: 100% !important;
        max-height: 60px;
        /* restrict height so it doesn't get too tall if auto */
    }

    /* Stack the buttons */
    .section .container>div>div[style*="display: flex; justify-content: center;"] {
        flex-direction: column;
        gap: 15px !important;
    }

    .section .container>div>div>a.btn {
        width: 100%;
        display: block;
        text-align: center;
        box-sizing: border-box;
    }

    /* Product Detail Page Overrides */

    /* Technical Specs Table - Stack label and value */
    .section .container>div>div>div[style*="grid-template-columns: 1fr 2fr"] {
        grid-template-columns: 1fr !important;
        gap: 5px !important;
    }

    /* Why Choose / Features Grid */
    .section .container>div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* Product H1 sizing */
    h1[style*="font-size: 2.75rem"] {
        font-size: 2rem !important;
    }

    /* Applications Grid */
    .section .container>div>div[style*="border-left"] {
        padding-bottom: 20px;
    }

    /* Image Container Padding specifically for Product Detail */
    .section .container>div>div[style*="padding: 60px"] {
        padding: 20px !important;
        margin-bottom: 30px;
        /* add space between image and text */
    }

    /* Back to Top Mobile Adjustment */
    .back-to-top {
        right: 20px;
        bottom: 20px;
    }

    /* Fix Carousel Arrows on Mobile (Minimalist, no circle) */
    .carousel-arrow {
        top: 200px !important;
        /* Move up slightly */
        background: transparent !important;
        border: none !important;
        width: auto !important;
        height: auto !important;
        font-size: 28px !important;
        /* Larger symbol */
        color: var(--text-primary) !important;
        opacity: 0.8 !important;
    }

    .carousel-arrow.prev {
        left: 5px !important;
    }

    .carousel-arrow.next {
        right: 5px !important;
    }

    /* Fixed Widget Alignment (Straight Line) */
    .whatsapp-fab,
    .demo-fab,
    .back-to-top {
        bottom: 20px !important;
        height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 2000 !important;
        position: fixed !important;
    }

    .whatsapp-fab {
        left: 20px !important;
        right: auto !important;
        width: 48px !important;
        border-radius: 50%;
    }

    .back-to-top {
        right: 20px !important;
        left: auto !important;
        width: 48px !important;
        border-radius: 50%;
    }

    .demo-fab {
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        width: auto !important;
        /* Button allows text */
        border-radius: 50px !important;
        padding: 0 20px !important;
        font-size: 0.9rem !important;
    }

    .whatsapp-fab svg,
    .back-to-top svg {
        width: 24px !important;
        height: 24px !important;
    }

    footer {
        padding: 40px 0 !important;
        border: none !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    /* Events Grid Mobile: One Column */

    /* Target the main event card container */
    .section .container>div[style*="display: flex; margin-bottom: 30px"],
    .section .container>div[style*="box-shadow: 0 5px 20px rgba(0,0,0,0.05); display: flex"] {
        flex-direction: column !important;
    }

    /* Target the Date Box (Left Column) */
    .section .container>div>div[style*="min-width: 150px"] {
        width: 100% !important;
        min-width: auto !important;
        flex-direction: row !important;
        /* Make date horizontal on mobile? or keep compact? Let's try horizontal bar */
        padding: 15px !important;
        gap: 10px;
    }

    /* Adjust Date Text layout inside the bar */
    .section .container>div>div[style*="min-width: 150px"]>div {
        line-height: normal !important;
        margin: 0 !important;
    }

    /* Target the Content Box (Right Column) */
    .section .container>div>div[style*="flex-grow: 1"] {
        padding: 20px !important;
    }

    /* Stack Header (Title + Confirmed Badge) */
    .section .container>div>div>div[style*="justify-content: space-between"] {
        flex-direction: column;
        gap: 10px;
    }

    /* Contact Page Mobile Overrides */

    /* Stack the main grid (Info vs Form) and Reorder */
    .section .container>div[style*="grid-template-columns: 1fr 1.5fr"] {
        display: flex !important;
        /* Switch to flex for reordering */
        flex-direction: column-reverse !important;
        /* Form (2nd child) goes on Top, Info (1st child) goes Bottom */
        gap: 40px !important;
    }

    /* Map height adjustment for mobile */
    #map {
        height: 350px !important;
        /* Slightly smaller map on mobile */
    }

    /* Adjust padding for form/info boxes */
    .section .container>div>div[style*="padding: 40px"] {
        padding: 24px !important;
    }
}

/* Landing Page Specific Layout Tweaks */
body.landing-page .about-brief {
    padding-bottom: 20px;
    /* Pull partners closer */
    border-bottom: none;
    /* Remove border to merge visually */
}

body.landing-page .partners-section {
    padding-top: 20px;
    /* Pull up to about section */
    padding-bottom: 80px;
    border-top: none;
    /* Remove border to merge visually */
    background: transparent;
    /* Seamless clean look */
}

/* Make "What We Offer" cover the screen */
body.landing-page .products-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    /* Distinct background */
    padding: 60px 0;
    /* Ensure vertical spacing */
    min-height: auto;
    /* Allow content to dictate height on mobile */
    align-items: flex-start;
    /* Align top */
}

/* Back to Top Widget */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text-primary);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--text-secondary);
    transform: translateY(-5px);
    color: #fff;
}


/* Shared Product Styles for Catalog */
.product-item {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    margin-bottom: 30px;
}

.product-item:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
    border-color: #111;
}

.product-item img {
    /* bg removed */
    width: 100%;
    height: 300px;
    object-fit: contain;
    padding: 40px;
    margin-bottom: 24px;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.25));
    transition: transform 0.3s ease;
}

/* Explore More Products Styles */
.explore-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
    text-align: center;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.explore-card:hover {
    transform: translateY(-5px);
    border-color: var(--text-primary);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.explore-card img {
    height: 180px;
    width: 100%;
    object-fit: contain;
    margin-bottom: 24px;
    display: block;
}

.explore-card h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
}

/* Mobile Navigation Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.drawer-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-transform: uppercase;
}

.drawer-close {
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    color: var(--text-secondary);
}

.drawer-links {
    list-style: none;
    padding: 24px;
}

.drawer-links li {
    margin-bottom: 20px;
}

.drawer-links a {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
    display: block;
    text-decoration: none;
}

.drawer-links a.active {
    color: var(--text-primary);
    font-weight: 700;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-btn {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-primary);
    z-index: 1100;
}