/* ==========================================================
   MoreTech WEB360 — LAYOUT COMPONENTS
   Layer: 2 (Structural)
   Version: 2.0.0
   ──────────────────────────────────────────────────────────
   Depends on: 00-tokens.css, 01-foundation.css
   Contains:
     §1  Header System (Utility Bar + Navbar + Dropdown)
     §2  Hero System (Industrial + Context variant)
     §3  Footer System
     §4  Overlay Modal System
   ========================================================== */


/* ██████████████████████████████████████████████████████████
   §1  HEADER SYSTEM
   ██████████████████████████████████████████████████████████ */

/* ── Shell ── */
.site-header {
  position: relative;
  z-index: var(--mt-z-header);
  background: var(--mt-surface-header);
}

/* ── Fixed Header Stack ── */
.fixed-header-stack {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--mt-z-header);
  background: var(--mt-surface-header);
  box-shadow: var(--mt-shadow-sm);
}

/* Spacer: Prevents page content from hiding behind fixed header */
.header-spacer {
  height: 130px; /* utility bar (~40) + navbar (~74) + divider (4) + buffer */
}

@media (max-width: 991px) {
  .header-spacer {
    height: 110px;
  }
}

@media (max-width: 767px) {
  .header-spacer {
    height: 100px;
  }
}

/* ── Divider below header ── */
.header-divider {
  height: 4px;
  background: linear-gradient(
    90deg,
    rgba(var(--mt-brand-primary-rgb), 0.2),
    rgba(var(--mt-brand-primary-rgb), 0.75),
    rgba(var(--mt-brand-primary-rgb), 0.2)
  );
}


/* ----------------------------------------------------------
   TOP UTILITY BAR
---------------------------------------------------------- */
.top-utility-bar {
  background: var(--mt-surface-utility);
  color: var(--mt-text-inverse);
  font-size: var(--mt-text-xs);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.top-utility-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mt-space-6);
  min-height: 40px;
}

.top-links {
  font-weight: var(--mt-weight-semibold);
  letter-spacing: 0.25px;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  max-width: 40%;
}

.top-utility-bar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: var(--mt-weight-medium);
  padding: 6px 10px;
  border-radius: var(--mt-radius-full);
  color: rgba(255, 255, 255, 0.9);
  transition: all var(--mt-duration-fast) ease;
}

.top-utility-bar a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.top-utility-bar i,
.top-utility-bar svg {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ── Top Bar: Actions Group ── */
.top-actions {
  display: flex;
  align-items: center;
  gap: var(--mt-space-1);
}

/* ── Top Bar: Action Links ── */
.top-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: var(--mt-text-xs);
  font-weight: var(--mt-weight-medium);
  padding: 6px 10px;
  border-radius: var(--mt-radius-full);
  color: rgba(255, 255, 255, 0.9);
  transition: all var(--mt-duration-fast) ease;
  white-space: nowrap;
}

.top-action-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* WhatsApp accent */
.top-action-link--whatsapp:hover {
  background: rgba(37, 211, 102, 0.20);
}

/* Hide text labels on small screens, keep icons */
@media (max-width: 991px) {
  .top-action-link span {
    display: none;
  }

  .top-action-link {
    padding: 6px 8px;
  }
}

/* ── Top Bar: Separator & Tagline ── */
.top-separator {
  opacity: 0.4;
  margin: 0 var(--mt-space-1);
}

.top-tagline {
  font-size: var(--mt-text-xs);
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
  max-width: 300px;
}


/* ----------------------------------------------------------
   SEARCH (Utility Bar)
---------------------------------------------------------- */
.top-search {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.top-search input {
  width: 100%;
  border: none;
  border-radius: var(--mt-radius-full);
  padding: 8px 44px 8px 18px;
  font-size: 0.78rem;
  font-family: var(--mt-font-sans);
  background: var(--mt-neutral-0);
  box-shadow: var(--mt-shadow-sm);
  outline: none;
  transition: box-shadow var(--mt-duration-normal) var(--mt-ease-default);
}

.top-search input:focus {
  box-shadow:
    0 0 0 2px var(--mt-border-focus),
    var(--mt-shadow-sm);
}

.top-search button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--mt-brand-primary);
  cursor: pointer;
}


/* ----------------------------------------------------------
   NAVBAR
---------------------------------------------------------- */
.navbar {
  background: var(--mt-surface-header);
  border-bottom: 1px solid var(--mt-border-default);
  padding: 14px 0;
}

.site-logo {
  max-height: 116px;
  transition: opacity var(--mt-duration-fast) ease;
}

.site-logo:hover {
  opacity: 0.85;
}

/* Nav Links */
.navbar-nav .nav-link {
  position: relative;
  font-weight: var(--mt-weight-semibold);
  font-size: var(--mt-text-sm);
  padding: 8px 14px;
  color: var(--mt-text-heading);
  transition: color var(--mt-duration-fast) ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--mt-brand-primary);
}

/* Underline indicator */
.navbar-nav .nav-link::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  background: var(--mt-brand-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--mt-duration-normal) var(--mt-ease-default);
}

