/* ============================================
   FERMEX - Responsive Styles
   ============================================ */

/* ---- 1400px ---- */
@media (max-width: 1399px) {
  .container { max-width: 1200px; }
  .hero-content h2, .hero-slide-content h2 { font-size: 68px; }
  .header-inner { padding: 0 30px; }
  .footer-grid { gap: 35px; }
}

/* ---- 1200px ---- */
@media (max-width: 1199px) {
  .container { max-width: 960px; }

  .hero-content h2, .hero-slide-content h2 { font-size: 58px; }
  .hero-content p, .hero-slide-content p { font-size: 17px; }
  .hero-arrow { width: 58px; height: 58px; }
  .hero-arrow-left { left: 25px; }
  .hero-arrow-right { right: 25px; }

  .header-inner { padding: 0 25px; }
  .header-logo-zone { padding-right: 30px; margin-right: 30px; }
  .nav-menu > li > a { padding: 30px 14px; font-size: 15px; }

  .wpo-about-grid { gap: 50px; }
  .wpo-about-content h2 { font-size: 30px; }

  .wpo-service-grid { grid-template-columns: repeat(2, 1fr); }

  .advantages-grid { grid-template-columns: repeat(2, 1fr); }

  .wpo-project-grid { grid-template-columns: repeat(2, 1fr); }
  .wpo-project-grid-3 { grid-template-columns: repeat(2, 1fr); }

  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 40px; }

  .service-detail-grid { grid-template-columns: 1fr 320px; gap: 40px; }
}

