/* ========================================
   DROPDOWN NAVIGATION COMPONENT
   Universal dropdown for Micro Center Store
   ======================================== */

/* Dropdown Styles */
.dropdown {
  position: relative;
  display: inline-block;
  z-index: 9998;
}

.dropdown-toggle {
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: white;
  padding: 15px 30px;
  border-radius: 4px;
  display: inline-block;
}

.dropdown-toggle:hover {
  background-color: rgb(0, 140, 190);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dropdown-toggle::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: white;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.dropdown:hover .dropdown-toggle::after {
  width: 80%;
}

.dropdown-toggle::before {
  content: "▼";
  font-size: 10px;
  margin-left: 8px;
  transition: transform 0.3s ease;
  display: inline-block;
  position: relative;
  z-index: 1;
}

.dropdown:hover .dropdown-toggle::before {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 15px 0;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9999;
  pointer-events: auto;
}

.dropdown:hover .dropdown-menu,
.dropdown.hover-active .dropdown-menu,
.dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  border: 2px solid rgb(0, 140, 190);
}

.dropdown-menu a {
  display: block !important;
  padding: 10px 20px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 10001 !important;
  background: transparent;
  opacity: 1;
  transform: translateX(0);
}

.dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: rgb(0, 140, 190);
  padding-left: 25px;
  cursor: pointer;
}

.dropdown-menu a:active {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: scale(0.98);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 10px 15px;
}

.dropdown-menu .view-all {
  font-weight: bold;
  color: rgb(0, 140, 190);
  text-align: center;
  border: 1px solid rgb(0, 140, 190);
  margin: 10px 15px 5px 15px;
  border-radius: 20px;
  padding: 8px 15px;
}

.dropdown-menu .view-all:hover {
  background: rgb(0, 140, 190);
  color: white;
  padding-left: 15px;
  border-left: 1px solid rgb(0, 140, 190);
}

/* FORCE CLICKABILITY - EMERGENCY FIX */
.dropdown-menu * {
  pointer-events: auto !important;
}

.dropdown-menu a[href] {
  pointer-events: auto !important;
  cursor: pointer !important;
  user-select: none;
  outline: none !important;
  text-decoration: none !important;
}

.dropdown-menu a[href]:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}

/* Override any conflicting styles */
.dropdown:hover .dropdown-menu a[href],
.dropdown.hover-active .dropdown-menu a[href] {
  pointer-events: auto !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Mobile dropdown styles */
@media screen and (max-width: 768px) {
  .dropdown-menu {
    position: static;
    transform: none;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    margin-top: 10px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
  }

  .dropdown:hover .dropdown-menu,
  .dropdown.active .dropdown-menu {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
  }

  .dropdown-toggle::before {
    content: "+";
    font-size: 16px;
    margin-left: 8px;
  }

  .dropdown:hover .dropdown-toggle::before,
  .dropdown.active .dropdown-toggle::before {
    content: "−";
    transform: none;
  }

  .nav-links .dropdown-toggle::after {
    display: none;
  }
}
