/* ==========================================================================
   Mega Menu Navigation Styles - Encaje Mayorista
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 999;
}

.site-nav {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 14px;
}

.site-nav a.nav-link {
  color: #555047;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.18s ease;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
}

.site-nav a.nav-link:hover,
.site-nav a.nav-link:focus-visible {
  color: #a8842f;
}

/* Products Mega Menu Container */
.has-mega-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.mega-trigger-btn {
  background: none;
  border: none;
  padding: 8px 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #555047;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.18s ease;
}

.mega-trigger-btn:hover,
.mega-trigger-btn:focus-visible,
.has-mega-menu:hover .mega-trigger-btn,
.has-mega-menu[data-state="open"] .mega-trigger-btn {
  color: #a8842f;
}

.mega-chevron {
  width: 10px;
  height: 10px;
  transition: transform 0.22s ease;
  stroke-width: 2.5;
}

.has-mega-menu:hover .mega-chevron,
.has-mega-menu[data-state="open"] .mega-chevron {
  transform: rotate(180deg);
}

/* Mega Panel */
.mega-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: min(1120px, calc(100vw - 32px));
  background: #ffffff;
  border: 1px solid #e6dfd1;
  border-radius: 10px;
  box-shadow: 0 16px 40px -8px rgba(26, 23, 18, 0.12), 0 4px 12px rgba(26, 23, 18, 0.05);
  padding: 24px 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  z-index: 1000;
  margin-top: 6px;
}

/* Hover bridge so mouse movement doesn't close it */
.has-mega-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 16px;
  display: block;
}

.has-mega-menu:hover .mega-panel,
.has-mega-menu:focus-within .mega-panel,
.has-mega-menu[data-state="open"] .mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Mega Menu Grid Layout */
.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.mega-col {
  display: flex;
  flex-direction: column;
}

.mega-col-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #f0ebe1;
}

.mega-col-icon {
  width: 16px;
  height: 16px;
  color: #a8842f;
  flex-shrink: 0;
}

.mega-col-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1712;
  margin: 0;
}

.mega-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mega-item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: #1a1712;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.mega-item:hover,
.mega-item:focus-visible {
  background-color: #faf7f2;
}

.mega-item-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  color: #1a1712;
  line-height: 1.35;
}

.mega-item:hover .mega-item-name {
  color: #a8842f;
}

.mega-item-desc {
  display: block;
  font-size: 11.5px;
  color: #7a7468;
  margin-top: 2px;
  line-height: 1.35;
}

.mega-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1;
}

.mega-badge-stock {
  background-color: #eaf5ec;
  color: #217336;
}

.mega-badge-hot {
  background-color: #fcf1df;
  color: #a86c00;
}

.mega-badge-new {
  background-color: #e8f0fe;
  color: #1a56db;
}

/* Featured Spotlight Card inside Mega Menu */
.mega-card-spotlight {
  background: #fbf9f5;
  border: 1px solid #eae3d5;
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mega-card-spotlight h5 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1a1712;
}

.mega-card-spotlight p {
  margin: 0;
  font-size: 11.5px;
  color: #7a7468;
  line-height: 1.4;
}

.mega-spotlight-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #a8842f;
  text-decoration: none;
  margin-top: 2px;
}

.mega-spotlight-btn:hover {
  text-decoration: underline;
}

/* Mega Menu Bottom Bar */
.mega-bottom-bar {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #f0ebe1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: #7a7468;
}

.mega-bottom-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.mega-bottom-highlight {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #1a1712;
}

.mega-bottom-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mega-cta-link {
  color: #a8842f;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mega-cta-link:hover {
  text-decoration: underline;
}

/* Header CTA Button */
.header-inquiry-btn {
  color: #a8842f;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid #a8842f;
  border-radius: 4px;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.header-inquiry-btn:hover {
  background: #a8842f;
  color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 1040px) {
  .mega-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap;
    gap: 14px;
  }
  .mega-panel {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 10px;
    padding: 16px;
    box-shadow: none;
    border-radius: 6px;
  }
  .mega-grid {
    grid-template-columns: 1fr;
  }
}
