/**
 * HADCO Global Responsive Styles
 * Ensures all pages are mobile-friendly
 */

/* Base Reset */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-width: 320px;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Iframes (for maps, videos, etc) */
iframe {
    max-width: 100%;
}

/* Responsive Tables */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

@media (max-width: 768px) {
    table {
        font-size: 14px;
    }

    table th,
    table td {
        padding: 8px !important;
    }
}

/* Container Responsiveness */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 1024px) {
    .container {
        padding: 0 24px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
}

/* Typography Responsiveness */
h1 {
    font-size: clamp(32px, 5vw, 64px);
    line-height: 1.2;
}

h2 {
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.3;
}

h3 {
    font-size: clamp(24px, 3.5vw, 36px);
    line-height: 1.4;
}

h4 {
    font-size: clamp(20px, 3vw, 28px);
    line-height: 1.4;
}

p {
    font-size: clamp(14px, 2vw, 16px);
    line-height: 1.6;
}

/* Button Responsiveness */
button,
.btn,
a.btn {
    min-height: 44px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    touch-action: manipulation;
}

@media (max-width: 768px) {
    button,
    .btn,
    a.btn {
        width: 100%;
        max-width: 100%;
    }
}

/* Grid Responsiveness */
.grid,
.industries-grid,
.services-grid,
.features-grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 1200px) {
    .grid,
    .industries-grid,
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .grid,
    .industries-grid,
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .grid,
    .industries-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Responsiveness */
input,
textarea,
select {
    width: 100%;
    min-height: 44px;
    padding: 12px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* Section Spacing */
section {
    padding: 80px 0;
}

@media (max-width: 1024px) {
    section {
        padding: 60px 0;
    }
}

@media (max-width: 768px) {
    section {
        padding: 40px 0;
    }
}

/* Card Responsiveness */
.card,
.industry-card,
.service-card {
    width: 100%;
    overflow: hidden;
}

/* Flexbox Utilities */
.flex-wrap {
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .flex-row {
        flex-direction: column !important;
    }
}

/* Hide/Show on Mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none !important;
    }
}

/* Touch Targets */
a,
button {
    min-width: 44px;
    min-height: 44px;
}

/* Prevent Text Overflow */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive Embeds */
.embed-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.embed-responsive iframe,
.embed-responsive object,
.embed-responsive embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #0EA5E9;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    header,
    footer,
    .header,
    .footer,
    .mobile-menu-btn {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}
