/**
 * FKI Traders Sdn. Bhd. - Layout CSS
 * Header, Navigation, Mobile Drawer, Black Footer, Floating Actions, Grid Systems
 */

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  transition: height var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

@media (max-width: 1023px) {
  .site-header {
    height: var(--header-height-mobile);
  }
}

/* Scrolled state: slightly shorter with soft shadow and frosted clarity */
.site-header.is-scrolled {
  height: 68px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 1023px) {
  .site-header.is-scrolled {
    height: 60px;
  }
}

/* Home header uses solid white identically (no transparent/blue header) */
.site-header--home {
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
}

.site-header--home.is-scrolled {
  height: 68px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 1023px) {
  .site-header--home.is-scrolled {
    height: 60px;
  }
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Brand Link: Logo + Divider + Company Name */
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 640px) {
  .brand-logo {
    height: 38px;
  }
}

.brand-divider {
  display: none;
  width: 1px;
  height: 24px;
  background-color: var(--line);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .brand-divider {
    display: block;
  }
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--charcoal);
  letter-spacing: -0.015em;
  display: inline-block;
  white-space: nowrap;
}

.brand-name--highlight {
  color: var(--brand-blue);
}

@media (max-width: 640px) {
  .brand-name {
    font-size: 1.05rem;
  }
}

/* Nav Menu (Desktop) */
.nav-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.85rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--charcoal);
  text-decoration: none;
  padding: 0.5rem 0;
  position: relative;
  transition: color var(--transition-fast);
}

/* Gold underline grows from center on hover/active */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--brand-gold);
  transition: width var(--transition-normal), left var(--transition-normal);
  border-radius: 2px;
}

.nav-link:hover {
  color: var(--brand-blue-2);
}

.nav-link:hover::after {
  width: 100%;
  left: 0;
}

.nav-link.is-active {
  color: var(--brand-blue);
  font-weight: 700;
}

.nav-link.is-active::after {
  width: 100%;
  left: 0;
  background: var(--brand-gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Header Quote Button: Gold gradient with Charcoal text */
.header-actions .btn {
  background: var(--grad-gold);
  color: var(--charcoal);
  font-weight: 700;
  border: none;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-button);
}

.header-actions .btn:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--charcoal);
}

/* Mobile Toggle Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  z-index: 1002;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.nav-toggle:hover {
  border-color: var(--brand-blue-2);
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle__bar {
  width: 22px;
  height: 2px;
  background-color: var(--charcoal);
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-fast);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Page Inner Banner (Global Layout - Prevents Navbar Overlap)
   ========================================================================== */
.page-banner {
  position: relative;
  min-height: 36vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-height-mobile) + 2.25rem);
  padding-bottom: 3.5rem;
  color: var(--charcoal);
  background: var(--grad-page-soft);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 1024px) {
  .page-banner {
    min-height: 42vh;
    padding-top: calc(var(--header-height) + 3rem);
    padding-bottom: 4.5rem;
  }
}

.page-banner__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.page-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 246, 250, 0.88) 60%, rgba(235, 240, 248, 0.70) 100%);
  z-index: 2;
}

.page-banner__content {
  position: relative;
  z-index: 3;
  max-width: 820px;
}

.page-banner__title {
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  color: var(--text-900);
  margin-bottom: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: var(--lh-h1);
}

.page-banner__subtitle {
  font-size: clamp(1.05rem, 1.2vw, 1.25rem);
  color: var(--text-700);
  margin: 0;
  line-height: 1.6;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-500);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--brand-blue);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--brand-blue-2);
  text-decoration: underline;
}

/* ==========================================================================
   Mobile Navigation Drawer (Redesigned - Clean & Elegant)
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 88%;
  max-width: 380px;
  background: #FFFFFF;
  color: var(--charcoal);
  z-index: 1060;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.22);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: #FFFFFF;
}

.drawer__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.drawer__logo-badge {
  background: #FFFFFF;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.drawer__logo {
  height: 28px;
  width: auto;
}

.drawer__brand-text {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--charcoal);
  letter-spacing: -0.01em;
}

.drawer__close {
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--charcoal);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: all var(--transition-fast);
}

.drawer__close:hover {
  background: var(--brand-blue);
  color: #FFFFFF;
  border-color: var(--brand-blue);
  transform: rotate(90deg);
}

.drawer__nav-wrap {
  flex: 1;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.drawer__nav-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-500);
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

.drawer__nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
}

.drawer__link {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  background: transparent;
  transition: all var(--transition-fast);
}

.drawer__link-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer__link-num {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-500);
}

.drawer__link:hover {
  background: var(--bg-1);
  color: var(--brand-blue);
  padding-left: 1.25rem;
}

.drawer__link.is-active {
  background: var(--bg-2);
  color: var(--brand-blue);
  border-left: 3px solid var(--brand-gold);
}

.drawer__link-arrow {
  color: var(--text-500);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.drawer__link:hover .drawer__link-arrow,
.drawer__link.is-active .drawer__link-arrow {
  color: var(--brand-gold);
  transform: translateX(3px);
}

/* Redesigned Corporate Drawer Footer (No Clunky Action Buttons) */
.drawer__footer {
  margin-top: auto;
  padding: 1.5rem;
  background: var(--bg-1);
  border-top: 1px solid var(--line);
}

