/* ============================================
   STICKY HEADER - RESPONSIVE DESIGN
   Banner que sigue al usuario en todas las páginas
   ============================================ */

/* Desktop: Banner completo con todos los menús */
@media (min-width: 768px) {
  .sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid hsl(var(--border) / 0.2);
    background-color: hsl(var(--background) / 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  .sticky-header-container {
    display: flex;
    height: 4rem; /* h-16 */
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    gap: 2rem;
  }

  .sticky-header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .sticky-header-logo img {
    height: auto;
    width: auto;
    max-width: 140px;
  }

  .sticky-header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    justify-content: center;
  }

  .sticky-header-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
  }

  .sticky-header-nav a:hover {
    color: hsl(var(--foreground) / 0.8);
  }

  .sticky-header-nav a.active {
    color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.1);
  }

  .sticky-header-nav a.active:dark {
    background-color: hsl(var(--primary) / 0.2);
  }

  /* Dropdown Styles */
  .dropdown {
    position: relative;
    display: inline-block;
  }

  .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
  }

  .dropdown-toggle svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s;
  }

  .dropdown.open .dropdown-toggle svg {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0;
    margin-top: 0.25rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-out;
    z-index: 100;
  }

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

  .dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 0;
  }

  .dropdown-menu a:hover {
    background-color: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
  }

  .sticky-header-login {
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid hsl(var(--primary) / 0.5);
    color: hsl(var(--primary));
    cursor: pointer;
    white-space: nowrap;
  }

  .sticky-header-login:hover {
    background-color: hsl(var(--primary) / 0.1);
  }

  .sticky-header-theme {
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sticky-header-theme:hover {
    background-color: hsl(var(--primary) / 0.1);
  }

  .sticky-header-theme svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .sticky-header-controls {
    display: none;
  }

  /* Agregar padding al body para que no se superponga con el header fixed */
  body {
    padding-top: 4rem;
  }
}

/* Mobile: Menú hamburguesa colapsado */
@media (max-width: 767px) {
  .sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid hsl(var(--border) / 0.2);
    background-color: hsl(var(--background) / 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  .sticky-header-container {
    display: flex;
    height: 3.5rem; /* h-14 */
    max-width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
  }

  .sticky-header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .sticky-header-logo img {
    height: auto;
    width: auto;
    max-width: 100px;
  }

  .sticky-header-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 3.5rem;
    left: 0;
    right: 0;
    background-color: hsl(var(--background));
    border-bottom: 1px solid hsl(var(--border) / 0.2);
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 1rem;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  }

  .sticky-header-nav.mobile-open {
    max-height: 600px;
    opacity: 1;
    padding: 1rem;
  }

  .sticky-header-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.75rem;
    border-radius: 0.375rem;
    color: hsl(var(--muted-foreground));
    display: block;
  }

  .sticky-header-nav a:hover {
    color: hsl(var(--foreground));
    background-color: hsl(var(--primary) / 0.1);
  }

  .sticky-header-nav a.active {
    color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.1);
  }

  /* Mobile Dropdown Styles */
  .dropdown {
    width: 100%;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background-color: transparent;
    padding: 0;
    margin: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .dropdown.open .dropdown-menu {
    max-height: 300px;
  }

  .dropdown-menu a {
    padding: 0.5rem 1.5rem;
    margin-left: 1rem;
    border-left: 2px solid hsl(var(--primary) / 0.3);
    display: block;
  }

  .sticky-header-login {
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid hsl(var(--primary) / 0.5);
    color: hsl(var(--primary));
    cursor: pointer;
    display: block;
    text-align: center;
  }

  .sticky-header-login:hover {
    background-color: hsl(var(--primary) / 0.1);
  }

  .sticky-header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .sticky-header-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    height: 2.25rem;
    width: 2.25rem;
    cursor: pointer;
    background-color: transparent;
    border: none;
    color: hsl(var(--foreground));
  }

  .sticky-header-menu-btn:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
  }

  .sticky-header-menu-btn svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .sticky-header-theme {
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    width: 2.25rem;
  }

  .sticky-header-theme:hover {
    background-color: hsl(var(--primary) / 0.1);
  }

  .sticky-header-theme svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  /* Agregar padding al body para que no se superponga con el header fixed */
  body {
    padding-top: 3.5rem;
  }
}

/* Animación suave para el menú móvil */
@media (max-width: 767px) {
  .sticky-header-nav {
    animation: slideDown 0.3s ease-out;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
