@import "../../base/colors.css";
@import "../../base/fonts.css";

.c-mega-menu {
  display: block !important;
  padding: 0 !important;
  background: var(--bg-color) !important;
  width: 100% !important;
}

.c-mega-menu__content {
  display: flex !important;
  width: 100% !important;
}

/* Specific Content Widths for different types */
/* Customers: Centered and Narrower */
.c-mega-menu--customers .c-mega-menu__content {}

/* Products/Resources: Full Grid */
.c-mega-menu--products .c-mega-menu__content,
.c-mega-menu--resources .c-mega-menu__content {
  max-width: 1240px !important;
  margin: 0 auto !important;
}

/* Products: 4 columns */
.c-mega-menu--products .c-mega-menu__content {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
}

.c-mega-menu--products .c-mega-menu__column {
  border-right: none !important;
  background-color: transparent !important;
}

/* Resources: 3-column Grid (2 Menu + 1 Feature) */
.c-mega-menu--resources .c-mega-menu__content {
  display: grid !important;
  grid-template-columns: 1fr 1fr 380px !important;
  grid-template-rows: max-content 1fr !important;
}

.c-mega-menu--resources .c-mega-menu__column:nth-child(1) {
  grid-column: 1 !important;
  grid-row: 1 !important;
  padding-top: 20px !important;
}

.c-mega-menu--resources .c-mega-menu__column:nth-child(2) {
  grid-column: 2 !important;
  grid-row: 1 !important;
  padding-top: 20px !important;
}

.c-mega-menu--resources .c-mega-menu__column:nth-child(3) {
  grid-column: 1 !important;
  grid-row: 2 !important;
  padding-top: 20px !important;
}

.c-mega-menu--resources .c-mega-menu__column:nth-child(4) {
  grid-column: 2 !important;
  grid-row: 2 !important;
  padding-top: 20px !important;
}

.c-mega-menu--resources .c-mega-menu__feature {
  grid-column: 3 !important;
  grid-row: 1 / span 2 !important;
}

.c-mega-menu--resources .c-mega-menu__column {
  margin: 0 !important;
  border-right: 1px solid var(--border-light) !important;
}

.c-mega-menu--resources .c-mega-menu__column:nth-child(1),
.c-mega-menu--resources .c-mega-menu__column:nth-child(2) {
  border-bottom: 1px solid var(--border-light) !important;
}

.c-mega-menu--resources .c-mega-menu__column:nth-child(2),
.c-mega-menu--resources .c-mega-menu__column:nth-child(4) {
  border-right: none !important;
  background-color: #f7f7f7 !important;
}

.c-mega-menu__column {
  border-right: 1px solid var(--border-light) !important;
  min-width: 0 !important;
  padding: 20px 15px;
  margin: 0;
}

.c-mega-menu__column:last-of-type {
  border-right: none !important;
}

/* Alternate column background — 2nd and 4th columns get a subtle tint */
.c-mega-menu__column:nth-child(even) {
  background-color: #f7f7f7 !important;
}

/* Titles */
.c-mega-menu__column-header {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin-bottom: 20px !important;
  text-decoration: none;
}

.c-mega-menu__column-header .c-mega-menu__icon {
  margin-top: 2px !important;
}

.c-mega-menu--resources .c-mega-menu__column-header .c-mega-menu__icon {
  margin-top: 8px;
}

.c-mega-menu--resources .c-mega-menu__label {
  padding-left: 0;
}

.c-mega-menu--resources .c-mega-menu__item-l2 {
  margin-bottom: 0 !important;
}

.c-mega-menu--resources .c-mega-menu__header {
  margin: 0 -15px !important;
  padding: 0px 15px 6px 45px !important;
  transition: background-color 0.2s ease !important;
  align-items: center !important;
}

.c-mega-menu--resources .c-mega-menu__header:hover {
  background-color: var(--secondary-color) !important;
}

.c-mega-menu--resources .c-mega-menu__header:hover .c-mega-menu__label {
  color: #ffffff !important;
}

.c-mega-menu__title {
  margin: 0;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 18px;
  font-family: var(--font-family);
  padding: 10px 0;
  padding-bottom: 20px;
  text-transform: uppercase;
  color: #2C3E50;
}

.c-mega-menu--resources .c-mega-menu__title {
  color: #001f37 !important;
  text-transform: uppercase !important;
  font-size: 13px !important;
  line-height: 16px !important;
  margin: 0 !important;
  transition: color 0.2s ease !important;
}

.c-mega-menu--resources .c-mega-menu__column-header {
  cursor: pointer;
}

