/* =========================================================
   AMAX Reusable Components
   Navigation, buttons, cards, labels, footer, gallery UI
   ========================================================= */

/* ---------------------------------------------------------
   Navigation
   --------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 2px solid var(--blue);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: calc(var(--grid) * 2);
}

.logo img {
  height: 88px;
  width: auto;
  max-width: 420px;
  object-fit: contain;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--blue);
}

.nav-links {
  display: flex;
  gap: calc(var(--grid) * 5);
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--blue);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--orange);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--orange);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: calc(var(--grid) * 3);
}

.nav-cta {
  display: inline-block;
  padding: calc(var(--grid) * 1.5) calc(var(--grid) * 4);
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: var(--transition);
  clip-path: polygon(0 0, calc(100% - var(--clip)) 0, 100% var(--clip), 100% 100%, var(--clip) 100%, 0 calc(100% - var(--clip)));
}

.nav-cta:hover {
  background: var(--orange-dark);
  transform: translateY(-2px);
}

/* Focus visibility for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: calc(var(--grid));
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
}

.lang-btn {
  background: none;
  border: none;
  padding: 4px 6px;
  color: var(--gray);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.lang-btn:hover {
  color: var(--orange);
}

.lang-btn.active {
  color: var(--blue);
  border-bottom: 2px solid var(--orange);
}

.lang-divider {
  color: var(--gray-light);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}

.mobile-menu-btn span {
  width: 26px;
  height: 3px;
  background: var(--blue);
  transition: var(--transition);
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--blue);
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--grid) * 5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
  transition: var(--transition);
}

.mobile-nav.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-nav a {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

.mobile-nav a:hover {
  color: var(--orange);
}

.mobile-nav-close {
  position: absolute;
  top: calc(var(--grid) * 3);
  right: calc(var(--grid) * 4);
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  line-height: 1;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn-primary,
.btn-outline,
.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--grid) * 2.5) calc(var(--grid) * 5);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: var(--transition);
  clip-path: polygon(0 0, calc(100% - var(--clip)) 0, 100% var(--clip), 100% 100%, var(--clip) 100%, 0 calc(100% - var(--clip)));
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
  border: 2px solid var(--orange);
}

.btn-primary:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.filter-btn {
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
  text-transform: none;
  letter-spacing: 0.5px;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

/* ---------------------------------------------------------
   Section labels & titles
   --------------------------------------------------------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--grid) * 2);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: calc(var(--grid) * 4);
}

.section-label::before {
  content: '';
  width: 32px;
  height: 3px;
  background: var(--orange);
}

.section-label.centered {
  justify-content: center;
}

.section-label.centered::before,
.section-label.centered::after {
  content: '';
  width: 32px;
  height: 3px;
  background: var(--orange);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--blue);
  line-height: 1.05;
  font-weight: 700;
  margin-bottom: calc(var(--grid) * 3);
  letter-spacing: -1px;
}

/* ---------------------------------------------------------
   Service card
   --------------------------------------------------------- */
.service-card {
  background: var(--white);
  border: 2px solid var(--blue);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: 1;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.service-card:hover img {
  transform: scale(1.03);
}

.service-content {
  padding: calc(var(--grid) * 5);
}

.service-tag {
  display: inline-block;
  padding: calc(var(--grid) / 2) calc(var(--grid) * 2);
  background: var(--blue);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: calc(var(--grid) * 2);
}

.service-title {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  color: var(--blue);
  margin-bottom: calc(var(--grid) * 2);
}

.service-desc {
  color: var(--gray);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: calc(var(--grid) * 4);
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--grid));
  color: var(--orange);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: gap 0.3s ease;
}

.service-link:hover {
  gap: calc(var(--grid) * 2);
}

/* ---------------------------------------------------------
   Project card
   --------------------------------------------------------- */
.project-card {
  position: relative;
  overflow: hidden;
  background: var(--blue);
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.project-card img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover img {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: calc(var(--grid) * 4);
  background: linear-gradient(to top, rgba(0, 51, 102, 0.95), transparent);
  color: var(--white);
}

.project-category {
  display: inline-block;
  padding: calc(var(--grid) / 2) calc(var(--grid) * 1.5);
  background: var(--orange);
  font-family: var(--font-heading);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: calc(var(--grid) * 2);
}

.project-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: calc(var(--grid));
}

/* ---------------------------------------------------------
   Feature item
   --------------------------------------------------------- */
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--grid) * 2);
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.feature-item h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: calc(var(--grid) / 2);
}

.feature-item p {
  font-size: 0.875rem;
  margin: 0;
}

/* ---------------------------------------------------------
   Contact block
   --------------------------------------------------------- */
.contact-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(var(--grid) * 4);
  margin-top: calc(var(--grid) * 8);
  margin-left: auto;
  margin-right: auto;
  max-width: 800px;
}

.contact-item {
  background: var(--white);
  border: 2px solid var(--blue);
  padding: calc(var(--grid) * 4);
  transition: var(--transition);
}

.contact-item:hover {
  border-color: var(--orange);
  transform: translateY(-4px);
}

.contact-item h5 {
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: calc(var(--grid) * 1.5);
}

