/* main.css — Consolidated stylesheet with header/footer button override added
   - Full design preserved (header, hero, grids, cards, footer, animations)
   - Added .section-image, refined .page-banner::before, ensured .company-overview-image responsive behavior
   - Added targeted header/footer button styles (white text & border on dark background, white bg + navy text when header.scrolled)
   - Removed duplicate/unused header/footer override sections to avoid conflicts
*/

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy-blue: #003c71;
  --navy-blue-dark: #003a80;
  --gold: #aa9661;
  --white: #ffffff;
  --light-gray: #f4f4f4;
  --dark-gray: #333333;
  --mid-gray: #666666;
  --border-gray: #e0e0e0;
}

/* Global */
html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--dark-gray);
  background: var(--white);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy-blue);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1.25rem;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Header and Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: transparent;
  color: var(--white);
  padding: 20px 0;
  z-index: 1000;
  transition: all 0.35s ease;
  box-shadow: none;
  will-change: background, padding, color;
}

/* Sticky / scrolled header state */
header.scrolled {
  background: var(--white);
  color: var(--navy-blue);
  padding: 10px 0;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
}

nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100px;
}

.logo-image {
  height: 100%;
  width: auto;
  max-width: 400px;
  object-fit: contain;
  transition: transform 0.35s ease, opacity 0.3s ease;
  transform-origin: left center;
  transform: scale(1.3);
}
header.scrolled .logo-image {
  transform: scale(1);
}
.logo:hover .logo-image {
  opacity: 0.95;
}

.logo-accent {
  color: var(--gold);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
}

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

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s ease;
}

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

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: currentColor;
  transition: all 0.3s ease;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-blue) 0%, var(--navy-blue-dark) 100%);
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 60, 113, 0.5) 0%, rgba(0, 58, 128, 0.55) 100%);
  z-index: 1;
}

.hero:hover::before {
  opacity: 0.85;
  transform: scale(1.02);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  animation: fadeInUp 1s ease;
}

.hero-badge {
  display: inline-block;
  background: rgba(170, 150, 97, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1.5rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* Buttons (global) */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  background: transparent;
  color: var(--navy-blue);
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
}

.btn-primary:hover {
  background: #b8a773;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(170, 150, 97, 0.3);
}

.btn-secondary {
  background: #ffffff;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-secondary:hover {
  background: var(--white);
  color: var(--navy-blue);
}

.btn-outline {
  background: #ffffff;
  color: var(--navy-blue);
  border: 2px solid var(--navy-blue);
}

.btn-outline:hover {
  background: var(--navy-blue);
  color: var(--white);
}

/* --- Header & Footer button override (placed here, directly after global button rules) ---
   Behavior:
   - On dark header/footer: transparent background, white text, white border
   - On hover (dark background): white background with navy text
   - When header.scrolled (light background): white background with navy text (contrast)
   This block replaces any earlier attempts and is intentionally scoped to header/footer elements.
*/
header .btn,
header .nav-links .btn,
footer .btn,
footer .nav-links .btn {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
  box-shadow: none;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.12s ease;
}

header .btn:hover,
header .nav-links .btn:hover,
footer .btn:hover,
footer .nav-links .btn:hover {
  background: var(--white);
  color: var(--navy-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

header.scrolled .btn,
header.scrolled .nav-links .btn {
  background: var(--white);
  color: var(--navy-blue);
  border-color: var(--white);
}

header.scrolled .btn:hover,
header.scrolled .nav-links .btn:hover {
  background: #f7f7f7;
  color: var(--navy-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* Ensure header/footer button variants inherit the above */
header .btn-primary,
header .btn-outline,
header .btn-secondary,
footer .btn-primary,
footer .btn-outline,
footer .btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

header.scrolled .btn-primary,
header.scrolled .btn-outline,
header.scrolled .btn-secondary {
  background: var(--white);
  color: var(--navy-blue);
  border-color: var(--white);
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Section Styles */
section {
  padding: 6rem 2rem;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem;
}

.section-subtitle {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--navy-blue);
  margin-bottom: 1.5rem;
}

.section-description {
  color: var(--mid-gray);
  font-size: 1.125rem;
  line-height: 1.7;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid img {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: cover;
  display: block;
}

/* Card Styles */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 2.5rem;
  transition: all 0.3s ease;
  border: 1px solid var(--border-gray);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--gold), #b8a773);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
}

.card h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.card p {
  color: var(--mid-gray);
  margin-bottom: 1.5rem;
}

/* Division Cards */
.division-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  height: 400px;
  background: var(--navy-blue);
}

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

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

.division-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem;
  background: linear-gradient(to top, rgba(0, 60, 113, 0.95), transparent);
  color: var(--white);
}

.division-overlay h3 {
  color: var(--white);
  margin-bottom: 0.75rem;
  font-size: 1.75rem;
}

.division-overlay p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
}

/* Values Grid */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.value-item {
  text-align: center;
  padding: 2rem;
}

.value-image-wrapper {
  width: 220px;
  height: 220px;
  margin: 0 auto 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.value-item:hover .value-image-wrapper {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(170, 150, 97, 0.2);
}

.value-item h4 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.value-item p {
  color: var(--mid-gray);
  font-size: 0.95rem;
}

/* CTA Section */
.cta-section {
  background: var(--navy-blue);
  color: var(--white);
  text-align: center;
  padding: 5rem 2rem;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.1;
}

.cta-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.cta-section h2 {
  color: var(--white);
  margin-bottom: 1.5rem;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
}

/* Footer */
footer {
  background: var(--navy-blue);
  color: var(--white);
  padding: 4rem 2rem 2rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h4 {
  color: var(--gold);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.75rem;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--gold);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--navy-blue);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border-gray);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.form-error {
  color: #e74c3c;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--gold);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  font-size: 1.5rem;
  border: none;
}

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

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(170, 150, 97, 0.4);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    max-width: 300px;
    background: var(--navy-blue);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
  }

  .nav-links.active a {
    color: var(--white);
  }

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

  .hamburger {
    display: flex;
    z-index: 1001;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  section {
    padding: 4rem 1.5rem;
  }

  .hero {
    padding: 6rem 1.5rem 3rem;
  }

  .division-card {
    height: 350px;
  }

  .logo {
    height: 80px;
  }

  .logo-image {
    max-width: 300px;
  }

  .value-image-wrapper {
    width: 180px;
    height: 180px;
  }
}

