/* ==========================================================================
   MPI LTDA - Comercializadora Internacional Manufacturas y Procesos Industriales
   Estilos Principales - Versión Refactorizada (HTML5 / CSS3 Puro)
   ========================================================================== */

:root {
  --mpi-yellow: #ffd302;
  --mpi-yellow-dark: #e5bd00;
  --mpi-yellow-light: #ffea75;
  --mpi-dark: #343538;
  --mpi-darker: #1e1f21;
  --mpi-black: #121314;
  --mpi-gray-bg: #f8f9fa;
  --mpi-gray-light: #f2f2f2;
  --mpi-gray-border: #e2e8f0;
  --mpi-gray-text: #606266;
  --mpi-gray-muted: #8c9099;
  --mpi-white: #ffffff;
  
  --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--mpi-dark);
  background-color: var(--mpi-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

ul {
  list-style: none;
}

/* Contenedores y grillas */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.grid {
  display: grid;
  gap: 30px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

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

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  color: var(--mpi-darker);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p { margin-bottom: 1rem; color: var(--mpi-gray-text); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-white { color: var(--mpi-white) !important; }
.text-yellow { color: var(--mpi-yellow) !important; }
.text-dark { color: var(--mpi-dark) !important; }
.text-muted { color: var(--mpi-gray-muted) !important; }
.font-bold { font-weight: 700; }

/* Título de sección con línea amarilla característica de MPI */
.section-title-wrap {
  margin-bottom: 40px;
}

.section-title-wrap.text-center .separator-line {
  margin: 10px auto 0 auto;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mpi-dark);
}

.section-title.light {
  color: var(--mpi-white);
}

.separator-line {
  display: block;
  width: 70px;
  height: 6px;
  background-color: var(--mpi-yellow);
  margin-top: 8px;
  border-radius: 3px;
}

.separator-line.dark {
  background-color: var(--mpi-dark);
}

/* Barra superior de información */
.top-bar {
  background-color: var(--mpi-black);
  color: #c9ccd0;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid #2d3035;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-info a, .top-links a {
  color: #c9ccd0;
  margin-right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-info a:hover, .top-links a:hover {
  color: var(--mpi-yellow);
}

.top-links a.btn-sird-top {
  background: #343538;
  color: var(--mpi-yellow);
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 600;
}

.top-links a.btn-sird-top:hover {
  background: var(--mpi-yellow);
  color: var(--mpi-dark);
}

/* Header & Navegación Principal */
.header-main {
  background-color: var(--mpi-dark);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: var(--transition);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-brand img {
  height: 58px;
  width: auto;
}

.logo-brand .brand-name {
  color: var(--mpi-white);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.logo-brand .brand-name span {
  color: var(--mpi-yellow);
}

/* Menú de Navegación */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--mpi-white);
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--mpi-yellow);
  background-color: rgba(255,255,255,0.06);
}

/* Badge o etiqueta Sostenibilidad */
.nav-link .badge-sostenible {
  background-color: #28a745;
  color: white;
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 10px;
  margin-left: 3px;
  vertical-align: middle;
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background-color: var(--mpi-darker);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  border-radius: 4px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 1010;
  border-top: 3px solid var(--mpi-yellow);
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 10px 20px;
  color: #e0e2e5;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: #2b2c2f;
  color: var(--mpi-yellow);
  padding-left: 25px;
}

/* Botón Mobile */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--mpi-white);
  font-size: 1.7rem;
  cursor: pointer;
  padding: 8px;
}

@media (max-width: 992px) {
  .mobile-toggle { display: block; }
  
  .nav-menu {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: var(--mpi-darker);
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }
  
  .nav-menu.active {
    transform: translateX(0);
  }
  
  .nav-link {
    padding: 14px 15px;
    border-bottom: 1px solid #323438;
    justify-content: space-between;
  }
  
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-top: none;
    background-color: #252629;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .dropdown-menu.show {
    max-height: 300px;
  }
  
  .dropdown-item {
    padding: 12px 25px;
    border-bottom: 1px solid #333539;
  }
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.btn-yellow {
  background-color: var(--mpi-yellow);
  color: var(--mpi-dark);
  border-color: var(--mpi-yellow);
}

.btn-yellow:hover {
  background-color: #ffd81a;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255,211,2,0.4);
}

