/* ================================================
   ALPINO SIDEBAR OVERRIDE - MOBILE RESPONSIVE
   ================================================ */

.sidebar-toggle,
.sidebar-close {
  display: none;
}
div#leftsidebar.sidebar.notion-left-sidebar {
  /* Override de algunas propiedades de la sidebar */
  left: 0px !important;
  margin: 0px !important;
  width: 100% !important;
}
/* ================================================
   LAYOUT PRINCIPAL CON FLEXBOX
   ================================================ */
.main-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.main-container aside {
  flex-shrink: 0;
  width: 260px;
  position: relative;
  z-index: 1000;
}
.main-container section.content {
  flex: 1;
  min-width: 0;
  background-color: #f5f5f5;
}

.main-container section.content {
  padding: 0;
}

/* ================================================
   BOTONES DE CONTROL MOBILE
   ================================================ */
.mobile-toggle-btn,
.mobile-close-btn {
  display: none;
  position: fixed;
  z-index: 2000;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

/* Botón hamburguesa (mostrar sidebar)*/
.mobile-toggle-btn {
  top: 15px;
  right: 5px;
  width: 50px;
  height: 50px;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 6px;
  background: #fafafa;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 2px solid #efefef;
}

.mobile-toggle-btn span {
  width: 30px;
  height: 2px;
  background: #000;
  border-radius: 1px;
  transition: all 0.3s ease;
}

/* Botón X (cerrar sidebar)*/
.mobile-close-btn {
  top: 15px;
  right: 5px;
  width: 50px;
  height: 50px;
  font-size: 40px;
  padding-bottom: 6px;
  color: white;
  background: rgba(244, 67, 54, 0.8);
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ================================================
   MOBILE RESPONSIVE (700px y menos)
   ================================================ */

@media (max-width: 700px) {
  .mobile-toggle-btn {
    display: flex;
  }

  .mobile-close-btn {
    display: none;
  }

  .main-container {
    position: relative;
    overflow: hidden;
  }

  .main-container aside {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 260px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1500;
  }
  div#leftsidebar.sidebar.notion-left-sidebar {
    height: 100vh;
    width: 100%;
    position: relative;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .main-container section.content {
    width: 100%;
    margin-left: 0;
  }

  /* ================================================
       ESTADOS DE LA SIDEBAR (RADIO BUTTON CONTROL)
       ================================================ */
  .sidebar-toggle:checked ~ .main-container aside {
    transform: translateX(0);
  }

  .sidebar-toggle:checked ~ .mobile-close-btn {
    display: flex;
  }

  .sidebar-toggle:checked ~ .mobile-toggle-btn {
    display: none;
  }

  .sidebar-toggle:checked ~ .main-container::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1400;
    pointer-events: auto;
  }

  /* ================================================
       ANIMACIONES Y EFECTOS
       ================================================ */

  .mobile-toggle-btn:hover span {
    background: #000;
  }

  .mobile-toggle-btn:hover {
    background: #fafafa;
    color: #000;
    transform: scale(1.05);
  }

  .mobile-close-btn:hover {
    background: rgba(244, 67, 54, 1);
    transform: scale(1.1);
  }
}

/* ================================================
   DESKTOP (701px y más)
   ================================================ */

@media (min-width: 700px) {
  .main-container aside {
    position: relative;
    transform: none;
    margin-left:30px;
  }

  div#leftsidebar.sidebar.notion-left-sidebar {
    position: relative;
    height: auto;
    /*box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);*/
  }

  .mobile-toggle-btn,
  .mobile-close-btn {
    display: none !important;
  }
}

.main-container section.content {
  scroll-behavior: smooth;
}

@media (max-width: 700px) {
  .mobile-toggle-btn,
  .mobile-close-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .main-container section.content {
    position: relative;
    z-index: 100;
  }

  body {
    overflow-x: hidden;
  }
}
.mobile-toggle-btn:focus-visible,
.mobile-close-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .main-container aside,
  div#leftsidebar.sidebar.notion-left-sidebar,
  .mobile-toggle-btn,
  .mobile-close-btn,
  .mobile-toggle-btn span {
    transition: none;
  }
}
