/*---------------------------------------------------
    AVANTULO S.A. Mobile Responsive Styles
    Version: 1.0 - Enhanced Mobile Adaptation
---------------------------------------------------*/

/* Prevent horizontal scroll on all devices */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Tablets and Small Laptops */
@media screen and (max-width: 1200px) {
    html {
        font-size: 56.25%; /* 9px */
    }
    
    .container {
        padding: 0 3rem;
    }
    
    .section {
        padding: 8rem 0;
    }
}

/* Tablets */
@media screen and (max-width: 992px) {
    html {
        font-size: 50%; /* 8px */
    }
    
    .container {
        padding: 0 2.5rem;
    }
    
    .section {
        padding: 6rem 0;
    }
    
    /* Header */
    .header-inner {
        padding: 1.5rem 0;
    }
    
    #header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 10000;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
    }
    
    .logo img {
        max-height: 4.5rem;
    }
    
    /* Hero */
    .hero {
        padding: 15rem 0 10rem;
        min-height: 70vh;
    }
    
    .hero h1 {
        font-size: 4.5rem;
    }
    
    .hero h2 {
        font-size: 2.6rem;
    }
    
    /* Grids */
    .services-grid,
    .about-grid,
    .insights-container,
    .calculator-container,
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* About */
    .about-image {
        order: -1;
        max-height: 40rem;
    }
    
    .about-content .section-header {
        text-align: center;
    }
    
    .about-content .section-header h2:after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* Footer */
    .footer-top {
        grid-template-columns: repeat(2, 1fr);
        gap: 4rem;
    }
    
    .about-widget {
        grid-column: 1 / -1;
    }
}