.btn-dark {
  background-color: var(--mpi-dark);
  color: var(--mpi-white);
}

.btn-dark:hover {
  background-color: var(--mpi-darker);
  color: var(--mpi-yellow);
}

.btn-outline-yellow {
  background: transparent;
  border-color: var(--mpi-yellow);
  color: var(--mpi-yellow);
}

.btn-outline-yellow:hover {
  background-color: var(--mpi-yellow);
  color: var(--mpi-dark);
}

.btn-outline-dark {
  background: transparent;
  border-color: var(--mpi-dark);
  color: var(--mpi-dark);
}

.btn-outline-dark:hover {
  background-color: var(--mpi-dark);
  color: var(--mpi-white);
}

/* Hero Section */
.hero-section {
  position: relative;
  background: linear-gradient(rgba(18, 19, 20, 0.75), rgba(18, 19, 20, 0.75)), url('../images/compania.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--mpi-white);
  padding: 140px 0 120px;
  min-height: 560px;
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 800px;
}

.hero-subtitle {
  color: var(--mpi-yellow);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-subtitle::before {
  content: '';
  display: inline-block;
  width: 35px;
  height: 4px;
  background: var(--mpi-yellow);
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--mpi-white);
  margin-bottom: 25px;
}

.hero-text {
  font-size: 1.2rem;
  color: #e4e7eb;
  margin-bottom: 35px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero-section { padding: 80px 0; }
  .hero-title { font-size: 2.2rem; }
  .hero-text { font-size: 1rem; }
}

/* Banner de Cabecera de Página Interna */
.page-banner {
  background: linear-gradient(rgba(52, 53, 56, 0.9), rgba(52, 53, 56, 0.9)), url('../images/carousel/Laboratorio.jpg');
  background-size: cover;
  background-position: center;
  color: var(--mpi-white);
  padding: 70px 0;
  border-bottom: 6px solid var(--mpi-yellow);
}

.page-banner h1 {
  color: var(--mpi-white);
  font-size: 2.6rem;
  font-weight: 800;
  text-transform: uppercase;
}

.page-banner p {
  color: #cbd0d6;
  font-size: 1.1rem;
  margin: 10px 0 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #a0a5ad;
  margin-top: 15px;
}

.breadcrumb a { color: var(--mpi-yellow); }
.breadcrumb a:hover { text-decoration: underline; }

/* Secciones Generales */
.section {
  padding: 80px 0;
}

.section-sm {
  padding: 50px 0;
}

.section-dark {
  background-color: var(--mpi-dark);
  color: var(--mpi-white);
}

.section-dark p {
  color: #cbd0d6;
}

.section-gray {
  background-color: var(--mpi-gray-bg);
}

.section-yellow-bar {
  background-color: var(--mpi-yellow);
  color: var(--mpi-dark);
  padding: 30px 0;
  font-weight: 800;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Tarjetas de Servicios y Productos */
.card-service {
  background: var(--mpi-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--mpi-gray-border);
  display: flex;
  flex-direction: column;
}

.card-service:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--mpi-yellow);
}

.card-service-img {
  position: relative;
  height: 220px;
  overflow: hidden;
}

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

.card-service:hover .card-service-img img {
  transform: scale(1.08);
}

