/* ==========================================================
   Site-wide header & footer (v2 design)
   Scoped to the classes used in:
   - templates/main/header.html
   - templates/main/footer.html
   ========================================================== */

:root {
  --brand-green: #275d2b;
  --brand-green-light: #f2f8f4;
  --text-muted: #5f6e66;
  --black: #2b2b2e;
  --white: #fff;
  --primary-color: #275d2b;
}

.btn-brand {
  background-color: var(--brand-green);
  color: #fff;
  border-radius: 25px;
  padding: 0.6rem 0.7rem;
  font-weight: 500;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}
.btn-brand:hover {
  background-color: #1e4a22;
  color: #fff;
}

/* ---------- Navbar ---------- */
.navbar-brand img {
  height: 60px;
}
.site-header .nav-link {
  font-weight: 400;
  color: #101828 !important;
}
.site-header .nav-link.active {
  color: var(--brand-green) !important;
  font-weight: 500;
  border-bottom: 2px solid var(--brand-green);
}
.main-nav {
  display: flex;
  align-items: center;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle svg {
  width: 28px;
  height: 28px;
  stroke: #101828;
}
.nav-close {
  display: none;
}
.nav-overlay {
  display: none;
}

/* ---------- Sticky header ---------- */
.site-header-wrap {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #fff;
  transition: box-shadow 0.25s ease, padding 0.25s ease;
  font-family: "Inter", sans-serif;

}
.site-header-wrap.is-scrolled {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ---------- Nested dropdown (menu) ---------- */
.nav-item.has-dropdown {
  position: relative;
}
.nav-item.has-dropdown > .nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-item.has-dropdown > .nav-link .caret {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid #eef2ee;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.12);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1040;
}
.nav-item.has-dropdown:hover > .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-item.has-dropdown:hover > .nav-link .caret {
  transform: rotate(180deg);
}

.dropdown-item,
.dropdown-panel a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #101828;
  cursor: default;
}
.dropdown-item:hover,
.dropdown-panel a:hover {
  background: var(--brand-green-light);
  color: var(--brand-green);
}
.dropdown-item .chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}

.submenu-panel {
  position: absolute;
  top: -10px;
  left: calc(100% + 10px);
  min-width: 260px;
  background: #fff;
  border: 1px solid #eef2ee;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.12);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1041;
}
.dropdown-item:hover > .submenu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}
.submenu-panel a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.87rem;
  color: #101828;
}
.submenu-panel a:hover {
  background: var(--brand-green-light);
  color: var(--brand-green);
}

/* Mobile: dropdown becomes a static accordion inside the drawer */
@media (max-width: 992px) {
  .dropdown-panel {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    display: none;
    width: 100%;
    margin-top: 4px;
    padding-left: 8px;
  }
  .nav-item.has-dropdown.mobile-open > .dropdown-panel {
    display: block;
  }
  .nav-item.has-dropdown:hover > .dropdown-panel {
    display: none;
  }
  .nav-item.has-dropdown.mobile-open:hover > .dropdown-panel,
  .nav-item.has-dropdown.mobile-open > .dropdown-panel {
    display: block;
  }
  .nav-item.has-dropdown > .nav-link .caret {
    transform: none !important;
  }
  .nav-item.has-dropdown.mobile-open > .nav-link .caret {
    transform: rotate(180deg) !important;
  }

  .submenu-panel {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    display: none;
    margin-top: 4px;
    padding-left: 12px;
  }
  .dropdown-item.mobile-open > .submenu-panel {
    display: block;
  }
  .menu-toggle {
    display: block;
  }
      .main-nav-menu {
        width: 100%;
    }
  .main-nav {
    position: fixed;
    inset: 0 0 0 auto;
    flex-direction: column;
    width: min(320px, 80vw);
    height: 100vh;
    background: #fff;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1050;
    justify-content: space-between;
    padding: 24px;
    overflow-y: auto;
  }
  .main-nav.open {
    transform: translateX(0);
  }
  .main-nav .navbar-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 48px;
    width: 100%;
  }
  .main-nav .nav-link {
    display: block;
    padding: 12px 8px;
    width: 100%;
  }
  .main-nav .nav-link.active {
    border-bottom: none;
    background: var(--brand-green-light);
    border-radius: 8px;
  }
  .main-nav .btn-brand {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1049;
  }
  .nav-overlay.open {
    display: block;
  }
  .nav-close {
    display: block;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
  }
  .nav-close svg {
    width: 24px;
    height: 24px;
  }
  .dropdown-item.mobile-open {
    flex-direction: column;
    background: transparent;
    align-items: flex-start;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background-color: #083a2d;
  background-image: url(../../assets/img/ic_footer_earth.png);
  background-position: left bottom;
  background-size: contain;
  background-repeat: no-repeat;
  color: var(--white);
}
.site-footer-row {
  display: grid;
  color: var(--white);
  grid-template-columns: 219px 1.6fr 1fr 1.4fr;
  gap: 3.438rem;
}
@media (max-width: 768px) {
  .site-footer-row {
    grid-template-columns: 1fr;
  }
}