.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before {
  transform: scaleX(1);
}


/* ----------------------------------------------------------
   DROPDOWN
---------------------------------------------------------- */
.navbar-nav .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.navbar-nav .dropdown-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition:
    transform var(--mt-duration-normal) var(--mt-ease-default),
    opacity var(--mt-duration-fast) ease;
  opacity: 0.7;
}

.navbar-nav .dropdown-toggle.show::after {
  transform: rotate(-135deg);
  opacity: 1;
}

.dropdown-menu {
  background: var(--mt-surface-dropdown);
  border-radius: var(--mt-radius-md);
  border: 1px solid var(--mt-border-default);
  padding: 8px;
  box-shadow: var(--mt-shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--mt-duration-normal) ease,
    transform var(--mt-duration-normal) var(--mt-ease-default);
}

.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
}

.dropdown-item {
  font-size: var(--mt-text-sm);
  padding: 9px 14px;
  border-radius: 8px;
  transition: background var(--mt-duration-fast) ease;
}

.dropdown-item:hover {
  background: var(--mt-brand-primary-soft);
  color: var(--mt-brand-primary);
}

/* Navbar CTA Button */
.navbar .btn-primary {
  font-size: 0.78rem;
  padding: 9px 22px;
  color: var(--mt-text-inverse);
}

.navbar .btn-primary:hover {
  color: var(--mt-text-inverse);
}


/* ----------------------------------------------------------
   MOBILE COLLAPSED MENU
---------------------------------------------------------- */
@media (max-width: 991px) {
  .navbar-collapse {
    background: var(--mt-surface-raised);
    border-top: 1px solid var(--mt-border-default);
    margin-top: var(--mt-space-3);
    padding: var(--mt-space-4) 0;
    border-radius: 0 0 var(--mt-radius-md) var(--mt-radius-md);
  }

  .navbar-nav .nav-link {
    padding: var(--mt-space-3) var(--mt-space-4);
    border-radius: var(--mt-radius-sm);
  }

  .navbar-nav .nav-link:hover {
    background: var(--mt-brand-primary-soft);
  }

  /* Remove underline indicator on mobile — use background instead */
  .navbar-nav .nav-link::before {
    display: none;
  }

  .navbar-nav .nav-link.active {
    background: var(--mt-brand-primary-soft);
    color: var(--mt-brand-primary);
  }

  /* Dropdown in mobile */
  .dropdown-menu {
    border: none;
    box-shadow: none;
    padding-left: var(--mt-space-4);
    background: transparent;
  }

  .dropdown-item {
    padding: var(--mt-space-2) var(--mt-space-4);
  }
}


/* ----------------------------------------------------------
   HEADER RESPONSIVE
---------------------------------------------------------- */
@media (max-width: 991px) {
  .navbar {
    padding: 0.65rem 0;
  }

  .navbar .site-logo {
    max-height: 44px;
  }

  .navbar .btn {
    padding: 0.45rem 1rem;
    font-size: 0.86rem;
  }

  .top-utility-bar {
    font-size: 0.68rem;
  }

  .top-search {
    max-width: 200px;
  }

  .top-links .top-tagline {
    display: none;
  }

  .top-links .top-separator {
    display: none;
  }
}

@media (max-width: 767px) {
  .top-utility-bar .container {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--mt-space-2);
  }

  .top-search {
    max-width: 100%;
    order: 3;
    width: 100%;
  }

  .top-links {
    text-align: center;
    width: 100%;
  }

  .top-actions {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 575px) {
  /* Hide utility bar entirely on very small screens */
  .top-utility-bar {
    display: none;
  }

  .header-spacer {
    height: 74px; /* Only navbar + divider */
  }
}


/* ██████████████████████████████████████████████████████████
   §2  HERO SYSTEM
   ██████████████████████████████████████████████████████████ */

/* ----------------------------------------------------------
   HERO SYSTEM — moved to web/assets/css/hero-css-v2.css
   ----------------------------------------------------------
   This file used to carry its own full, older copy of the Hero engine
   (.hero-industrial root/overlay/typography/proof/actions/slideshow
   scaffold + animation + responsive). Removed 2026-09-16 (Hero
   Architectural Audit, CSS-duplication investigation) once confirmed:
   (a) hero-css-v2.css + hero-media-types.css are now linked in every
       template's head-css.php, always AFTER this file, so they were
       already the effective styling for every property this file also
       declared, on every template except ally_monday;
   (b) ally_monday was the one template missing those two links (fixed
       in the same pass — see ally_monday/head-css.php);
   (c) this file's copy was strictly older/incomplete: no
       .hero-description rule at all, no hero--purpose-*/hero--type-*
       intent-class support, no reduced-motion/focus-visible rules, and
       its .hero-industrial::before/::after overlay+glow were hardcoded
       colors that never read the --hero-overlay-start/-end custom
       properties the renderer sets from the admin's overlay_opacity —
       meaning that control silently did nothing wherever this copy was
       the one in effect (ally_monday only, after fix (b) above, this
       file no longer being loaded for Hero purposes at all removes
       that dead control path);
   (d) this file's `.hero-industrial .container { text-align: center; }`
       had no media-query guard and no !important, so — being the only
       place that exact declaration existed anywhere — it silently
       forced center alignment on EVERY template's Content Hero /
       universal-renderer fallback path regardless of the admin's
       text_align setting. hero-css-v2.css never redeclares text-align
       outside its own intentional, !important, max-width:767px "force
       center on mobile for readability" rule — so removing this file's
       unguarded copy is what finally lets the admin's left/right
       setting take visible effect on desktop. This is a genuine
       behavior change (admin-visible), not a no-op cleanup — flagged
       as a RUNTIME PENDING item, not assumed safe by inspection alone.
   The .hero-slider/.hero-slide/.hero-nav slideshow scaffold removed
   here was a byte-identical duplicate of the copy already in
   hero-css-v2.css (itself marked "preserved for future use"); confirmed
   unreferenced by any current PHP or JS in the repo.