.card-service-body {
  padding: 30px 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-service-title {
  font-size: 1.35rem;
  margin-bottom: 12px;
  color: var(--mpi-dark);
}

.card-service-text {
  color: var(--mpi-gray-text);
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-service-footer {
  margin-top: auto;
}

/* Tarjetas Dark en Inicio */
.card-service-dark {
  background: #2b2c2f;
  color: var(--mpi-white);
  border: 1px solid #3d3e42;
}

.card-service-dark .card-service-title {
  color: var(--mpi-white);
}

.card-service-dark .card-service-text {
  color: #b5b9bf;
}

.card-service-dark:hover {
  border-color: var(--mpi-yellow);
}

/* Sección de Características / Beneficios */
.feature-box {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.feature-icon {
  width: 55px;
  height: 55px;
  background-color: var(--mpi-yellow);
  color: var(--mpi-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.feature-info h4 {
  margin-bottom: 6px;
  font-size: 1.15rem;
}

/* Aliados Carousel / Grid */
.allies-grid {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 30px;
  padding: 30px 0;
}

.ally-logo {
  filter: grayscale(100%);
  opacity: 0.7;
  transition: var(--transition);
  max-height: 65px;
  width: auto;
}

.ally-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.06);
}

/* Ficha de Proyecto */
.project-card {
  background: var(--mpi-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--mpi-gray-border);
  transition: var(--transition);
}

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

.project-img-wrapper {
  height: 240px;
  overflow: hidden;
}

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

.project-card:hover .project-img-wrapper img {
  transform: scale(1.06);
}

.project-body {
  padding: 25px;
}

.project-tag {
  display: inline-block;
  background: rgba(255, 211, 2, 0.2);
  color: #997800;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Formulario PQRS & Contacto */
.form-box {
  background: var(--mpi-white);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--mpi-gray-border);
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 8px;
  color: var(--mpi-darker);
}

.form-label .required {
  color: #dc3545;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background-color: #fff;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--mpi-yellow);
  box-shadow: 0 0 0 3px rgba(255, 211, 2, 0.3);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 25px;
  font-size: 0.88rem;
  color: var(--mpi-gray-text);
}

.form-check input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--mpi-yellow);
  width: 18px;
  height: 18px;
}

/* Alertas de Mensaje */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.95rem;
  display: none;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Banner CTA Footer */
.cta-banner {
  background-color: var(--mpi-dark);
  color: var(--mpi-white);
  padding: 60px 0;
  border-top: 4px solid var(--mpi-yellow);
}

/* Pie de Página (Footer) */
.footer-main {
  background-color: var(--mpi-black);
  color: #a4a8b0;
  padding: 80px 0 25px;
  font-size: 0.92rem;
  border-top: 1px solid #282a2e;
}

.footer-col h4 {
  color: var(--mpi-white);
  font-size: 1.15rem;
  margin-bottom: 22px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--mpi-yellow);
}

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

.footer-links a {
  color: #a4a8b0;
  display: inline-block;
  transition: var(--transition);
}

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

.footer-contact li {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-contact i {
  color: var(--mpi-yellow);
  margin-top: 4px;
}

.footer-bottom {
  margin-top: 60px;
  padding-top: 25px;
  border-top: 1px solid #232529;
  text-align: center;
  font-size: 0.85rem;
}

.footer-bottom a {
  color: var(--mpi-yellow);
}

/* Redes Sociales */
.social-icons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.social-icon {
  width: 40px;
  height: 40px;
  background-color: #2b2d32;
  color: var(--mpi-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.social-icon:hover {
  background-color: var(--mpi-yellow);
  color: var(--mpi-dark);
  transform: translateY(-3px);
}

/* Botón flotante PQRS / Pagos */
.floating-actions {
  position: fixed;
  bottom: 30px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
}

.floating-btn {
  background-color: var(--mpi-yellow);
  color: var(--mpi-dark);
  padding: 12px 18px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.floating-btn:hover {
  background-color: #ffe033;
  transform: scale(1.05);
}

.floating-btn.btn-ethics {
  background-color: var(--mpi-dark);
  color: var(--mpi-white);
  border: 1px solid var(--mpi-yellow);
}

.floating-btn.btn-ethics:hover {
  background-color: var(--mpi-yellow);
  color: var(--mpi-dark);
}

/* Accordion para Ensayos y FAQs */
.accordion-item {
  border: 1px solid var(--mpi-gray-border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--mpi-white);
}

.accordion-header {
  padding: 16px 20px;
  background: #fdfdfd;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: var(--transition);
}

.accordion-header:hover {
  background: var(--mpi-gray-bg);
  color: #000;
}

.accordion-content {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.35s ease;
}

.accordion-item.active .accordion-content {
  padding: 18px 20px;
  max-height: 800px;
  border-top: 1px solid var(--mpi-gray-border);
}

.accordion-item.active .accordion-header {
  background: rgba(255, 211, 2, 0.15);
  color: var(--mpi-darker);
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .top-bar { display: none; }
  .floating-actions { bottom: 15px; right: 15px; }
  .floating-btn span { display: none; }
  .floating-btn { width: 48px; height: 48px; padding: 0; justify-content: center; border-radius: 50%; font-size: 1.2rem; }
  .section { padding: 50px 0; }
  .form-box { padding: 25px 18px; }
}
