/* ========== APPLE DOCK BOTTOM NAVIGATION (OVAL MINIMALIST + ANIMATED) ========== */
.apple-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) scale(1); /* Base scale 1 */
  display: flex;
  align-items: center;
  gap: 8px; /* Reduced gap for compact look */
  padding: 8px 12px; /* Reduced padding */
  border-radius: 999px; /* Completely oval */
  background: rgba(18, 18, 18, 0.15); /* Maximum transparency */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0,0,0,0.3);
  z-index: 9999;
  /* Smooth transition for scroll scaling */
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
  opacity: 1;
}

/* Scroll-reactive state */
.apple-dock.dock-scrolled {
  transform: translateX(-50%) scale(0.85);
  opacity: 0.8;
}

/* Sliding Pill Indicator */
.dock-indicator {
  position: absolute;
  top: 8px; /* Matches padding top */
  left: 0; /* Updated via JS */
  width: 48px; /* Matches <a> width */
  height: 48px; /* Matches <a> height */
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  z-index: 1;
  pointer-events: none; /* So it doesn't block clicks */
  opacity: 0; /* Default hidden until active link is found */
}

.apple-dock a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5); /* Whitish/grayish unselected */
  text-decoration: none;
  width: 48px; /* Fixed width/height for circular touch target */
  height: 48px;
  border-radius: 50%; /* Circle for hover/active state */
  background: transparent;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  z-index: 2; /* Keep above indicator */
}

.apple-dock a svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  transition: stroke 0.3s ease, transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Hover for non-selected items */
.apple-dock a:not(.active):hover {
  color: rgba(255, 255, 255, 0.9);
}

.apple-dock a:not(.active):hover svg {
  transform: translateY(-2px); /* Hover lift only when not active */
}

/* Active State (Instagram/WhatsApp style) */
.apple-dock a.active {
  color: #000000; /* Black stroke on white background */
}

.apple-dock a.active svg {
  stroke-width: 2; /* Slightly thicker for legibility */
  transform: none; /* Reset any transform */
}

/* Base Body Padding (keeps content above dock) */
body {
  padding-bottom: 90px !important;
}

/* Responsive adjust for mobile */
@media (max-width: 768px) {
  .apple-dock {
    width: calc(100% - 32px); /* Ocupa casi todo el ancho inferior, dejando 16px de margen */
    justify-content: space-between; /* Distribuye uniformemente el espacio */
    gap: 0;
    padding: 8px 12px;
    bottom: 20px;
  }
  .dock-indicator {
    top: 8px;
    width: 52px; /* Área de toque más amplia y cómoda */
    height: 52px;
  }
  .apple-dock a {
    width: 52px; /* Área de toque más amplia y cómoda */
    height: 52px;
  }
  .apple-dock a svg {
    width: 24px;
    height: 24px;
  }
}
