/* Mobile overflow fix — prevents horizontal scroll on all pages */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Header fix — prevent language switch overflow on mobile only */
/* Note: overflow:hidden breaks dropdown menus on desktop */
@media (max-width: 768px) {
    .header-container {
        overflow: hidden;
    }
}
.header-right {
    flex-shrink: 0;
}
.lang-switch {
    flex-wrap: nowrap;
}

/* Tablet fix */
@media (max-width: 768px) {
    .profile-image .badge {
        right: 10px;
        bottom: -15px;
    }

    /* Ensure containers don't overflow */
    .container, .top-bar-container, .header-container {
        padding: 0 15px;
        max-width: 100%;
    }

    /* Force single column for team on tablets too */
    .team-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile fixes — must come AFTER tablet rules to override inline CSS cascade bug */
@media (max-width: 576px) {
    .profile-image .badge {
        right: 10px;
        bottom: -15px;
        padding: 15px 20px;
    }
    .profile-image .badge .number {
        font-size: 32px;
    }

    /* Center all headings and hero content on mobile */
    .hero-content,
    .page-hero-content,
    .page-hero,
    .hero {
        text-align: center !important;
    }
    .hero-content h1,
    .hero-content p,
    .hero-tagline,
    .page-hero h1,
    .page-hero p,
    .page-hero-content h1,
    .page-hero-content p {
        text-align: center !important;
    }

    /* Hero section mobile fixes */
    .hero {
        height: auto !important;
        min-height: 550px;
        padding: 40px 0;
    }
    .hero-content h1 {
        font-size: 26px;
    }
    .hero-tagline {
        font-size: 13px;
        letter-spacing: 3px;
    }
    .hero-content p {
        font-size: 15px;
    }
    .hero-content .btn-gold,
    .hero-content .btn-outline {
        display: block;
        text-align: center;
        margin: 10px auto;
        padding: 16px 30px;
        width: 80%;
        max-width: 300px;
        box-sizing: border-box;
        font-size: 13px;
    }
    .hero-content .btn-outline {
        margin-left: auto;
        margin-top: 10px;
    }

    /* Section titles */
    .section-title h2 {
        font-size: 26px;
    }

    /* Heritage section */
    .heritage-section {
        padding: 80px 0;
    }
    .heritage-highlight {
        font-size: 18px;
    }

    /* Company profile */
    .company-profile {
        padding: 60px 0;
    }
    .profile-content h2 {
        font-size: 26px;
    }

    /* Projects section */
    .projects-section {
        padding: 60px 0;
    }

    /* Services section */
    .services-section {
        padding: 60px 0;
    }

    /* Team — force 1 column (overrides inline 992px rule that comes after 576px) */
    .team-section {
        padding: 60px 0;
    }
    .team-grid {
        grid-template-columns: 1fr !important;
    }

    /* Footer */
    .footer-grid {
        gap: 30px;
    }

    /* Header language switch — smaller on mobile */
    .header-right {
        gap: 5px;
    }
    .lang-switch {
        gap: 4px;
    }
    .lang-switch a {
        padding: 3px 7px;
        font-size: 11px;
    }
    .logo img {
        height: 35px;
    }
    .logo-text {
        font-size: 16px;
    }

    /* Contact page fixes */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .contact-form-grid {
        grid-template-columns: 1fr;
    }

    /* Gallery grid */
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    /* Blog grid */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    /* Products grid */
    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Vacancies */
    .vacancy-grid {
        grid-template-columns: 1fr;
    }

    /* Stats counters */
    .counter-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    /* Video grid */
    .video-grid {
        grid-template-columns: 1fr !important;
    }

    /* Projects grid */
    .projects-grid {
        grid-template-columns: 1fr !important;
    }

    /* Services grid */
    .services-grid {
        grid-template-columns: 1fr !important;
    }

    /* Partners grid — proper 2 columns with gap */
    .partners-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 0 !important;
    }
    .partner-item {
        padding: 15px 10px !important;
    }
    .partner-item img {
        max-width: 100% !important;
        max-height: 50px !important;
    }
}