.c-mega-menu--resources .c-mega-menu__column-header:hover .c-mega-menu__title {
  color: var(--secondary-color) !important;
}

.c-mega-menu__column-header .c-mega-menu__title {
  padding: 0 !important;
  margin-bottom: 0 !important;
}

.c-mega-menu__column-desc {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: -10px;
  margin-bottom: 20px;
  line-height: 1.4;
  font-family: var(--font-family);
}

.c-mega-menu__column-header .c-mega-menu__column-desc {
  margin-top: 5px !important;
  margin-bottom: 0 !important;
}

/* Items */
.c-mega-menu__item-l2 {
  margin-bottom: 20px !important;
}

.c-mega-menu--customers .c-mega-menu__item-l2 {
  border-top: 1px solid var(--customers-item-border) !important;
  padding: 20px 30px 0 15px !important;
  margin-top: 20px !important;
  margin-bottom: 0 !important;
}

.c-mega-menu--customers .c-mega-menu__item-l2:first-child {
  border-top: none !important;
  padding: 0 15px !important;
  margin-top: 0 !important;
}

.c-mega-menu__item-text {
  margin-top: -6px;
}

.c-mega-menu__header {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
  text-decoration: none !important;
}

.c-mega-menu__icon {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
}

.c-mega-menu__icon img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.c-mega-menu__label {
  cursor: pointer;
  color: var(--customers-nav-link-color);
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  font-family: var(--font-family);
  text-transform: inherit;
  transition: all .3s;
  cursor: pointer;
  color: #666;
  font-size: 13px;
  line-height: 14px;
  padding: 6px 0;
  display: block;
  text-decoration: none;
  font-weight: 600;

}

.c-mega-menu__header:hover .c-mega-menu__label {
  color: var(--secondary-color) !important;
}

.c-mega-menu--customers .c-mega-menu__column-header {
  margin-bottom: 0 !important;
}

.c-mega-menu__description {
  font-weight: 300;
  font-size: 10px;
  line-height: 13px;
  letter-spacing: 0;
  color: var(--customers-body-color);
  font-family: var(--font-family);
  display: block !important;
}

/* Sub-links */
.c-mega-menu__subtree {
  list-style: none !important;
  margin: 0 -15px 0 -15px !important;
  padding: 0 !important;
}

.c-mega-menu--customers .c-mega-menu__subtree {
  margin: 0 -30px 0 -30px !important;
}

.c-mega-menu__item-l3 {
  margin-bottom: 0 !important;
}

.c-mega-menu__item-l3 a {
  cursor: pointer;
}