---------------------------------------------------------- */

/* ██████████████████████████████████████████████████████████
   §3  FOOTER SYSTEM
   ██████████████████████████████████████████████████████████ */

.site-footer {
  position: relative;
  background: var(--mt-gradient-dark);
  color: #cbd5f5;
  padding: 72px 0 36px;
  overflow: hidden;
}

/* Top glow line */
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 140px;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    var(--mt-brand-primary),
    transparent
  );
  transform: translateX(-50%);
  opacity: 0.6;
}

/* Headings */
.site-footer h4,
.site-footer h5,
.site-footer h6 {
  color: #ffffff;
  font-weight: var(--mt-weight-bold);
  letter-spacing: var(--mt-tracking-tight);
}

/* Body text */
.site-footer p,
.site-footer span,
.site-footer li {
  color: #cbd5f5;
  font-size: 0.9rem;
  line-height: 1.65;
}

.footer-muted {
  color: var(--mt-neutral-400);
}

/* Links */
.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 6px;
}

.footer-links a,
.site-footer a {
  color: #cbd5f5;
  font-size: 0.9rem;
  text-decoration: none;
  transition:
    color var(--mt-duration-fast) ease,
    transform var(--mt-duration-fast) ease;
  display: inline-block;
}

.footer-links a:hover,
.site-footer a:hover {
  color: var(--mt-brand-primary);
  transform: translateX(2px);
}

/* Map */
.footer-map {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--mt-radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* WhatsApp */
.site-footer .btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--mt-radius-full);
}

.site-footer .btn-success:hover {
  opacity: 0.9;
}

/* Divider */
.footer-line {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.18),
    transparent
  );
}

/* Bottom */
.site-footer .footer-bottom {
  font-size: 0.8rem;
  color: var(--mt-neutral-400);
}

/* Responsive */
@media (max-width: 767px) {
  .site-footer {
    padding: 56px 0 28px;
    text-align: center;
  }

  .footer-links a {
    display: block;
    margin-bottom: 8px;
  }

  .footer-map iframe {
    width: 100% !important;
    height: 180px !important;
  }
}


/* ██████████████████████████████████████████████████████████
   §4  OVERLAY MODAL SYSTEM
   ██████████████████████████████████████████████████████████ */

.mt-overlay-wrapper {
  position: fixed;
  inset: 0;
  z-index: var(--mt-z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--mt-duration-normal) ease;
}

.mt-overlay-wrapper.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Backdrop */
.mt-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
}

/* Modal */
.mt-overlay-modal {
  position: relative;
  margin-top: 12vh;
  max-width: 480px;
  width: calc(100% - 32px);
  background: var(--mt-surface-raised);
  color: var(--mt-text-heading);
  border-radius: var(--mt-radius-xl);
  padding: 30px 28px;
  box-shadow: var(--mt-shadow-xl);
  text-align: center;
  transform: translateY(20px) scale(0.98);
  transition: transform var(--mt-duration-slow) ease;
}

.mt-overlay-wrapper.is-open .mt-overlay-modal {
  transform: translateY(0) scale(1);
}

/* Close */
.mt-overlay-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--mt-text-muted);
  cursor: pointer;
  transition: color var(--mt-duration-fast) ease;
}

.mt-overlay-close:hover {
  color: var(--mt-text-heading);
}

/* Content */
.mt-overlay-content h2,
.mt-overlay-content h3 {
  margin-bottom: 12px;
  font-weight: var(--mt-weight-bold);
}

.mt-overlay-content p {
  font-size: 0.95rem;
  line-height: var(--mt-leading-normal);
  color: var(--mt-text-muted);
}

/* Actions */
.mt-overlay-actions {
  margin-top: 22px;
}

.mt-overlay-actions .btn {
  padding-left: 34px;
  padding-right: 34px;
}

/* Don't show again */
.mt-overlay-dont-show {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--mt-text-muted);
}

/* Responsive */
@media (max-width: 575px) {
  .mt-overlay-modal {
    margin-top: 16vh;
    padding: 26px 22px;
  }
}
