/* 4Msolutions – Company site styles */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --text: #2c3e50;
  --text-muted: #5a6c7d;
  --accent: #1e88e5;
  --accent-hover: #1565c0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
  --radius: 8px;
  --nav-height: 60px;
  --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ----- Header / Nav ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
@media (max-width: 480px) {
  .site-header .inner { padding: 0 0.75rem; }
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--accent);
}
.logo:hover { color: var(--accent-hover); }
.logo-mark {
  display: block;
  height: 32px;
  width: auto;
}
.logo-divider {
  width: 1px;
  height: 28px;
  background: rgba(0,0,0,0.08);
}
.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.logo-title {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.logo-subtitle {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}
@media (max-width: 480px) {
  .logo-text { max-width: 120px; }
  .logo-title { font-size: 1rem; }
  .logo-subtitle { font-size: 0.65rem; letter-spacing: 0.08em; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  padding: 0.5rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
}
.nav-links a:hover { background: var(--bg-alt); color: var(--accent); }
.nav-links a.active { color: var(--accent); background: rgba(30,136,229,0.08); }

.nav-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(30,136,229,0.08);
}
.header-phone:hover {
  background: rgba(30,136,229,0.16);
}
.header-phone svg {
  width: 16px;
  height: 16px;
}
.search-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
}
.search-trigger:hover { background: var(--bg-alt); color: var(--accent); }

/* Search dropdown */
.search-wrap {
  position: absolute;
  top: 100%;
  right: 1rem;
  margin-top: 4px;
  width: min(320px, calc(100vw - 2rem));
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 0.75rem;
  display: none;
}
.search-wrap.open { display: block; }
.search-wrap input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e0e4e8;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* Mobile nav */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .header-phone .phone-text { display: none; }
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a { display: block; padding: 0.75rem; width: 100%; }
}

/* ----- Layout ----- */
.page { min-height: calc(100vh - 200px); }
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
  min-width: 0;
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
}
.section { padding: 4rem 0; }
@media (max-width: 768px) {
  .section { padding: 2.5rem 0; }
}
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 1.75rem; margin: 0 0 1rem; color: var(--text); word-wrap: break-word; }
@media (max-width: 480px) {
  .section-title { font-size: 1.35rem; }
}
.section-lead { color: var(--text-muted); max-width: 640px; margin: 0 0 2rem; }
@media (max-width: 480px) {
  .section-lead { max-width: 100%; font-size: 0.95rem; }
}

/* ----- Hero ----- */
.hero {
  position: relative;
  padding: 4rem 0 5rem;
  overflow: hidden;
}
@media (max-width: 768px) {
  .hero { padding: 2rem 0 3rem; }
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f7fc 50%, #e8f0f8 100%);
  opacity: 0.95;
  animation: heroGlow 14s ease-in-out infinite alternate;
}
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(30,136,229,0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(30,136,229,0.05) 0%, transparent 35%);
  pointer-events: none;
}
.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30z' fill='none' stroke='%231e88e5' stroke-width='0.5'/%3E%3C/svg%3E");
  pointer-events: none;
  background-size: 60px 60px;
  transform-origin: center;
  animation: heroDrift 30s linear infinite;
}
.hero .container { position: relative; z-index: 1; max-width: 100%; }
.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin: 0 0 0.75rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.25rem; line-height: 1.35; }
}
.hero .subtext {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 1.75rem;
  overflow-wrap: break-word;
  word-break: normal;
}
@media (max-width: 480px) {
  .hero .subtext { font-size: 0.95rem; max-width: 100%; }
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow); }
.btn-secondary {
  background: var(--bg);
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-secondary:hover { background: rgba(30,136,229,0.08); }

/* ----- Product cards (home) ----- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
}
.product-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.product-card h3 { margin: 0 0 0.35rem; font-size: 1.1rem; color: var(--text); }
.product-card p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.product-card .icon {
  width: 40px;
  height: 40px;
  background: rgba(30,136,229,0.12);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

/* Software product illustrations (keep compact, not full-width) */
.software-product .icon {
  width: 120px;
  height: auto;
  margin: 0 0 1rem;
  display: block;
}
.software-product .icon svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ----- Why 4Msolutions ----- */
.reasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.reason {
  padding: 1.5rem;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.reason:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.reason h3 { margin: 0 0 0.5rem; font-size: 1.1rem; color: var(--accent); }
.reason p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }

/* ----- Regions / Countries map ----- */
.clients-section {
  position: relative;
  padding: 4rem 0;
  background: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
}
.clients-section .container { position: relative; z-index: 1; }
.clients-section .section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.clients-section .section-title::before {
  content: '';
  width: 3px;
  height: 1.6em;
  border-radius: 999px;
  background: var(--accent);
}
.regions-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
}
@media (max-width: 900px) {
  .regions-layout {
    grid-template-columns: 1fr;
  }
}
.regions-map {
  position: relative;
  border-radius: var(--radius);
  padding: 0.5rem;
}
.regions-map svg {
  display: block;
  width: 100%;
  height: auto;
}
.map-pin {
  fill: var(--accent);
  stroke: #ffffff;
  stroke-width: 1.5;
  cursor: pointer;
  transform-origin: center;
  animation: pinPulse 2.4s ease-in-out infinite;
}
.map-pin:nth-child(2) { animation-delay: 0.2s; }
.map-pin:nth-child(3) { animation-delay: 0.4s; }
.map-pin:nth-child(4) { animation-delay: 0.6s; }
.map-pin:nth-child(5) { animation-delay: 0.8s; }
.map-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -120%);
  padding: 0.25rem 0.5rem;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.75rem;
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}
.map-tooltip.visible {
  opacity: 1;
}
.regions-list h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--text);
}
.map-label {
  font-size: 11px;
  fill: var(--accent);
}
.map-guide {
  stroke: rgba(30,136,229,0.4);
  stroke-width: 1;
}
.regions-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.regions-list li {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  color: var(--text-muted);
  box-shadow: var(--shadow);
  cursor: default;
}
.regions-list li.is-active {
  background: rgba(30,136,229,0.1);
  color: var(--accent);
}