.footer-social li {
  padding: 0 10px;
  list-style: none;
}
.footer-social li svg {
  fill: var(--white);
  width: 25px;
  height: 25px;
}

.footer-col-address {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col-address li {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.footer-col-address li img {
  width: 30px;
  border-radius: 2px;
  margin-top: 5px;
}

.footer-col h4 {
  font-size: 1.125rem;
  color: var(--white);
  font-weight: 600;
}
.footer-col a {
  color: var(--white);
  font-size: 0.85rem;
  line-height: 40px;
  display: block;
}
.footer-col a:hover {
  color: var(--white);
  opacity: 0.7;
}
.footer-services {
  columns: 2;
  column-gap: 1.5rem;
}

.footer-col .carrer-hiring {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-col .hiring-badge {
  display: inline-flex;
  padding: 2px 10px;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--white);
  border-radius: 20px;
  font-size: 0.7rem;
  line-height: normal;
}
.footer-col .hiring-text {
  color: var(--white);
  animation: hiring-blink 1.4s ease-in-out infinite;
}
@keyframes hiring-blink {
  50% {
    opacity: 0.35;
  }
}

/* Floating WhatsApp button */
.floating_btn {
  position: fixed;
  bottom: 30px;
  right: 5px;
  width: 100px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.contact_icon {
  background: #40865a;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 70px;
  height: 70px;
  padding: 0;
  border-radius: 50%;
  text-decoration: none;
  animation: pulse 1.5s ease-out infinite;
}

@media (max-width: 768px) {
  .floating_btn {
    width: 60px;
    height: 60px;
    bottom: 16px;
    right: 12px;
  }
  .contact_icon {
    width: 56px;
    height: 56px;
  }
  .contact_icon svg {
    width: 32px;
    height: 32px;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  80% {
    box-shadow: 0 0 0 14px rgba(37, 211, 102, 0);
  }
}

/* Mobile: nested submenu toggle spans the row and its chevron points down when open */
@media (max-width: 992px) {
  .dropdown-item > .dd-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .dropdown-item.mobile-open > .dd-toggle .chevron {
    transform: rotate(90deg);
  }
  .submenu-panel {
    width: 100%;
  }
}

/* Footer: keep the logo at its desktop size when the grid collapses to one column */
.site-footer-row > div:first-child > a {
  display: block;
  width: 100%;
  max-width: 219px;
}

@media (max-width: 768px) {
  .site-footer-row {
    gap: 2rem;
  }
  .site-footer-row > div:first-child {
    align-items: center;
  }
  .footer-social {
    justify-content: center;
    width: 100%;
  }
  .footer-col h4 {
    margin-bottom: 1rem !important;
  }
  /* 2-column list: long service names wrap, so drop the 40px line-height */
  .footer-col a {
    line-height: 1.5;
    padding: 8px 0;
  }
  .footer-services li {
    break-inside: avoid;
  }
}
@media (max-width: 400px) {
  .footer-services {
    columns: 1;
  }
}
