:root {
  --iot-orange: #FF6B2C;
  --iot-orange-soft: #ff8f5c;
  --iot-dark: #344767;
  --iot-gray: #67748E;
  --iot-light: #E9ECEF;
  --iot-white: #ffffff;
  --iot-shadow: 0 .25rem 1.125rem rgba(52, 71, 103, .12);
  --iot-shadow-lg: 0 1.25rem 3.125rem rgba(52, 71, 103, .22);
  --iot-radius: .75rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', 'Inter', system-ui, sans-serif;
  color: var(--iot-dark);
  background: var(--iot-light);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Justificacion de bloques de texto */
.iot-hero .lead,
.iot-section p,
.iot-section-subtitle,
.iot-card p,
.iot-footer p {
  text-align: justify;
  hyphens: auto;
}

h1, h2, h3, h4, h5, h6, .display, .navbar-brand {
  font-family: 'Inter', 'Open Sans', system-ui, sans-serif;
  font-weight: 700;
  color: var(--iot-dark);
}

/* Header / Navbar */
.iot-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: background .25s ease, box-shadow .25s ease, padding .25s ease;
  padding: 1rem 0;
  background: transparent;
}

.iot-header.scrolled {
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--iot-shadow);
  padding: .5rem 0;
}

.iot-header .navbar-brand {
  color: var(--iot-white);
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: color .25s ease;
}

.iot-header.scrolled .navbar-brand,
.iot-header.scrolled .nav-link,
.iot-header.scrolled .dropdown-toggle {
  color: var(--iot-dark);
}

.iot-header .nav-link,
.iot-header .dropdown-toggle {
  color: rgba(255, 255, 255, .9);
  font-weight: 600;
  font-size: .9rem;
}

.iot-header .nav-link:hover,
.iot-header .dropdown-toggle:hover {
  color: var(--iot-orange);
}

.iot-header .dropdown-menu {
  border: none;
  border-radius: var(--iot-radius);
  box-shadow: var(--iot-shadow-lg);
  padding: .5rem 0;
}

.iot-header .dropdown-item {
  font-weight: 600;
  font-size: .9rem;
  color: var(--iot-dark);
}

.iot-header .dropdown-item:hover {
  color: var(--iot-orange);
  background: rgba(255, 107, 44, .06);
}

.btn-cta {
  background: linear-gradient(135deg, var(--iot-orange) 0%, var(--iot-orange-soft) 100%);
  color: #fff !important;
  border: none;
  border-radius: 50rem;
  padding: .55rem 1.35rem;
  font-weight: 700;
  box-shadow: var(--iot-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--iot-shadow-lg);
  color: #fff;
}

/* Hero */
.iot-hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 8rem 0 5rem;
  background: linear-gradient(135deg, #1a2435 0%, var(--iot-dark) 60%, #25304a 100%);
  color: var(--iot-white);
  overflow: hidden;
}

.iot-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: .45;
}

.iot-hero .container { position: relative; z-index: 2; }

.iot-hero h1 {
  color: var(--iot-white);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.iot-hero .lead {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, .85);
  max-width: 600px;
}

.iot-hero .badge-tech {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem;
  border-radius: 50rem;
  background: rgba(255, 107, 44, .15);
  border: 1px solid rgba(255, 107, 44, .35);
  color: var(--iot-orange-soft);
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.iot-hero .btn-outline-light {
  border-radius: 50rem;
  padding: .55rem 1.35rem;
  font-weight: 600;
}

.hero-visual {
  position: relative;
  border-radius: var(--iot-radius);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 1.5rem;
  box-shadow: var(--iot-shadow-lg);
  backdrop-filter: blur(4px);
  width: 106%;
  margin-left: -3%;
  max-width: none;
}

.hero-visual img,
.hero-visual .iot-placeholder {
  width: 100%;
  border-radius: var(--iot-radius);
}

.hero-visual.carousel {
  overflow: hidden;
}

.hero-visual .carousel-inner {
  border-radius: var(--iot-radius);
}

.hero-visual .carousel-control-prev,
.hero-visual .carousel-control-next {
  width: 10%;
  opacity: 0.8;
}

.hero-visual .carousel-control-prev-icon,
.hero-visual .carousel-control-next-icon {
  filter: invert(1);
}

/* Placeholders for real images */
.iot-placeholder {
  background: linear-gradient(135deg, #4a5d82 0%, var(--iot-dark) 100%);
  color: rgba(255, 255, 255, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  text-align: center;
  border: 2px dashed rgba(255, 255, 255, .2);
  border-radius: var(--iot-radius);
  font-size: .9rem;
  padding: 1rem;
}

.iot-placeholder.light {
  background: var(--iot-white);
  color: var(--iot-gray);
  border: 2px dashed var(--iot-light);
}

/* Section globals */
section.iot-section {
  padding: 5rem 0;
}

.iot-section-title {
  font-size: 2rem;
  margin-bottom: .5rem;
}

.iot-section-subtitle {
  color: var(--iot-gray);
  max-width: 700px;
  margin-bottom: 3rem;
}

/* Cards */
.iot-card {
  background: var(--iot-white);
  border: none;
  border-radius: var(--iot-radius);
  box-shadow: var(--iot-shadow);
  padding: 1.75rem;
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease;
}

.iot-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--iot-shadow-lg);
}

.iot-card .icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: .65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 107, 44, .12);
  color: var(--iot-orange);
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
}