.drawer__corp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(11, 61, 145, 0.08);
  border: 1px solid rgba(11, 61, 145, 0.2);
  color: var(--brand-blue);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer__footer-address {
  font-size: 0.82rem;
  color: var(--text-700);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.drawer__footer-contact {
  font-size: 0.82rem;
  color: var(--text-500);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.drawer__footer-contact a {
  color: var(--brand-blue);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.drawer__footer-contact a:hover {
  color: var(--brand-blue-2);
  text-decoration: underline;
}

/* ==========================================================================
   Footer (Black Theme)
   ========================================================================== */
.site-footer {
  background-color: var(--bg-footer);
  color: var(--text-on-dark);
  padding-top: 5rem;
  padding-bottom: 0;
  position: relative;
  border-top: 3px solid var(--brand-gold);
  background-image: linear-gradient(to right, #D4AF37 0%, #F6E39A 50%, #D4AF37 100%);
  background-size: 100% 3px;
  background-repeat: no-repeat;
  background-position: top;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem 2rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.4fr 0.9fr 1fr 1.1fr;
  }
}

/* Brand column & Logo badge */
.footer-logo-badge {
  display: inline-block;
  background-color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.footer-logo-badge img {
  height: 38px;
  width: auto;
  display: block;
}

.footer-brand-title {
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.footer-about {
  color: var(--text-on-dark-muted);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 1.25rem;
  position: relative;
  display: inline-block;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--brand-gold);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--text-on-dark-muted);
  font-size: 0.92rem;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links a:hover {
  color: var(--brand-gold);
  transform: translateX(4px);
}

.footer-contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-on-dark-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.footer-contact-item a {
  color: var(--text-on-dark-muted);
  transition: color var(--transition-fast);
}

.footer-contact-item a:hover {
  color: var(--brand-gold);
}

.footer-contact-icon {
  color: var(--brand-gold);
  margin-top: 0.2rem;
  flex-shrink: 0;
}

/* Footer Bottom Bar */
.footer-bottom {
  background-color: var(--bg-footer-bar);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.75rem 0;
  margin-top: 2rem;
}

.footer-bottom-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--text-on-dark-muted);
}

@media (min-width: 768px) {
  .footer-bottom-container {
    flex-direction: row;
  }
}

.footer-bottom p {
  color: var(--text-on-dark-muted);
  margin-bottom: 0;
}

.footer-bottom-diamond {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--brand-gold);
  transform: rotate(45deg);
  margin: 0 0.5rem;
  vertical-align: middle;
}

/* Mobile Divider between footer columns */
@media (max-width: 639px) {
  .footer-grid > div:not(:last-child) {
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
}

/* ==========================================================================
   Floating Actions (Back to Top Only - Call button removed per request)
   ========================================================================== */
.floating-actions {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-end;
}

.btn-floating {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  border: none;
  text-decoration: none;
}

/* Back to Top: White circle with line border, blue arrow, gold ring on hover */
.btn-floating--top {
  background: #FFFFFF;
  color: var(--brand-blue);
  border: 1px solid var(--line);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.btn-floating--top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.btn-floating--top:hover {
  background: #FFFFFF;
  color: var(--brand-blue-2);
  transform: translateY(-3px);
  box-shadow: 0 0 0 3px var(--brand-gold), var(--shadow-md);
}

/* ==========================================================================
   Grids & Responsive Cards
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 480px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.grid-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .grid-split {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   Project Track & Client Cards (100% Mobile Responsive)
   ========================================================================== */
.route-card-box {
  background: var(--bg-1);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  border: 1px solid var(--line);
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .route-card-box {
    padding: 2.25rem;
  }
}

.route-map-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  padding-bottom: 0.5rem;
}

.route-map-scroll-wrap::-webkit-scrollbar {
  height: 6px;
}

.route-map-scroll-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.route-map-scroll-wrap::-webkit-scrollbar-thumb {
  background: var(--brand-gold);
  border-radius: 3px;
}

.route-map-svg {
  min-width: 720px;
  width: 100%;
  height: auto;
  display: block;
}

.route-map-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-500);
  margin-top: 0.65rem;
  font-weight: 500;
}

@media (min-width: 768px) {
  .route-map-hint {
    display: none;
  }
  .route-map-svg {
    min-width: auto;
  }
}

/* Responsive Client Cards Grid */
.client-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 480px) {
  .client-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 768px) {
  .client-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .client-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }
}

.client-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.1rem 0.9rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--brand-blue);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  word-break: break-word;
}

.client-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-gold);
  box-shadow: var(--shadow-md);
}

@media (min-width: 1024px) {
  .client-card--full {
    grid-column: span 4;
  }
}

/* ==========================================================================
   Product Category Select (Mobile Dropdown / Desktop Tabs)
   ========================================================================== */
.category-select-wrapper {
  display: none;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .tabs-nav-wrapper {
    display: none !important;
  }
  .category-select-wrapper {
    display: block;
  }
}

.category-select-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-500);
  margin-bottom: 0.5rem;
}

.category-select-box {
  position: relative;
  width: 100%;
}

.category-dropdown {
  width: 100%;
  padding: 0.95rem 3rem 0.95rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--charcoal);
  background-color: #FFFFFF;
  border: 2px solid var(--brand-blue);
  border-radius: var(--radius-md);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.category-dropdown:focus {
  outline: none;
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

.category-select-arrow {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--brand-blue);
  display: flex;
  align-items: center;
}