/* ---- 991px (Tablet) ---- */
@media (max-width: 991px) {
  .container { max-width: 720px; }

  html { font-size: 14px; }

  .section-padding,
  .wpo-about-section,
  .wpo-service-section,
  .wpo-history-section,
  .wpo-project-section,
  .about-detail-section,
  .service-detail-section,
  .contact-section,
  .references-detail-section {
    padding: 80px 0;
  }

  .wpo-section-title { margin-bottom: 45px; }
  .wpo-section-title h2 { font-size: 30px; }

  /* Header */
  .header-inner { padding: 0 20px; height: 72px; }
  .header-logo-zone { padding-right: 0; margin-right: 0; border-right: none; }
  .header-nav-zone { position: static; flex: 0; width: 0; overflow: visible; }
  .header-cta { display: none; }
  .lang-switcher { margin-right: 10px; }
  .mobile-toggle { display: flex;}

  /* Mobile sidebar header panel */
  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 70px;
    padding: 0 18px 0 22px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: -5px 0 30px rgba(0,0,0,0.15);
    z-index: 10002;
    transition: right 0.35s ease;
  }

  .mobile-nav-header.open {
    right: 0;
  }

  .mobile-nav-logo {
    display: flex;
    align-items: center;
  }

  .mobile-nav-logo img {
    height: 38px;
    width: auto;
    display: block;
    filter: none;
  }

  .mobile-nav-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s ease;
    flex-shrink: 0;
  }

  .mobile-nav-close:hover,
  .mobile-nav-close:active {
    background: var(--primary-dark);
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 70px 0 40px;
    gap: 0;
    box-shadow: -5px 0 30px rgba(0,0,0,0.15);
    transition: right 0.35s ease;
    overflow-y: auto;
    z-index: 10000;
    display: flex;
  }

  .nav-menu.open {
    right: 0;
  }

  .nav-menu > li {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu > li > a {
    color: var(--heading);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
  }

  .nav-menu > li > a:hover,
  .nav-menu > li.active > a {
    color: var(--primary);
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-top: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: var(--section-bg);
  }

  .dropdown-menu.open {
    max-height: 600px;
  }

  .dropdown-menu li a {
    padding: 12px 35px;
    font-size: 14px;
  }

  /* Hero */
  .static-hero { min-height: 700px; }
  .hero-content, .hero-slide-content { max-width: 100%; }
  .hero-content h2, .hero-slide-content h2 { font-size: 46px; }
  .hero-content p, .hero-slide-content p { font-size: 16px; }
  .hero-arrow { width: 52px; height: 52px; }
  .hero-arrow-left { left: 20px; }
  .hero-arrow-right { right: 20px; }

  /* Feature */
  .wpo-feature-section .container { flex-wrap: wrap; }
  .wpo-feature-item { flex: 1 1 50%; }

  /* About */
  .wpo-about-img .main-img { height: 380px; }
  .wpo-about-grid { grid-template-columns: 1fr; gap: 45px; }
  .wpo-about-img .experience-badge { bottom: 20px; right: 20px; width: 140px; height: 140px; }
  .wpo-about-img .experience-badge .number { font-size: 40px; }
  .wpo-about-img .shape-decoration { display: none; }

  /* Advantages */
  .advantages-grid { grid-template-columns: 1fr; }

  /* Projects */
  .wpo-project-grid { grid-template-columns: 1fr; }
  .wpo-project-card { height: 320px; }
  .wpo-project-card .overlay { opacity: 1; }
  .wpo-project-grid-3 { grid-template-columns: 1fr; }
  .wpo-project-grid-3 .wpo-project-card { height: 300px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 35px; }

  /* Page Banner */
  .page-banner { padding: 160px 0 80px; }
  .page-banner h1 { font-size: 36px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .form-row { grid-template-columns: 1fr; }

  /* Service Detail */
  .service-detail-grid { grid-template-columns: 1fr; }
  .service-sidebar { order: 2; }

  /* References */
  .ref-categories { grid-template-columns: 1fr; }
  .ref-logos-grid { grid-template-columns: repeat(3, 1fr); }

  .projects-page-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
  .proj-tabs::-webkit-scrollbar { display: none; }
  .proj-tab { flex-shrink: 0; }
  .values-grid { grid-template-columns: 1fr; }
  .about-detail-grid { grid-template-columns: 1fr; gap: 40px; }

  /* CTA */
  .wpo-cta-content h2 { font-size: 30px; }
  .cta-content h2 { font-size: 28px; }

  /* Inner page sections */
  .reference-categories { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: 1fr; }
  .about-features { grid-template-columns: 1fr; }
  .section-title h2 { font-size: 28px; }
}

/* ---- 767px (Mobile) ---- */
@media (max-width: 767px) {
  .container { max-width: 540px; }

  .section-padding,
  .wpo-about-section,
  .wpo-service-section,
  .wpo-history-section,
  .wpo-project-section {
    padding: 60px 0;
  }

  .wpo-section-title { margin-bottom: 35px; }
  .wpo-section-title h2 { font-size: 26px; }
  .wpo-section-title-s2 h2 { font-size: 26px; }

  /* Hero */
  .static-hero { min-height: 600px; }
  .hero-content h2, .hero-slide-content h2 { font-size: 38px; }
  .hero-content p, .hero-slide-content p { font-size: 15px; max-width: 100%; }
  .hero-eyebrow { font-size: 12px; letter-spacing: 2px; }
  .hero-btn { height: 52px; padding: 0 34px; font-size: 15px; }
  .hero-arrow { display: none; }
  /* Mobile: center subjects for portrait crop */
  .hero-slide:nth-child(1) { background-position: 60% 40%; }
  .hero-slide:nth-child(2) { background-position: center 55%; }
  .hero-slide:nth-child(3) { background-position: 55% 50%; }

  /* Feature section */
  .wpo-feature-item { flex: 1 1 100%; padding: 30px 25px; }

  /* Services */
  .wpo-service-grid { grid-template-columns: 1fr; }
  .wpo-service-card .card-img { height: 200px; }
  .wpo-service-card .card-body { padding: 35px 22px 25px; }

  /* About */
  .wpo-about-img .main-img { height: 300px; }
  .wpo-about-content h2 { font-size: 26px; }
  .wpo-about-features { grid-template-columns: 1fr; }
  .wpo-about-img .experience-badge { width: 120px; height: 120px; }
  .wpo-about-img .experience-badge .number { font-size: 32px; }
  .wpo-about-img .experience-badge .text { font-size: 11px; }

  /* Projects */
  .wpo-project-card { height: 260px; }
  .projects-page-grid { grid-template-columns: 1fr; }
  .proj-tab { padding: 7px 13px; font-size: 12.5px; border-width: 1.5px; }

  /* Process */
  .process-steps { grid-template-columns: 1fr; }

  /* Partners */
  .partner-logos { gap: 30px; }
  .partner-logos img { height: 35px; }

  /* CTA */
  .wpo-cta-section { padding: 60px 0; }
  .wpo-cta-content h2 { font-size: 26px; }
  .wpo-cta-content p { font-size: 15px; }
  .cta-buttons { flex-direction: column; align-items: center; width: 100%; }
  .cta-buttons .btn-white,
  .cta-buttons .btn-ghost { width: 100%; text-align: center; }

  /* Page Banner */
  .page-banner { padding: 130px 0 60px; }
  .page-banner h1 { font-size: 28px; }
  .page-banner .breadcrumb { font-size: 14px; }

  /* Contact */
  .contact-form { padding: 28px 20px; }
  .contact-form-wrap,
  .contact-form-wrapper { padding: 25px 18px; }

  /* CTA inner pages */
  .cta-section { padding: 60px 0; }
  .cta-content h2 { font-size: 24px; }
  .cta-section .cta-buttons { flex-direction: column; align-items: center; width: 100%; }
  .cta-section .btn { width: 100%; text-align: center; }
  .section-title h2 { font-size: 24px; }
  .section-title { margin-bottom: 35px; }

  /* References inner */
  .references-logos { gap: 25px; }
  .references-logos img { height: 35px; }

  /* Ref */
  .ref-logos-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
  .ref-logo-item { height: 80px; padding: 20px; }

  /* Footer */
  .footer-main { padding: 60px 0 40px; }
  .footer-bottom { padding: 18px 0; }
  .footer-bottom .container { flex-direction: column; gap: 12px; text-align: center; }

  .map-responsive iframe { height: 320px; }
}

/* ---- 480px (Small Mobile) ---- */
@media (max-width: 480px) {
  .container { padding: 0 15px; }
  .map-responsive iframe { height: 260px; }

  .hero-content h2, .hero-slide-content h2 { font-size: 32px; }
  .static-hero { min-height: 520px; }
  .hero-content p, .hero-slide-content p { font-size: 14px; }
  .hero-btn { height: 48px; padding: 0 28px; font-size: 14px; }

  .theme-btn { padding: 13px 30px; font-size: 14px; }
  .btn-white, .btn-ghost { padding: 13px 30px; font-size: 14px; }

  .wpo-about-img .main-img { height: 240px; }
  .wpo-about-img .experience-badge { width: 100px; height: 100px; bottom: 15px; right: 15px; }
  .wpo-about-img .experience-badge .number { font-size: 28px; }
  .wpo-about-img .experience-badge .text { font-size: 10px; }

  .advantage-card { padding: 25px 20px; }
  .advantage-card h4 { font-size: 17px; }

  .wpo-cta-content h2 { font-size: 22px; }

  .page-banner h1 { font-size: 24px; }

  .ref-logos-grid { grid-template-columns: 1fr 1fr; }

  .header-inner { padding: 0 15px; height: 64px; }
  .logo img { height: 38px; }
}