.c-mega-menu__link {
  text-decoration: none !important;
  font-size: 13px !important;
  line-height: 14px !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  font-family: var(--font-family) !important;
  display: flex !important;
  align-items: center !important;
  padding: 8px 15px 8px 45px !important;
  /* 45px left = 15px column padding + 30px indentation */
  transition: background-color 0.2s ease, color 0.2s ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.c-mega-menu--customers .c-mega-menu__link {
  padding: 8px 30px 8px 60px !important;
  /* 60px left = 30px column padding + 30px indentation */
}

.c-mega-menu__link:not(.c-mega-menu__link--action):hover {
  background-color: var(--secondary-color) !important;
  color: #ffffff !important;
}

.c-mega-menu__link--action {
  color: var(--secondary-color) !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  text-decoration: none !important;
}

.c-mega-menu__link--action .c-mega-menu__link-arrow {
  display: inline-block !important;
  transition: transform 0.2s ease !important;
}

.c-mega-menu__link--action:hover .c-mega-menu__link-arrow {
  transform: translateX(4px) !important;
}

/* Feature Block */
.c-mega-menu__feature {
  padding: 40px !important;
  background-color: var(--light-bg) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  border-left: 1px solid var(--border-light) !important;
}

.c-mega-menu__feature .field--name-field-title {
  font-family: var(--heading-font) !important;
  font-size: 18px !important;
  color: var(--text-color) !important;
  margin-bottom: 20px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}

.c-mega-menu__feature .field--name-field-body {
  font-size: 14px !important;
  color: var(--text-muted) !important;
  margin-bottom: 25px !important;
  line-height: 1.6 !important;
}

.c-mega-menu__feature .field--name-field-image {
  margin-top: 20px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.c-mega-menu__feature img {
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
}

.c-mega-menu__feature .field--name-field-link a {
  color: var(--secondary-color) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  font-size: 14px !important;
}

/* Customers layout override */
.c-mega-menu--customers .layout-container {
  max-width: 650px !important;
  margin: 0 auto !important;
}

.c-mega-menu--customers .c-mega-menu__column {
  flex: 0 0 248px !important;
  width: 248px !important;
  box-sizing: border-box !important;
  padding: 20px 0 !important;
  margin: 0 !important;
  border-right: 1px solid var(--border-light) !important;
}

.c-mega-menu--customers .c-mega-menu__feature {
  flex: 1 1 auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border-left: none !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Ensure Drupal's contextual wrappers stretch to fill height */
.c-mega-menu--customers .c-mega-menu__feature>.contextual-region {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

.c-mega-menu--customers .c-mega-menu__title {
  color: var(--customers-title-color) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  margin-bottom: 20px !important;
  padding: 0 15px !important;
}

/* Shared feature block styling */
.c-customer-feature {
  flex: 1 !important;
  position: relative !important;
  display: flex !important;
  align-items: stretch !important;
  gap: 0 !important;
  width: 100% !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.c-customer-feature__content {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 0 !important;
}

.c-customer-feature__content h3 {
  font-family: var(--font-family) !important;
  font-size: 14px !important;
  color: var(--customers-title-color) !important;
  margin: 0 0 15px 0 !important;
  font-weight: 600 !important;
  line-height: 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.c-customer-feature__title-icon {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}

.c-customer-feature__title-icon img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}

.c-customer-feature__body {
  font-weight: 300 !important;
  font-size: 10px !important;
  line-height: 13px !important;
  letter-spacing: 0 !important;
  color: #2c3e50 !important;
  margin: 0 0 6px 0 !important;
}

.c-customer-feature__body p {
  margin: 0 !important;
}

.c-customer-feature__link {
  color: var(--secondary-color) !important;
  font-size: 10px !important;
  line-height: 14px !important;
  transition: all 0.3s !important;
  position: relative !important;
  text-transform: inherit !important;
  cursor: pointer !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  margin-top: 0 !important;
}

.c-customer-feature__link svg {
  transition: transform 0.3s ease !important;
}

.c-customer-feature__link:hover svg {
  transform: translateX(4px) !important;
}

/* Customers specific feature overrides */
.c-mega-menu--customers .c-customer-feature {
  background: var(--light-bg) !important;
}

.c-mega-menu--customers .c-customer-feature__content {
  padding: 30px 188px 0px 15px !important;
}

.c-mega-menu--customers .c-customer-feature__image {
  position: static !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 0 !important;
  flex: 0 !important;
}

.c-mega-menu--customers .c-customer-feature__image div {
  position: static !important;
}

.c-mega-menu--customers .c-customer-feature__image img {
  position: absolute !important;
  right: 20px !important;
  bottom: 0px !important;
  width: 140px !important;
  height: auto !important;
  display: block !important;
  object-fit: contain !important;
  z-index: 10 !important;
}

/* Resources specific feature overrides */
.c-mega-menu--resources .c-mega-menu__feature {
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.c-mega-menu--resources .c-mega-menu__feature>.contextual-region {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

.c-mega-menu--resources .c-customer-feature {
  background: var(--color-white) !important;
  position: relative !important;
}

.c-mega-menu--resources .c-customer-feature__content {
  padding: 20px 15px 30px 15px !important;
}

.c-mega-menu--resources .c-customer-feature__image {
  position: static !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 0 !important;
  flex: 0 !important;
}

.c-mega-menu--resources .c-customer-feature__image div {
  position: static !important;
}

.c-mega-menu--resources .c-customer-feature__image img {
  position: absolute !important;
  right: 0px !important;
  bottom: 0px !important;
  width: 200px !important;
  height: auto !important;
  display: block !important;
  object-fit: contain !important;
  z-index: 10 !important;
}

/* Resources two-paragraph feature body typography */
.c-mega-menu--resources .c-customer-feature__body {
  margin: 0 0 15px 0 !important;
}

.c-mega-menu--resources .c-customer-feature__body p:first-of-type,
.c-mega-menu--resources .c-customer-feature__body div>p:first-of-type {
  font-size: 12px !important;
  line-height: 16px !important;
  font-weight: 600 !important;
  color: #001f37 !important;
  margin: 0 0 15px 0 !important;
}

.c-mega-menu--resources .c-customer-feature__body p:nth-of-type(2),
.c-mega-menu--resources .c-customer-feature__body div>p:nth-of-type(2) {
  font-weight: 300 !important;
  font-size: 10px !important;
  line-height: 13px !important;
  letter-spacing: 0 !important;
  color: #2C3E50 !important;
  margin: 0 !important;
}