/* ===== Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ===== Footer ===== */
.site-footer {
  background: #1b5e20;
  color: #fff;
  padding: 50px 0 20px;
  margin-top: auto;
  width: 100%;
}

.footer-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.container,
.container-fluid,
.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm,
.gallery-container {
  max-width: 1200px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

.footer-col {
  min-width: 0;
}

.footer-col h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #a5d6a7;
  font-weight: 700;
}

.footer-col p {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.7;
  margin: 0;
}

.footer-col a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.9;
  transition: color 0.2s, opacity 0.2s;
  display: inline-block;
}

.footer-col a:hover {
  color: #a5d6a7;
  opacity: 1;
}

.footer-address,
.footer-phones {
  white-space: pre-line;
}

.footer-bottom {
  margin: 12px auto 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  opacity: 0.7;
  margin: 0;
}

/* ===== Page Header ===== */
.page-header-section {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
  color: #fff;
  padding: 100px 0 60px;
}

.page-header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.page-header-section h2 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.page-header-section p {
  font-size: 18px;
  opacity: 0.9;
  text-align: center;
  margin: 0 auto;
}

/* ===== Sister Companies Section ===== */
.sister-companies-section {
  padding: 80px 0;
  background: #fff;
  animation: sectionFadeIn 1s ease-out forwards;
}

@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sister-companies-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.sister-companies-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.sister-logo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
  background: #fff;
  min-height: 180px;
}

.sister-logo-card:hover {
  border-color: #a5d6a7;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.sister-logo-img {
  max-width: 180px;
  max-height: 120px;
  object-fit: contain;
}

.sister-logo-card:first-child .sister-logo-img {
  max-width: 220px;
  max-height: 150px;
}



/* ===== Location Cards ===== */
.location-container {
  width: 100%;
  padding: 0;
}

.location-row {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 0 !important;
  align-items: stretch !important;
  flex-wrap: nowrap !important;
  overflow-x: visible !important;
  scroll-snap-type: none !important;
  width: 100% !important;
  justify-content: initial !important;
}

.location-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-height: 280px;
}

.card-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.75) 100%);
}

.card-number {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.card-content {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 16px;
  width: 100%;
}

.card-content h3 {
  color: #fff;
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 700;
}

.card-details p {
  color: rgba(255,255,255,0.85);
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* ===== Back to Top Button ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s, box-shadow 0.2s;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ===== Print Styles ===== */
@media print {
  .navbar,
  .hero-section,
  .hero-overlay,
  .back-to-top,
  .mobile-menu-overlay,
  .mobile-menu-panel,
  .btn-hero,
  .contact-map-section,
  .contact-cards-overlay {
    display: none !important;
  }

  body {
    animation: none !important;
    color: #000 !important;
    background: #fff !important;
  }

  .page-header-section {
    background: none !important;
    color: #000 !important;
    padding: 20px 0 !important;
  }

  .page-header-section h2 {
    color: #000 !important;
    font-size: 28px !important;
  }

  .page-header-section p {
    color: #333 !important;
  }

  .sister-companies-section,
  .portfolio-section,
  .leadership-section,
  .location-section,
  .gallery-section,
  .contact-form-section {
    padding: 20px 0 !important;
  }

  .sister-companies-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
  }

  .sister-logo-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    padding: 10px !important;
    min-height: auto !important;
  }

  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }

  .portfolio-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .card-image-wrap {
    height: 150px !important;
  }

  .location-row {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 5px !important;
  }

  .location-card {
    break-inside: avoid;
  }

  .card-image {
    height: 200px !important;
  }

  .card-overlay {
    background: rgba(0,0,0,0.5) !important;
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }

  .gallery-item {
    break-inside: avoid;
  }

  .leadership-row {
    break-inside: avoid;
  }

  .leader-img-wrap {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  .contact-form {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }

  .form-control {
    border: 1px solid #999 !important;
    box-shadow: none !important;
  }

  .btn {
    border: 1px solid #2e7d32 !important;
    background: none !important;
    color: #2e7d32 !important;
    box-shadow: none !important;
  }

  .site-footer {
    background: none !important;
    color: #000 !important;
    border-top: 2px solid #2e7d32 !important;
    padding: 20px 0 !important;
  }

  .footer-col h3 {
    color: #2e7d32 !important;
  }

  .footer-col p,
  .footer-col a {
    color: #333 !important;
  }

  .footer-bottom {
    border-top: 1px solid #ccc !important;
  }

  .footer-bottom p {
    color: #666 !important;
  }

  a {
    color: #2e7d32 !important;
    text-decoration: underline !important;
  }

  .section-fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== Page Transitions ===== */
body {
  animation: pageFadeIn 0.6s ease-out;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.section-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Form Accessibility ===== */
.form-control:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.btn-success:focus {
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.3);
}

/* ===== Hide Default Bootstrap Menu on Mobile ===== */
@media (max-width: 768px) {
  #mainNav {
    display: none !important;
  }
}

