/* ============================================
   Comprehensive Responsive Styles
   Covers all screen sizes: Mobile, Tablet, Desktop
   ============================================ */

/* ============================================
   Base Responsive Settings
   ============================================ */

* {
    box-sizing: border-box;
}

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

/* ============================================
   Extra Small Devices (Phones, < 576px)
   ============================================ */

@media (max-width: 575px) {
    /* Typography */
    h1, .h1 {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }
    
    h2, .h2 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }
    
    h3, .h3 {
        font-size: 20px !important;
        line-height: 1.4 !important;
    }
    
    h4, .h4 {
        font-size: 18px !important;
        line-height: 1.4 !important;
    }
    
    h5, .h5 {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }
    
    h6, .h6 {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    
    p, .p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
    
    /* Header */
    #header-sticky.td-header__area {
        height: 70px !important;
        min-height: 70px !important;
        max-height: 70px !important;
        padding: 10px 0 !important;
    }
    
    .logo img {
        max-width: 120px !important;
        height: auto !important;
    }
    
    /* Footer */
    .td-footer-area,
    footer {
        height: auto !important;
        min-height: auto !important;
        padding: 20px 0 !important;
    }
    
    footer .td-footer-bottom {
        height: auto !important;
        min-height: auto !important;
        padding: 15px 0 !important;
    }
    
    .td-footer-copyright p {
        font-size: 12px !important;
        margin-bottom: 10px !important;
    }
    
    /* Containers */
    .container,
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Sections */
    .td-section-title,
    .td-section-2-title,
    .td-section-3-title {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }
    
    /* Buttons */
    .td-btn,
    .btn {
        padding: 10px 20px !important;
        font-size: 14px !important;
        min-width: auto !important;
    }
    
    /* Cards */
    .card,
    .td-blog-item,
    .td-project-item {
        margin-bottom: 20px !important;
    }
    
    /* Spacing */
    .pt-160, .pt-155, .pt-150 {
        padding-top: 60px !important;
    }
    
    .pb-160, .pb-155, .pb-150 {
        padding-bottom: 60px !important;
    }
    
    .pt-140, .pt-130, .pt-120 {
        padding-top: 50px !important;
    }
    
    .pb-140, .pb-130, .pb-120 {
        padding-bottom: 50px !important;
    }
    
    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 15px !important;
    }
    
    /* Navigation */
    .tdmenu__navbar-wrap ul.navigation {
        flex-direction: column !important;
    }
    
    .tdmenu__navbar-wrap ul.navigation > li {
        width: 100% !important;
        text-align: center !important;
        margin: 5px 0 !important;
    }
}

/* ============================================
   Small Devices (Tablets Portrait, 576px - 767px)
   ============================================ */

@media (min-width: 576px) and (max-width: 767px) {
    /* Typography */
    h1, .h1 {
        font-size: 32px !important;
    }
    
    h2, .h2 {
        font-size: 28px !important;
    }
    
    h3, .h3 {
        font-size: 24px !important;
    }
    
    /* Header */
    #header-sticky.td-header__area {
        height: 75px !important;
        min-height: 75px !important;
        max-height: 75px !important;
    }
    
    .logo img {
        max-width: 140px !important;
    }
    
    /* Footer */
    .td-footer-area,
    footer {
        height: auto !important;
        padding: 25px 0 !important;
    }
    
    /* Sections */
    .td-section-title,
    .td-section-2-title {
        font-size: 36px !important;
    }
    
    /* Spacing */
    .pt-160, .pt-155, .pt-150 {
        padding-top: 80px !important;
    }
    
    .pb-160, .pb-155, .pb-150 {
        padding-bottom: 80px !important;
    }
}

/* ============================================
   Medium Devices (Tablets Landscape, 768px - 991px)
   ============================================ */

@media (min-width: 768px) and (max-width: 991px) {
    /* Typography */
    h1, .h1 {
        font-size: 40px !important;
    }
    
    h2, .h2 {
        font-size: 36px !important;
    }
    
    /* Header */
    #header-sticky.td-header__area {
        height: 80px !important;
    }
    
    /* Sections */
    .td-section-title,
    .td-section-2-title {
        font-size: 42px !important;
    }
    
    /* Spacing */
    .pt-160, .pt-155 {
        padding-top: 100px !important;
    }
    
    .pb-160, .pb-155 {
        padding-bottom: 100px !important;
    }
}

/* ============================================
   Large Devices (Desktops, 992px - 1199px)
   ============================================ */

@media (min-width: 992px) and (max-width: 1199px) {
    /* Container adjustments */
    .container {
        max-width: 960px !important;
    }
    
    /* Typography */
    .td-section-title,
    .td-section-2-title {
        font-size: 48px !important;
    }
}

/* ============================================
   Extra Large Devices (Large Desktops, 1200px - 1399px)
   ============================================ */

@media (min-width: 1200px) and (max-width: 1399px) {
    .container {
        max-width: 1140px !important;
    }
}

/* ============================================
   XXL Devices (Very Large Desktops, >= 1400px)
   ============================================ */

@media (min-width: 1400px) {
    .container {
        max-width: 1320px !important;
    }
}
@media (min-width: 1400px) {
    .container-1680 {
        max-width: 1680px !important;
    }
}

/* ============================================
   Landscape Orientation (Mobile/Tablet)
   ============================================ */