.iot-card h3 {
  font-size: 1.25rem;
  margin-bottom: .5rem;
}

.iot-card p {
  color: var(--iot-gray);
  font-size: .95rem;
  margin-bottom: 0;
}

/* Software preview (dashboard mockup) */
.iot-dashboard {
  border-radius: var(--iot-radius);
  box-shadow: var(--iot-shadow-lg);
  border: 1px solid var(--iot-light);
  overflow: hidden;
  background: var(--iot-white);
}

.iot-dashboard .db-header {
  background: var(--iot-dark);
  color: var(--iot-white);
  padding: .75rem 1.25rem;
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.iot-dashboard .db-body {
  padding: 1.5rem;
}

.iot-metric {
  background: var(--iot-white);
  border: 1px solid var(--iot-light);
  border-radius: var(--iot-radius);
  padding: 1rem;
  text-align: center;
}

.iot-metric h4 {
  font-size: 1.5rem;
  margin-bottom: 0;
  color: var(--iot-orange);
}

.iot-metric span {
  font-size: .8rem;
  color: var(--iot-gray);
}

/* Lead form */
.iot-form-card {
  background: var(--iot-white);
  border-radius: var(--iot-radius);
  box-shadow: var(--iot-shadow-lg);
  padding: 2.25rem;
}

.form-label {
  font-weight: 600;
  font-size: .9rem;
  color: var(--iot-dark);
}

.form-control, .form-select {
  border-radius: .5rem;
  border: 1px solid #d2d6da;
  padding: .65rem .85rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--iot-orange);
  box-shadow: 0 0 0 .2rem rgba(255, 107, 44, .15);
}

/* Footer */
.iot-footer {
  background: var(--iot-dark);
  color: rgba(255, 255, 255, .75);
  padding: 3rem 0 1.5rem;
  font-size: .9rem;
}

.iot-footer a {
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
}

.iot-footer a:hover {
  color: var(--iot-orange);
}

.iot-footer h5 {
  color: var(--iot-white);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.iot-footer .bottom-bar {
  border-top: 1px solid rgba(255, 255, 255, .1);
  margin-top: 2rem;
  padding-top: 1.25rem;
}

/* Utilities */
.text-orange { color: var(--iot-orange) !important; }

.bg-iot-light { background: var(--iot-light) !important; }

/* Responsive */
@media (max-width: 991.98px) {
  .iot-hero { padding: 6rem 0 3rem; }
  .navbar-collapse {
    background: rgba(255, 255, 255, .98);
    border-radius: var(--iot-radius);
    padding: 1rem;
    margin-top: .75rem;
    box-shadow: var(--iot-shadow-lg);
  }
  .navbar-collapse .nav-link,
  .navbar-collapse .dropdown-toggle {
    color: var(--iot-dark) !important;
  }
  .btn-cta { margin-top: .5rem; }
}

#mapa .iot-section-title,
#mapa .iot-section-subtitle {
  text-align: center !important;
}

/* Mapa de proyectos */
.iot-map {
  width: 100%;
  height: 420px;
  border-radius: .75rem;
  overflow: hidden;
  background: var(--iot-light);
}

.iot-map .leaflet-tile-pane,
.iot-map .leaflet-overlay-pane {
  filter: grayscale(100%) contrast(95%);
}

.iot-marker {
  background: transparent !important;
  border: 0 !important;
}

.iot-marker span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  border: 2px solid #fff;
  box-shadow: 0 .25rem .75rem rgba(52, 71, 103, .3);
}

.iot-popup h6 {
  color: #344767;
  margin: 0 0 .5rem;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.3;
}

.iot-popup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: .35rem;
  font-size: .85rem;
  color: #67748E;
}

.iot-popup-row strong {
  color: #344767;
  font-weight: 600;
}

.leaflet-popup-content-wrapper {
  border-radius: .75rem;
  box-shadow: 0 .25rem 1rem rgba(52, 71, 103, .15);
}

.leaflet-popup-content {
  margin: .75rem 1rem;
  min-width: 220px;
}