.contact-item p {
  color: var(--blue);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.footer {
  background: var(--blue-dark);
  color: var(--white);
  padding: calc(var(--grid) * 8) 0 calc(var(--grid) * 5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: calc(var(--grid) * 6);
  margin-bottom: calc(var(--grid) * 8);
}

.footer-brand img {
  height: 68px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  margin-bottom: calc(var(--grid) * 3);
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 300px;
}

.footer-col h5 {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: calc(var(--grid) * 3);
}

.footer-col li {
  margin-bottom: calc(var(--grid) * 1.5);
}

.footer-col a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

.footer-col a:hover {
  color: var(--orange);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: calc(var(--grid) * 5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: calc(var(--grid) * 2);
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8125rem;
}

/* ---------------------------------------------------------
   Gallery UI
   --------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--grid) * 2);
  justify-content: center;
  margin-top: calc(var(--grid) * 6);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--grid) * 3);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  background: var(--blue);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--orange);
}

.gallery-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item::after {
  content: '+';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  background: rgba(0, 51, 102, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* ---------------------------------------------------------
   Lightbox
   --------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 34, 68, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border: 4px solid var(--white);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: var(--orange);
  color: var(--white);
  border: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: var(--transition);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--orange-dark);
}

.lightbox-close {
  top: -52px;
  right: 0;
}

.lightbox-prev {
  left: -60px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------------------------------------------------------
   Carousel controls
   --------------------------------------------------------- */
.carousel {
  position: relative;
  width: 100%;
}

.carousel-track-wrap {
  overflow: hidden;
  width: 100%;
}

.carousel-track {
  display: flex;
  gap: calc(var(--grid) * 3);
  transition: transform 0.5s ease;
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 calc(50% - var(--grid) * 1.5);
  position: relative;
  overflow: hidden;
  background: var(--blue);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.carousel-slide img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.carousel-slide:hover {
  border-color: var(--orange);
}

.carousel-slide:hover img {
  transform: scale(1.05);
}

.carousel-slide::after {
  content: '+';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  background: rgba(0, 51, 102, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carousel-slide:hover::after {
  opacity: 1;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: var(--orange);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.carousel-btn:hover {
  background: var(--orange-dark);
}

.carousel-btn.prev {
  left: calc(var(--grid) * -2);
}

.carousel-btn.next {
  right: calc(var(--grid) * -2);
}

.carousel-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: calc(var(--grid));
  margin-top: calc(var(--grid) * 3);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--blue);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.carousel-dot.active {
  background: var(--orange);
  border-color: var(--orange);
}

@media (max-width: 640px) {
  .lightbox-prev {
    left: 12px;
  }

  .lightbox-next {
    right: 12px;
  }

  .carousel-slide {
    flex: 0 0 100%;
  }

  .carousel-slide img {
    height: 230px;
  }

  .carousel-btn {
    width: 44px;
    height: 44px;
  }

  .carousel-btn.prev {
    left: 8px;
  }

  .carousel-btn.next {
    right: 8px;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    height: var(--nav-height-mobile);
    max-width: none;
    min-width: 0;
    padding-left: 16px;
    padding-right: 16px;
  }

  .logo img {
    height: auto;
    max-height: 44px;
    max-width: 160px;
  }

  .nav-right {
    gap: 6px;
  }

  .nav-right .lang-switcher {
    gap: 0;
    font-size: 0.7rem;
  }

  .nav-right .lang-btn {
    padding: 3px 4px;
    min-height: 44px;
  }

  .mobile-menu-btn {
    padding: 6px;
  }

  .mobile-menu-btn span {
    width: 22px;
    height: 2px;
  }

  .mobile-nav {
    gap: calc(var(--grid) * 4);
  }

  .mobile-nav a {
    font-size: 1.25rem;
  }

  .mobile-nav-close {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .section-title {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .service-card img {
    height: 220px;
  }

  .service-content {
    padding: calc(var(--grid) * 3);
  }

  .service-title {
    font-size: 1.5rem;
  }

  .service-desc,
  .feature-item p {
    font-size: 1rem;
  }

  .project-card img {
    min-height: 220px;
  }

  .project-overlay {
    padding: calc(var(--grid) * 3);
  }

  .project-title {
    font-size: 1.25rem;
  }

  .contact-item {
    padding: calc(var(--grid) * 3);
  }
}

@media (max-width: 640px) {
  .gallery-item img {
    height: 220px;
  }
}

/* Full-width desktop navigation: logo left, primary links centered. */
@media (min-width: 769px) {
  .nav-inner {
    max-width: none;
    padding-left: 32px;
    padding-right: 32px;
    position: relative;
  }

  .logo {
    margin-right: auto;
  }

  .nav-links {
    gap: 42px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
  }

  .nav-links a {
    font-size: 1.05rem;
    font-weight: 700;
  }

  .nav-right {
    margin-left: auto;
  }
}

.mobile-nav-cta {
  display: inline-block;
  padding: 12px 24px;
  background: var(--orange);
  color: var(--white) !important;
  font-size: 1rem !important;
  clip-path: polygon(0 0, calc(100% - var(--clip)) 0, 100% var(--clip), 100% 100%, var(--clip) 100%, 0 calc(100% - var(--clip)));
}