/* ----- Software page: layout with sidebar ----- */
.software-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .software-layout { grid-template-columns: 1fr; }
}

/* Right-side product list (desktop) */
.software-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
}
.sidebar-title { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 0.75rem; }
.software-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.software-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.software-nav a:hover { background: var(--bg-alt); color: var(--accent); }
.software-nav a.active { background: rgba(30,136,229,0.12); color: var(--accent); }
.nav-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(30,136,229,0.15);
  font-size: 0.85rem;
  color: var(--accent);
}
.software-nav .nav-icon {
  flex-shrink: 0;
}

/* Mobile: horizontal scroll product list */
.software-nav-mobile {
  display: none;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.software-nav-mobile::-webkit-scrollbar { height: 6px; }
.software-nav-mobile a {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  background: var(--bg-alt);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.software-nav-mobile a:hover, .software-nav-mobile a.active { background: rgba(30,136,229,0.15); color: var(--accent); }
@media (max-width: 900px) {
  .software-sidebar { display: none; }
  .software-nav-mobile { display: flex; }
}

/* Product section (scroll target) */
.software-product {
  scroll-margin-top: calc(var(--nav-height) + 1rem);
  padding: 2rem 0;
  border-bottom: 1px solid #e8ecf0;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.software-product:last-child { border-bottom: none; }
.software-product:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.software-product h2 { margin: 0 0 0.75rem; font-size: 1.5rem; color: var(--text); }
.software-product .desc { color: var(--text-muted); margin: 0 0 1rem; }
.software-product ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}
.software-product ul li { margin-bottom: 0.35rem; }
.software-product .who { font-size: 0.95rem; color: var(--text); margin: 0 0 1rem; }
.software-product .who strong { color: var(--accent); }
.software-product .ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.software-product .ctas .btn { font-size: 0.9rem; padding: 0.55rem 1rem; }

/* ----- Profile ----- */
.profile-intro { max-width: 720px; margin-bottom: 2rem; }
.profile-intro p { margin: 0 0 1rem; color: var(--text-muted); }
.mission-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.mv-card {
  background: var(--bg-alt);
  padding: 1.5rem;
  border-radius: var(--radius);
}
.mv-card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; color: var(--accent); }
.mv-card p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }

/* ----- Hardware ----- */
.hardware-list { max-width: 640px; }
.hardware-list h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; color: var(--text); }
.hardware-list h3:first-child { margin-top: 0; }
.hardware-list p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* ----- Contact ----- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info h2 { margin: 0 0 1rem; font-size: 1.35rem; }
.contact-details { list-style: none; margin: 0; padding: 0; }
.contact-details li { margin-bottom: 0.75rem; display: flex; align-items: flex-start; gap: 0.5rem; }
.contact-details .label { font-weight: 600; color: var(--text); min-width: 70px; }
.contact-details a { color: var(--accent); text-decoration: none; }
.contact-details a:hover { text-decoration: underline; }
.contact-form .form-group { margin-bottom: 1rem; }
.contact-form label { display: block; font-weight: 500; margin-bottom: 0.35rem; color: var(--text); }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e0e4e8;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form .btn { margin-top: 0.5rem; }
.contact-form .hidden { position: absolute; left: -9999px; }
.whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
}
.whatsapp-link:hover { background: #20bd5a; color: #fff; }

/* ----- Footer ----- */
.site-footer {
  background: var(--text);
  color: #b0b8c0;
  padding: 2rem 0;
  margin-top: 3rem;
}
.site-footer .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  text-align: center;
}
@media (max-width: 480px) {
  .site-footer .inner { padding: 0 1rem; }
  .site-footer { padding: 1.5rem 0; margin-top: 2rem; }
}
.site-footer .brand { color: #fff; font-weight: 600; }
.site-footer .domain { font-size: 0.9rem; margin-top: 0.25rem; }
.site-footer a { color: #8ab4f8; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin: 0.5rem 0 0; font-size: 0.9rem; }

/* ----- Scroll reveal ----- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Keyframes ----- */
@keyframes heroGlow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(12deg); }
}
@keyframes heroDrift {
  0% { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(-40px,-20px,0) scale(1.02); }
}
@keyframes pinPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.8; }
}