/* Page-Specific Styles */
.page-banner {
  background: var(--navy-blue);
  color: var(--white);
  padding: 8rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Allow per-page inline style (page-specific CSS) to attach background-image */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.75;
  z-index: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-banner:hover::before {
  opacity: 0.85;
  transform: scale(1.01);
}

.page-banner::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 60, 113, 0.5) 0%, rgba(0, 58, 128, 0.55) 100%);
  z-index: 0;
}

.page-banner > .container {
  position: relative;
  z-index: 1;
}

.page-banner h1 {
  color: var(--white);
}

.page-banner p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
}

.content-section {
  max-width: 900px;
  margin: 0 auto;
}

.content-section img {
  width: 100%;
  border-radius: 12px;
  margin: 2rem 0;
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  text-align: center;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 20px;
  }
}
@media (max-width: 500px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-item {
  padding: 10px;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: rgb(18, 9, 9);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Timeline */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold);
  transform: translateX(-50%);
}

.timeline-item {
  margin-bottom: 3rem;
  position: relative;
}

.timeline-content {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  width: calc(50% - 40px);
}

.timeline-item:nth-child(odd) .timeline-content {
  margin-left: auto;
  margin-left: calc(50% + 40px);
}

.timeline-item:nth-child(even) .timeline-content {
  margin-right: calc(50% + 40px);
}

@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }

  .timeline-content {
    width: calc(100% - 60px) !important;
    margin-left: 60px !important;
  }

  .timeline-item:nth-child(even) .timeline-content {
    margin-right: 0 !important;
  }
}

/* Company Overview Image Styles */
.company-overview-image {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Section thumbnails and small images */
.section-image {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  margin-bottom: 1rem;
  border-radius: 8px;
  object-fit: cover;
}

/* Form UX additions */

/* Inline form message box */
.form-message {
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  word-break: break-word;
}

/* Type variants */
.form-success {
  background: linear-gradient(90deg, #2a9d8f, #2bb673);
  border: 1px solid rgba(0,0,0,0.04);
}

.form-error-inline {
  background: linear-gradient(90deg, #e85a5a, #d64545);
  border: 1px solid rgba(0,0,0,0.04);
}

/* field-level inline errors displayed near input fields */
.field-error {
  color: #e74c3c;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Provide compatibility for legacy .form-error usage */
.form-error {
  color: #e74c3c;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: block;
}

/* Disabled submit button state and simple spinner state */
button[disabled],
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Visual indicator when sending */
.btn.loading {
  position: relative;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  margin-left: 8px;
  vertical-align: middle;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { transform: translateY(0); opacity: 0.9; }
  to   { transform: translateY(-3px); opacity: 1; }
}

/* compact forms on small screens */
@media (max-width: 768px) {
  .contact-form { padding: 2rem; }
  .btn.loading::after { width: 6px; height: 6px; }
}

/* Page banner subtle filter/transform for consistent visuals */
.page-banner::before {
  filter: grayscale(0.06) contrast(0.95);
  transform-origin: center;
}

/* spacing for contact sections */
#commodity-inquiry,
#supplier-registration,
#buyer-registration {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Ensure long messages wrap and are readable */
.form-message, .field-error {
  word-break: break-word;
}

.fade-in.visible { will-change: opacity, transform; }

/* End of consolidated stylesheet */