@media (max-width: 991px) and (orientation: landscape) {
    #header-sticky.td-header__area {
        height: 60px !important;
        min-height: 60px !important;
    }
    
    .td-hero-showcase-mains {
        height: 100vh !important;
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    a, button, .btn, .td-btn {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 20px !important;
    }
    
    /* Remove hover effects on touch devices */
    a:hover,
    button:hover {
        transform: none !important;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    .td-footer-area,
    footer,
    header,
    nav {
        display: none !important;
    }
}

/* ============================================
   High DPI Displays
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Ensure crisp rendering on retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ============================================
   Accessibility - Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   Dark Mode Support (if needed)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* ============================================
   Navigation Bar Responsive Fixes
   ============================================ */

/* Hide desktop navigation on mobile/tablet and show mobile menu button */
@media (max-width: 991px) {
    .tdmenu__nav,
    .tdmenu__navbar-wrap,
    .tdmenu__navbar-wrap > ul,
    .tdmenu__navbar-wrap ul.navigation {
        display: none !important;
    }
    
    /* Show mobile menu button */
    .tdmenu-offcanvas-open-btn,
    .mobile-nav-toggler {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Ensure mobile menu button is visible and positioned correctly */
    .tdmenu__wrap {
        justify-content: flex-end !important;
        width: 100% !important;
    }
}

/* Show desktop navigation on large screens */
@media (min-width: 992px) {
    .tdmenu__nav,
    .tdmenu__navbar-wrap {
        display: flex !important;
    }
    
    /* Hide mobile menu button on desktop */
    .tdmenu-offcanvas-open-btn,
    .mobile-nav-toggler {
        display: none !important;
    }
}

/* Tablet adjustments - reduce menu item spacing */
@media (min-width: 768px) and (max-width: 991px) {
    .tdmenu__navbar-wrap > ul {
        padding: 0 1rem !important;
    }
    
    .tdmenu__navbar-wrap > ul > li:not(:last-child) {
        margin-right: 1rem !important;
    }
    
    .tdmenu__navbar-wrap > ul > li a {
        font-size: 0.875rem !important;
        padding: 0.75rem 0.25rem !important;
    }
}

/* Large tablet / small desktop - adjust menu spacing */
@media (min-width: 992px) and (max-width: 1199px) {
    .tdmenu__navbar-wrap > ul {
        padding: 0 1.5rem !important;
    }
    
    .tdmenu__navbar-wrap > ul > li:not(:last-child) {
        margin-right: 1.25rem !important;
    }
    
    .tdmenu__navbar-wrap > ul > li a {
        font-size: 0.9375rem !important;
        padding: 1rem 0.3125rem !important;
    }
}

/* Medium desktop - normal spacing */
@media (min-width: 1200px) and (max-width: 1439px) {
    .tdmenu__navbar-wrap > ul > li:not(:last-child) {
        margin-right: 1.5rem !important;
    }
    
    .tdmenu__navbar-wrap > ul > li a {
        font-size: 1rem !important;
        padding: 1.0625rem 0.3125rem !important;
    }
}

/* Mobile menu button responsive adjustments */
@media (min-width: 320px) and (max-width: 575px) {
    .tdmenu-offcanvas-open-btn {
        padding: 0.5rem !important;
        min-width: 2.75rem !important;
        min-height: 2.75rem !important;
    }
    
    .tdmenu-offcanvas-open-btn .text {
        font-size: 0.75rem !important;
        margin-right: 0.5rem !important;
    }
    
    .tdmenu-offcanvas-open-bar {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .tdmenu-offcanvas-open-btn {
        padding: 0.625rem !important;
        min-width: 3rem !important;
        min-height: 3rem !important;
    }
    
    .tdmenu-offcanvas-open-btn .text {
        font-size: 0.875rem !important;
        margin-right: 0.625rem !important;
    }
    
    .tdmenu-offcanvas-open-bar {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
}

/* Mobile menu drawer responsive */
@media (min-width: 320px) and (max-width: 575px) {
    .tdmobile__menu {
        width: 100% !important;
        padding-right: 1rem !important;
    }
    
    .tdmobile__menu .nav-logo {
        padding: 1.5rem 1.25rem !important;
    }
    
    .tdmobile__menu .nav-logo img {
        width: 120px !important;
        max-width: 100% !important;
    }
    
    .tdmobile__menu .navigation li > a {
        padding: 0.75rem 3.75rem 0.75rem 1.25rem !important;
        font-size: 0.875rem !important;
    }
    
    .tdmobile__menu .close-btn {
        right: 1rem !important;
        top: 1.5rem !important;
        width: 2rem !important;
        height: 2rem !important;
        font-size: 1.25rem !important;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .tdmobile__menu {
        width: 100% !important;
        padding-right: 1.5rem !important;
    }
    
    .tdmobile__menu .nav-logo {
        padding: 1.875rem 1.5rem !important;
    }
    
    .tdmobile__menu .nav-logo img {
        width: 140px !important;
        max-width: 100% !important;
    }
    
    .tdmobile__menu .navigation li > a {
        padding: 0.875rem 3.75rem 0.875rem 1.5rem !important;
        font-size: 0.9375rem !important;
    }
}

/* Logo responsive adjustments in header */
@media (min-width: 320px) and (max-width: 374px) {
    .logo img {
        max-width: 90px !important;
        height: auto !important;
    }
}

@media (min-width: 375px) and (max-width: 575px) {
    .logo img {
        max-width: 110px !important;
        height: auto !important;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .logo img {
        max-width: 130px !important;
        height: auto !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .logo img {
        max-width: 150px !important;
        height: auto !important;
    }
}

/* Prevent navigation menu from causing horizontal scroll */
.tdmenu__navbar-wrap > ul,
.tdmenu__navbar-wrap ul.navigation {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Ensure navigation items don't overflow */
.tdmenu__navbar-wrap > ul > li,
.tdmenu__navbar-wrap ul.navigation > li {
    max-width: 100% !important;
}

.tdmenu__navbar-wrap > ul > li a,
.tdmenu__navbar-wrap ul.navigation > li a {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

