/* =====================================================
   Products Mega Dropdown (Notion-style)
   ===================================================== */

/* Dropdown Trigger */
.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  border-radius: var(--radius);
}

.nav-dropdown-trigger:hover {
  color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.08);
}

.header.on-light .nav-dropdown-trigger {
  color: var(--graphite-grey);
}

.header.on-light .nav-dropdown-trigger:hover {
  color: var(--pure-black);
  background: rgba(0, 0, 0, 0.05);
}

.dropdown-arrow {
  transition: transform 0.2s var(--ease);
}

.nav-dropdown-trigger[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Container */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s cubic-bezier(0.2, 0, 0, 1),
              transform 0.15s cubic-bezier(0.2, 0, 0, 1),
              visibility 0.15s;
  z-index: 100;
}

.nav-dropdown-trigger[aria-expanded="true"] + .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Dropdown Content Card */
.nav-dropdown-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 12px 40px rgba(0, 0, 0, 0.15),
    0 24px 60px rgba(0, 0, 0, 0.1);
  padding: var(--space-lg);
  min-width: 520px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

:root[data-theme="dark"] .nav-dropdown-content {
  background: rgba(20, 20, 20, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 24px 60px rgba(0, 0, 0, 0.3);
}

/* Product Cards Grid */
.products-dropdown-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

/* Product Card */
.product-dropdown-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.product-dropdown-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(230, 99, 0, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.product-dropdown-card:hover {
  background: rgba(230, 99, 0, 0.04);
  border-color: rgba(230, 99, 0, 0.15);
  transform: translateY(-1px);
}

.product-dropdown-card:hover::before {
  opacity: 1;
}

.product-dropdown-card:active {
  transform: translateY(0);
}

/* Product Icon */
.product-dropdown-icon {
  display: none;
}

/* Product Text */
.product-dropdown-text {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.product-dropdown-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  transition: color 0.2s var(--ease);
}

.product-dropdown-card:hover h3 {
  color: var(--accent-primary);
}

.product-dropdown-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Arrow Indicator */
.product-dropdown-arrow {
  width: 20px;
  height: 20px;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--accent-primary);
}

.product-dropdown-card:hover .product-dropdown-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Footer Link */
.products-dropdown-footer {
  display: none;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-primary);
}

.products-dropdown-footer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: rgba(0, 202, 80, 0.04);
  border: 1px solid rgba(0, 202, 80, 0.12);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.2s var(--ease);
}

.products-dropdown-footer-link:hover {
  background: rgba(0, 202, 80, 0.08);
  border-color: rgba(0, 202, 80, 0.2);
  transform: translateY(-1px);
}

.products-dropdown-footer-link-text {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.products-dropdown-footer-link-icon {
  width: 20px;
  height: 20px;
  color: #00ca50;
}

.products-dropdown-footer-arrow {
  width: 16px;
  height: 16px;
  color: #00ca50;
  transition: transform 0.2s var(--ease);
}

.products-dropdown-footer-link:hover .products-dropdown-footer-arrow {
  transform: translateX(4px);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-dropdown {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(100%);
    max-height: 80vh;
  }

  .nav-dropdown-trigger[aria-expanded="true"] + .nav-dropdown {
    transform: translateY(0);
  }

  .nav-dropdown-content {
    min-width: auto;
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 80vh;
    overflow-y: auto;
  }

  .product-dropdown-card {
    padding: var(--space-lg);
  }

  .product-dropdown-icon {
    display: none;
  }
}

/* Animation Enhancement */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.products-dropdown-grid .product-dropdown-card {
  opacity: 0;
  animation: slideDown 0.2s cubic-bezier(0.2, 0, 0, 1) forwards;
}

.nav-dropdown-trigger[aria-expanded="true"] + .nav-dropdown .product-dropdown-card:nth-child(1) {
  animation-delay: 0.03s;
}

.nav-dropdown-trigger[aria-expanded="true"] + .nav-dropdown .product-dropdown-card:nth-child(2) {
  animation-delay: 0.06s;
}

.nav-dropdown-trigger[aria-expanded="true"] + .nav-dropdown .product-dropdown-card:nth-child(3) {
  animation-delay: 0.09s;
}

/* Overlay for mobile */
.nav-dropdown-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

@media (max-width: 768px) {
  .nav-dropdown-overlay.active {
    display: block;
    opacity: 1;
  }
}