/* Mobile Landscape and Tablets Portrait */
@media screen and (max-width: 768px) {
    html {
        font-size: 50%; /* 8px */
    }
    
    .container {
        padding: 0 2rem;
    }
    
    .section {
        padding: 5rem 0;
    }
    
    .section-header {
        margin-bottom: 4rem;
    }
    
    .section-header h2 {
        font-size: 3.2rem;
    }
    
    .section-header p {
        font-size: 1.6rem;
    }
    
    /* Header */
    .nav-toggle {
        display: flex !important;
        position: relative;
        z-index: 10001;
    }
    
    #header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100vw;
        z-index: 10000;
    }
    
    .header-inner {
        position: relative;
        width: 100%;
    }
    
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: var(--shadow-md);
        padding: 2rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: var(--transition-fast);
        z-index: 1000;
        max-height: calc(100vh - 8rem);
        overflow-y: auto;
    }
    
    nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .main-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main-nav li {
        margin: 1rem 0;
        width: 100%;
    }
    
    .main-nav a {
        display: block;
        padding: 1rem 0;
        font-size: 1.8rem;
    }
    
    .header-actions {
        margin-top: 2rem;
    }
    
    /* Hero */
    .hero {
        padding: 12rem 0 8rem;
        min-height: 60vh;
    }
    
    .hero h1 {
        font-size: 3.8rem;
    }
    
    .hero h2 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.6rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        padding: 1.5rem 3rem;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: 3rem;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .stat-item h3 {
        font-size: 4rem;
    }
    
    /* CTA */
    .cta-buttons {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .footer-links a {
        margin: 0.5rem 1rem;
    }
    
    /* Analytics Page */
    .market-indicators {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .market-stats {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .research-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Page */
    .contact-info-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    /* Documents Page */
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    /* Page Header */
    .page-header {
        padding: 10rem 0 5rem;
    }
    
    .page-header h1 {
        font-size: 3.6rem;
    }
    
    .page-header p {
        font-size: 1.6rem;
    }
}

/* Mobile Devices */
@media screen and (max-width: 576px) {
    html {
        font-size: 50%; /* 8px */
    }
    
    .container {
        padding: 0 1.5rem;
    }
    
    .section {
        padding: 4rem 0;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }
    
    .section-header h2 {
        font-size: 2.8rem;
    }
    
    h1 {
        font-size: 3.2rem;
    }
    
    h2 {
        font-size: 2.6rem;
    }
    
    h3 {
        font-size: 2rem;
    }
    
    /* Header */
    .logo img {
        max-height: 4rem;
    }
    
    .header-actions {
        display: none;
    }
    
    /* Hero */
    .hero {
        padding: 10rem 0 6rem;
        min-height: 50vh;
    }
    
    .hero h1 {
        font-size: 3.2rem;
        line-height: 1.2;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1.5rem;
    }
    
    .hero-buttons .btn {
        font-size: 1.5rem;
        padding: 1.2rem 2rem;
    }
    
    /* Cards */
    .service-card,
    .advantage-card,
    .document-card {
        padding: 2.5rem 2rem;
    }
    
    .service-icon,
    .advantage-icon,
    .research-icon {
        width: 6rem;
        height: 6rem;
        font-size: 2.8rem;
    }
    
    /* Stats */
    .stat-item h3 {
        font-size: 3.5rem;
    }
    
    .stat-item p {
        font-size: 1.4rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Forms */
    .calculator-form,
    .calculator-results,
    .contact-form {
        padding: 2rem;
    }
    
    .form-group label {
        font-size: 1.4rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 1.5rem;
        padding: 1rem;
    }
    
    /* Buttons */
    .btn {
        padding: 1rem 2rem;
        font-size: 1.5rem;
    }
    
    /* Analytics Page */
    .market-indicators {
        grid-template-columns: 1fr;
    }
    
    .indicator-card {
        padding: 1.5rem;
    }
    
    .indicator-name {
        font-size: 1.3rem;
    }
    
    .indicator-value {
        font-size: 2rem;
    }
    
    .chart-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .chart-control {
        font-size: 1.2rem;
        padding: 0.6rem 1rem;
    }
    
    .market-stats {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .news-filter {
        padding: 0.8rem 1.5rem;
        font-size: 1.4rem;
        margin: 0 0.5rem 1rem;
    }
    
    /* Experience Badge */
    .experience-badge {
        width: 10rem;
        height: 10rem;
        bottom: 1rem;
        right: -0.5rem;
        font-size: 1.2rem;
    }
    
    .experience-badge h3 {
        font-size: 3rem;
    }
    
    /* Scroll to Top */
    .scroll-to-top {
        width: 4.5rem;
        height: 4.5rem;
        bottom: 2rem;
        right: 2rem;
    }
    
    /* Contact Info */
    .contact-info-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .contact-icon {
        margin-bottom: 0;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 1.4rem;
        flex-wrap: wrap;
    }
    
    /* Document Cards */
    .document-info {
        padding: 2rem;
    }
    
    .document-meta {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    /* Load More Button */
    .load-more {
        width: 100%;
        font-size: 1.5rem;
    }
}

/* Extra Small Devices */
@media screen and (max-width: 400px) {
    html {
        font-size: 46.875%; /* 7.5px */
    }
    
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .hero h2 {
        font-size: 1.6rem;
    }
    
    .section-header h2 {
        font-size: 2.4rem;
    }
    
    .service-card,
    .advantage-card {
        padding: 2rem 1.5rem;
    }
    
    .stat-item h3 {
        font-size: 3rem;
    }
}

/* Landscape Mode for Mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 8rem 0 5rem;
        min-height: auto;
    }
    
    .page-header {
        padding: 8rem 0 4rem;
    }
    
    .section {
        padding: 4rem 0;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .service-card:hover,
    .advantage-card:hover,
    .news-card:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .service-card:active,
    .advantage-card:active,
    .news-card:active {
        transform: translateY(2px);
    }
}

/* Payment Section Mobile Adaptations */
@media screen and (max-width: 768px) {
    .payment-section .payment-features {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .payment-section .feature-item {
        padding: 1.5rem !important;
    }
    
    .payment-section .btn {
        padding: 1.2rem 2.5rem !important;
        font-size: 1.5rem !important;
    }
    
    .payment-info-box {
        margin-top: 3rem !important;
        padding: 2rem !important;
    }
    
    .payment-info-box h4 {
        font-size: 1.8rem !important;
    }
}

@media screen and (max-width: 576px) {
    .nav-payment-link {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem !important;
        margin-top: 0.5rem;
    }
    
    .payment-section .section-header h2 {
        font-size: 2.6rem !important;
    }
    
    .payment-section .feature-item i {
        font-size: 2.5rem !important;
    }
    
    .payment-section .feature-item h3 {
        font-size: 1.6rem !important;
    }
}
