/* ===================================
   UNITS (UNIDADES DE NEGOCIO) — ARRMARE GROUP
   =================================== */
.units {
  padding: var(--section-pad-v) var(--section-pad-h);
  background: var(--color-white);
  color: var(--color-dark);
}

.units-header {
  max-width: var(--max-width);
  margin: 0 auto 64px;
}

.units-header h2 {
  color: var(--color-dark);
}

/* Grid */
.units-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background-color: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.unit-card {
  position: relative;
  padding: 48px 44px;
  background: var(--color-white);
  display: flex;
  gap: 24px;
  align-items: flex-start;
  cursor: default;
  transition: background 0.4s var(--ease-out);
  overflow: hidden;
}

.unit-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.5s var(--ease-out);
}

.unit-card:hover {
  background: var(--color-off-white);
}

.unit-card:hover::before {
  width: 100%;
}

/* Card destacada — mantiene acento dorado */
.unit-card--highlight {
  background: var(--color-dark);
}

.unit-card--highlight:hover {
  background: var(--color-mid);
}

.unit-card--highlight::before {
  display: none;
}

/* Número decorativo */
.unit-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.08);
  line-height: 1;
  flex-shrink: 0;
  min-width: 60px;
  transition: color 0.4s;
}

.unit-card:hover .unit-number {
  color: rgba(0, 0, 0, 0.14);
}

.unit-card--highlight .unit-number {
  color: rgba(255, 255, 255, 0.12);
  font-size: 4rem;
}

.unit-card--highlight:hover .unit-number {
  color: rgba(255, 255, 255, 0.2);
}

/* Contenido */
.unit-content {
  flex: 1;
}

.unit-content h3 {
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--color-dark);
  margin-bottom: 12px;
}

.unit-content p {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--color-gray-dark);
}

.unit-card--highlight .unit-content h3 {
  color: var(--color-white);
}

.unit-card--highlight .unit-content p {
  color: rgba(255, 255, 255, 0.65);
}

/* Flecha */
.unit-arrow {
  font-size: 1.2rem;
  color: rgba(0, 0, 0, 0.15);
  align-self: flex-end;
  transition: color 0.3s, transform 0.3s;
  flex-shrink: 0;
}

.unit-card:hover .unit-arrow {
  color: var(--color-accent);
  transform: translateX(4px);
}

.unit-card--highlight .unit-arrow {
  color: rgba(255, 255, 255, 0.3);
}

.unit-card--highlight:hover .unit-arrow {
  color: var(--color-accent-lt);
  transform: translateX(4px);
}

/* ===================================
   VISTA DE DETALLE: SECTOR Y EMPRESAS
   =================================== */
.unit-detail-view {
  padding-top: 20px;
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--color-text, #111);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 60px;
  transition: opacity 0.3s;
}

.btn-back:hover {
  opacity: 0.6;
}

.detail-header {
  max-width: 900px;
  margin: 0 auto 60px auto;
  text-align: center;
}

.detail-header h2 {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: 3rem;
  margin-bottom: 25px;
  font-weight: 400;
}

.detail-header p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
}

/* --- Cuadrícula de Empresas (Dark Theme) --- */
.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  text-align: left;
}

.company-card {
  background: #0a0a0a; /* Fondo oscuro */
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.company-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.company-logo {
  height: 220px;
  background: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 40px;
}

.company-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* Esta línea vuelve el logo completamente blanco */
  filter: brightness(0) invert(1); 
  transition: filter 0.3s ease, opacity 0.3s ease;
}

/* Hace que el logo brille un poquito al pasar el mouse por la tarjeta */
.company-card:hover .company-logo img {
  opacity: 0.6; /* Lo bajé a 0.6 para que se note más el efecto al pasar el mouse */
}
.company-info {
  padding: 30px;
}

.company-tag {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent, #cda434);
  margin-bottom: 15px;
}

.company-info h3 {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: 2rem;
  font-weight: 400;
  color: #ffffff;
  margin-bottom: 15px;
}

.company-info p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Ocultar tarjetas dinámicamente */
.company-card.hide {
  display: none !important;
}

#unidades {
  height: auto !important;
  min-height: 100vh;
  overflow: visible !important;
}

.unit-detail-view {
  padding-bottom: 100px; /* Le da aire al final para que no choque con el footer */
}

/* --- Efecto para resaltar la imagen de ARRMARE GROUP --- */
.about-img-wrapper img {
  /* 1. Le da una sombra muy suave y difusa, separándola del fondo */
  filter: drop-shadow(0px 15px 25px rgba(0, 0, 0, 0.08));
  transition: transform 0.4s ease, filter 0.4s ease;
}

.about-img-wrapper img:hover {
  /* 2. Al pasar el mouse, la imagen "sube" un poquito y la sombra se amplía */
  transform: translateY(-5px) scale(1.02);
  filter: drop-shadow(0px 20px 30px rgba(0, 0, 0, 0.12));
}

/* ===================================
   VISTA DE PERFIL DE EMPRESA (TIPO ROMERO)
   =================================== */
.company-profile-view {
  animation: fadeIn 0.5s ease forwards;
  padding-top: 20px;
}

.profile-layout {
  display: flex;
  background: #0a0a0a; /* Fondo oscuro elegante */
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 500px;
  overflow: hidden;
}

/* Columna de la Imagen */
.profile-image-col {
  flex: 1;
  position: relative;
  min-height: 300px; /* Para móviles */
}

/* El bloque de color de acento (como el naranja de Romero, pero dorado) */
.profile-image-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 30%;
  height: 100%;
  background-color: var(--color-accent, #cda434);
  opacity: 0.8;
  z-index: 1;
}

.profile-image-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

/* Columna de Contenido */
.profile-content-col {
  flex: 1;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-logo-wrapper {
  height: 80px; /* Tamaño del logo */
  margin-bottom: 30px;
}

.profile-logo-wrapper img {
  max-height: 100%;
  max-width: 250px;
  object-fit: contain;
  /* Lo volvemos blanco si es oscuro */
  filter: brightness(0) invert(1); 
}

.profile-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
}

.profile-actions {
  margin-top: auto; /* Empuja el botón al fondo si hay espacio */
}

/* Responsivo para móviles */
@media (max-width: 900px) {
  .profile-layout {
    flex-direction: column;
  }
  .profile-image-accent {
    width: 100%;
    height: 30%;
  }
}

/* ===================================
   EFECTO "VER EMPRESA" (TIPO ROMERO)
   =================================== */

.company-card.hover-reveal {
  position: relative;
  overflow: hidden; /* Asegura que el overlay no se salga de los bordes */
}

/* La capa oscura que cubre la tarjeta */
.company-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.9); /* Fondo muy oscuro, casi negro */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(4px); /* Opcional: difumina ligeramente el logo de fondo */
}

/* El botón dentro del overlay */
.btn-ver-empresa {
  color: var(--color-white, #fff);
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-accent, #cda434);
  padding-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(20px); /* Inicia un poco más abajo */
  transition: transform 0.4s ease, color 0.3s ease;
}

.btn-ver-empresa:hover {
  color: var(--color-accent, #cda434);
}

.arrow-icon {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.btn-ver-empresa:hover .arrow-icon {
  transform: translate(3px, -3px); /* Flecha se mueve diagonalmente */
}

/* Mostrar el overlay al hacer hover sobre la tarjeta completa */
.company-card.hover-reveal:hover .company-hover-overlay {
  opacity: 1;
  visibility: visible;
}

.company-card.hover-reveal:hover .btn-ver-empresa {
  transform: translateY(0); /* El botón sube a su posición final */
}