/**
 * TRADONS.COM - Responsive CSS
 * Mobile-first responsive design
 */

/* ================================================
   BREAKPOINTS
   ================================================ */
/* 
   Mobile First Approach:
   - xs: 0-575px (default)
   - sm: 576px+
   - md: 768px+
   - lg: 992px+
   - xl: 1200px+
   - 2xl: 1400px+
*/

/* ================================================
   LARGE TABLETS & SMALL DESKTOPS (max-width: 1199px)
   ================================================ */
@media (max-width: 1199px) {
    :root {
        --container-padding: 1.5rem;
        --text-5xl: 2.5rem;
        --text-4xl: 2rem;
        --text-3xl: 1.75rem;
    }
    
    .container {
        max-width: 100%;
    }
    
    /* Header */
    .nav-menu {
        gap: 0;
    }
    
    .nav-link {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--text-sm);
    }
    
    /* Mega Menu */
    .mega-menu {
        min-width: 500px;
    }
    
    .mega-menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
        gap: var(--spacing-2xl);
    }
}

/* ================================================
   TABLETS (max-width: 991px)
   ================================================ */
@media (max-width: 991px) {
    :root {
        --text-5xl: 2.25rem;
        --text-4xl: 1.875rem;
        --text-3xl: 1.5rem;
        --spacing-5xl: 6rem;
        --spacing-4xl: 4rem;
    }
    
    /* Header - Mobile Menu */
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        max-width: 320px;
        height: calc(100vh - var(--header-height));
        background-color: var(--white);
        box-shadow: var(--shadow-xl);
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        overflow-y: auto;
        z-index: 999;
        display: flex;
        flex-direction: column;
    }
    
    .main-nav.active {
        transform: translateX(0);
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        padding: var(--spacing-lg);
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Dropdown */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-left: 2px solid var(--accent-color);
        margin-left: var(--spacing-md);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base);
    }
    
    .nav-item.active .dropdown-menu {
        max-height: 2000px;
    }
    
    /* Mega Menu */
    .mega-menu {
        min-width: auto;
        transform: none;
        border-left: none !important;
        margin-left: 0 !important;
        padding-left: 0;
    }
    
    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .mega-menu-col {
        padding: 0;
    }
    
    .mega-menu-col h4 {
        font-size: var(--text-sm);
        margin-bottom: var(--spacing-xs);
        padding-left: var(--spacing-md);
        color: var(--primary-color);
        font-weight: 600;
    }
    
    .mega-menu-col ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mega-menu-col ul li a {
        padding: var(--spacing-sm) var(--spacing-md);
        padding-left: calc(var(--spacing-md) * 2);
        display: block;
    }
    
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Mobile Menu CTA */
    .mobile-menu-cta {
        display: flex;
    }
    
    /* Hide desktop CTA buttons */
    .header-actions .btn {
        display: none !important;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2xl);
    }
    
    .footer-about {
        grid-column: 1 / -1;
    }
    
    .footer-contact {
        grid-column: 1 / -1;
    }
    
    /* Grid System */
    .col-md-12 { width: 100%; }
    .col-md-6 { width: 50%; }
    .col-md-4 { width: 33.333%; }
}

/* ================================================
   MOBILE LANDSCAPE & SMALL TABLETS (max-width: 767px)
   ================================================ */
@media (max-width: 767px) {
    :root {
        --container-padding: 1rem;
        --text-5xl: 2rem;
        --text-4xl: 1.75rem;
        --text-3xl: 1.375rem;
        --text-2xl: 1.25rem;
        --spacing-5xl: 4rem;
        --spacing-4xl: 3rem;
        --spacing-3xl: 2.5rem;
        --header-height: 70px;
    }
    
    /* Typography */
    h1 { font-size: var(--text-5xl); }
    h2 { font-size: var(--text-4xl); }
    h3 { font-size: var(--text-3xl); }
    
    /* Sections */
    .section {
        padding: var(--spacing-4xl) 0;
    }
    
    .section-sm {
        padding: var(--spacing-2xl) 0;
    }
    
    /* Logo */
    .logo-image {
        height: 32px;
    }
    
    /* Buttons */
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--text-sm);
    }
    
    .btn-lg {
        padding: var(--spacing-md) var(--spacing-xl);
        font-size: var(--text-base);
    }
    
    /* Cards */
    .card {
        padding: var(--spacing-lg);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    /* Grid System */
    .row {
        margin: 0 calc(var(--spacing-sm) * -1);
    }
    
    .col,
    [class*="col-"] {
        padding: 0 var(--spacing-sm);
    }
    
    .col-sm-12 { width: 100%; }
}

/* ================================================
   MOBILE PORTRAIT (max-width: 575px)
   ================================================ */
@media (max-width: 575px) {
    :root {
        --container-padding: 0.875rem;
        --text-5xl: 1.75rem;
        --text-4xl: 1.5rem;
        --text-3xl: 1.25rem;
        --text-2xl: 1.125rem;
        --spacing-5xl: 3rem;
        --spacing-4xl: 2.5rem;
        --spacing-3xl: 2rem;
    }
    
    /* Header */
    .header-actions {
        gap: var(--spacing-sm);
    }
    
    /* Hide desktop buttons on mobile */
    .hide-on-mobile {
        display: none !important;
    }
    
    .header-actions .btn {
        display: none !important;
    }
    
    /* Language Switcher - Compact */
    .lang-code {
        display: none;
    }
    
    .lang-toggle {
        padding: var(--spacing-xs) var(--spacing-sm);
        min-width: 50px;
    }
    
    .lang-flag {
        font-size: var(--text-base);
    }
    
    /* Buttons */
    .btn-group {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    /* Mobile Menu CTA buttons should be full width */
    .mobile-menu-cta .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    /* Grid System - All Full Width */
    [class*="col-"] {
        width: 100%;
    }
}

/* ================================================
   EXTRA SMALL DEVICES (max-width: 374px)
   ================================================ */
@media (max-width: 374px) {
    :root {
        --text-5xl: 1.5rem;
        --text-4xl: 1.375rem;
        --spacing-5xl: 2.5rem;
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .form-control {
        padding: var(--spacing-sm);
    }
}

/* ================================================
   LANDSCAPE ORIENTATION
   ================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .main-nav {
        height: calc(100vh - 60px);
    }
    
    .section {
        padding: var(--spacing-2xl) 0;
    }
}

/* ================================================
   PRINT STYLES
   ================================================ */
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .mobile-menu-toggle,
    .language-switcher,
    .btn,
    .nav-menu {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}

/* ================================================
   DARK MODE (Optional - Future Enhancement)
   ================================================ */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here in future */
    /* For now, we'll keep light mode only */
}