.ft-header-nav nav { position: relative; }
.ft-mega-menu { position: static; margin-left: 0; }
.ft-mega-menu summary {
  gap: 8px; padding: 0 16px; border: 1px solid var(--ft-red, #ed1c24);
  border-radius: 0; background: var(--ft-red, #ed1c24); color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  box-shadow: 0 4px 12px #ed1c2426;
  font-size: inherit; letter-spacing: .4px; list-style: none;
}
.ft-mega-menu summary::-webkit-details-marker { display: none; }
.ft-mega-menu summary:focus-visible,
.ft-mega-panel :is(a,button,input):focus-visible { outline: 2px solid var(--ft-red, #ed1c24); outline-offset: 3px; }
.ft-mega-menu summary:focus-visible { box-shadow: inset 0 0 0 3px #fff; }
.ft-mega-menu[open] summary { background: #17171b; border-color: #17171b; color: #fff; }
.ft-mega-panel {
  position: absolute; top: calc(100% + 4px); right: 48px; left: 48px;
  z-index: 120; max-height: min(640px, 70vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 24px; border: 1px solid #ed1c2440; border-left: 4px solid var(--ft-red, #ed1c24);
  border-radius: 16px; background: var(--ft-mega-background, #fff); color: #17171b;
  box-shadow: 0 20px 50px #0003; font-size: 13px; letter-spacing: normal;
}
.ft-mega-menu:not([open]) > .ft-mega-panel { display: none; }
.ft-mega-toolbar { display: flex; gap: 18px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid #eee; }
.ft-mega-toolbar > div { flex: 1; }
.ft-mega-toolbar p { margin: 0 0 6px; font-size: 11px; letter-spacing: 2px; color: var(--ft-red, #ed1c24); font-weight: 700; }
.ft-mega-toolbar a { display: inline-flex; align-items: center; min-height: 32px; }
.ft-mega-search input { width: 240px; min-height: 44px; padding: 10px 12px; border: 1px solid #ddd; border-radius: 5px; background: #fff; color: #17171b; font-size: 13px; }
.ft-mega-toolbar button { flex: 0 0 44px; height: 44px; border: 1px solid #ddd; border-radius: 5px; background: #fff; color: #17171b; cursor: pointer; }
.ft-mega-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; padding-top: 18px; }
.ft-mega-card {
  min-width: 0; padding: 14px; border: 1px solid #ededf1; border-radius: 14px;
  background: var(--ft-mega-background, #fff); box-shadow: 0 6px 18px #17171b08;
}
.ft-mega-card h2 { margin: 0 0 12px; font-size: 17px; }
.ft-mega-card h2 a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-bottom: 6px; border-bottom: 1px solid #ed1c2430; }
.ft-mega-card h2 a > span:last-child { margin-left: auto; color: var(--ft-red, #ed1c24); }
.ft-mega-number { display: inline-flex; flex: 0 0 28px; height: 28px; align-items: center; justify-content: center; border: 1px solid #ed1c2460; border-radius: 50%; font-size: 10px; color: var(--ft-red, #ed1c24); }
.ft-mega-card-body { display: flex; align-items: flex-end; gap: 14px; }
.ft-mega-card-body > div { flex: 1; min-width: 0; }
.ft-mega-image {
  position: relative; display: block; order: 2; flex: 0 0 88px; width: 88px; height: 88px; padding: 6px;
  border: 1px solid #f0f0f3; border-radius: 13px; background: #f8f8fa;
  overflow: hidden; box-shadow: 0 8px 16px #17171b10;
}
.ft-mega-image::before, .ft-mega-image::after {
  content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none;
}
.ft-mega-image::before { top: 0; left: 0; border-top: 2px solid var(--ft-red, #ed1c24); border-left: 2px solid var(--ft-red, #ed1c24); }
.ft-mega-image::after { bottom: 0; right: 0; border-bottom: 2px solid var(--ft-red, #ed1c24); border-right: 2px solid var(--ft-red, #ed1c24); }
.ft-mega-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ft-mega-card--featured .ft-mega-card-body { flex-direction: column; align-items: stretch; }
.ft-mega-card--featured .ft-mega-image { order: 0; flex: none; width: 100%; height: 210px; padding: 12px; }
.ft-mega-count { margin: 0 0 3px; font-size: 11px; color: #73737c; font-weight: 400; }
.ft-mega-card ul { margin: 0; padding-left: 14px; }
.ft-mega-card li::marker { color: var(--ft-red, #ed1c24); }
.ft-mega-card li a, .ft-mega-explore { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; line-height: 1.4; }
.ft-mega-panel [hidden] { display: none !important; }
.ft-mega-empty { margin: 20px 0; color: #73737c; }
@media (max-width: 900px) {
  .ft-mega-panel { left: 24px; right: 24px; padding: 18px; }
  .ft-mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .ft-mega-card--featured .ft-mega-image { height: 180px; }
}
@media (max-width: 600px) {
  .ft-mega-menu { margin-left: 0; }
  .ft-mega-menu summary { font-size: 10px; padding: 0 12px; }
  .ft-mega-panel { left: 12px; right: 12px; padding: 16px; max-height: 65vh; }
  .ft-mega-toolbar { flex-wrap: wrap; gap: 10px; }
  .ft-mega-toolbar > div { flex-basis: calc(100% - 54px); }
  .ft-mega-search { order: 3; width: 100%; }
  .ft-mega-search input { width: 100%; }
  .ft-mega-grid { grid-template-columns: 1fr; }
  .ft-mega-card h2 { font-size: 16px; }
  .ft-mega-card--featured .ft-mega-image { height: 200px; }
}
@media (prefers-reduced-motion: no-preference) {
  .ft-mega-menu[open] .ft-mega-panel { animation: ft-mega-enter .18s ease-out; }
  .ft-mega-image img { transition: transform .2s ease; }
  .ft-mega-image:hover img { transform: scale(1.04); }
  @keyframes ft-mega-enter { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
}