/* ===== Portfolio Grid ===== */
.portfolio-grid {
  max-width: 1200px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 24px !important;
}

/* ===== Gallery Grid ===== */
.gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
}

/* ===== Mobile Slide-in Menu ===== */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
}

.mobile-menu-overlay.active {
  display: block;
}

.mobile-menu-panel {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: #fff;
  z-index: 1050;
  transition: right 0.3s ease-in-out;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-menu-panel.active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e8e8;
}

.mobile-menu-header img {
  height: 36px;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #333;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
}

.mobile-menu-close:hover {
  background: #f5f5f5;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}

.mobile-menu-nav a {
  padding: 14px 24px;
  color: #333;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-nav a:hover {
  background: #f1f8f2;
  color: #2e7d32;
}

.mobile-menu-nav a.active {
  color: #2e7d32;
  font-weight: 600;
}

.mobile-menu-section {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-section-title {
  padding: 8px 24px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
}

.mobile-menu-dropdown {
  display: none;
  flex-direction: column;
  padding-left: 16px;
}

.mobile-menu-dropdown.open {
  display: flex;
}

.mobile-menu-dropdown a {
  padding: 10px 24px;
  font-size: 14px;
  color: #666;
}

.mobile-menu-dropdown a:hover {
  color: #2e7d32;
}

/* ===== Navbar Dropdown (hover) ===== */
.dropdown-menu {
  display: none;
  margin-top: 0;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  display: block;
}

@media (hover: none) and (pointer: coarse) {
  .dropdown-menu { display: none; }
  .dropdown.open .dropdown-menu { display: block; }
}

.dropdown-item {
  padding: 8px 20px;
  font-size: 14px;
  color: #333;
  transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
  background: #f1f8f2;
  color: #2e7d32;
}

.dropdown-toggle::after {
  margin-left: 6px;
  vertical-align: middle;
}

/* ===== Contact Page ===== */
.contact-map-section {
  height: 70vh;
  position: relative;
  z-index: 1;
}

.contact-map-section iframe {
  border: 0;
}

.contact-cards-overlay {
  position: absolute;
  bottom: -88px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 20px;
  z-index: 50;
  pointer-events: none;
  width: 90%;
  max-width: 1100px;
}

.contact-info-card {
  width: 210px;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 17px 12px;
  pointer-events: auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.contact-info-card h4 {
  font-size: 19px;
  letter-spacing: 0.2px;
  margin: 0;
  line-height: 1.2;
}

.contact-info-card p {
  font-size: 12px;
  line-height: 1.45;
  color: #666;
  margin: 0;
}

.contact-form-section {
  max-width: 960px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  padding-top: 100px;
  padding-bottom: 80px;
  position: relative;
  z-index: 10;
}

.contact-form-title {
  letter-spacing: 0.5px;
}

.contact-form {
  padding-left: 20px;
  padding-right: 20px;
}

.contact-form textarea {
  min-height: 220px;
}

.contact-form .btn:disabled {
  opacity: 0.65;
}

/* ===== Hero ===== */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .location-row { grid-template-columns: repeat(3, 1fr) !important; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 768px) {
  .page-header-section h2 { font-size: 28px; margin-bottom: 8px; }
  .page-header-section p { font-size: 15px; }
  .hero-content h1 { font-size: 32px; }
  .hero-content p { font-size: 16px; }
  .btn-hero { padding: 12px 28px; font-size: 15px; }
  .contact-form { margin-top: 20px; }

  .sister-companies-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .location-row { grid-template-columns: 1fr !important; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .portfolio-grid { grid-template-columns: 1fr !important; max-width: 400px !important; }

  .card-content h3 { font-size: 18px; }
  .card-details p { font-size: 12px; }
  .sister-logo-img { max-width: 80%; max-height: 130px; }
  .sister-logo-card:first-child .sister-logo-img { max-width: 90%; max-height: 160px; }

  .contact-cards-overlay {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    gap: 16px;
    padding: 20px 0;
    pointer-events: auto;
  }

  .contact-info-card {
    width: 100%;
    max-width: 320px;
    aspect-ratio: auto;
    padding: 20px;
  }

  .contact-map-section {
    height: 50vh;
  }

  .contact-form-section {
    padding-top: 40px;
  }
}

@media (max-width: 480px) {
  .sister-companies-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .sister-logo-img { max-width: 85%; max-height: 170px; }
  .sister-logo-card:first-child .sister-logo-img { max-width: 95%; max-height: 200px; }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}
