/* ════════════════════════════════════════════
   Tovra Mega Menu — front.css
   All colors via CSS variables (set from PHP)
════════════════════════════════════════════ */

/* ── NAV ITEM WITH MEGA ── */
.tmm-parent { position: relative; }

.tmm-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  text-decoration: none;
}

.tmm-arrow {
  font-size: 0.7em;
  transition: transform 0.2s;
  display: inline-block;
}

.tmm-parent.tmm-open > a .tmm-arrow,
.tmm-parent:hover > a .tmm-arrow {
  transform: rotate(180deg);
}

/* ── DROPDOWN CONTAINER ── */
.tmm-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  background: var(--tmm-bg);
  border: 1px solid var(--tmm-border);
  border-radius: var(--tmm-radius);
  box-shadow: var(--tmm-shadow);
  min-width: 340px;
  opacity: 0;
  pointer-events: none;
}

/* Width variants */
.tmm-width-container .tmm-dropdown,
.tmm-dropdown.tmm-width-container {
  width: max-content;
  max-width: 900px;
}

.tmm-dropdown.tmm-width-fullwidth {
  position: fixed;
  left: 0;
  right: 0;
  width: 100vw;
  border-radius: 0;
}

/* ── OPEN STATE ── */
.tmm-parent.tmm-open > .tmm-dropdown,
.tmm-parent:hover > .tmm-dropdown {
  display: block;
  opacity: 1;
  pointer-events: all;
}

/* Fade animation */
.tmm-anim-fade .tmm-dropdown {
  animation: tmmFade 0.2s ease;
}

@keyframes tmmFade {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slide animation */
.tmm-anim-slide .tmm-dropdown {
  animation: tmmSlide 0.22s ease;
}

@keyframes tmmSlide {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── INNER LAYOUT ── */
.tmm-dropdown-inner {
  display: flex;
  gap: 0;
}

.tmm-cols-wrap {
  display: flex;
  flex: 1;
  gap: 0;
  padding: 28px;
  flex-wrap: wrap;
}

/* Span system: 4 columns total */
.tmm-col-unit { padding: 0 20px; }
.tmm-span-1 { flex: 0 0 25%; }
.tmm-span-2 { flex: 0 0 50%; }
.tmm-span-3 { flex: 0 0 75%; }
.tmm-span-4 { flex: 0 0 100%; }

/* ── COLUMN TITLE ── */
.tmm-col-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tmm-heading);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--tmm-border);
}

/* ── ITEMS ── */

/* Simple link */
.tmm-item-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: var(--tmm-fs);
  color: var(--tmm-text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  line-height: 1.5;
}

.tmm-item-link:hover {
  background: rgba(91,79,207,0.07);
  color: var(--tmm-hover);
}

/* Link with icon */
.tmm-item-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 5px;
  flex-shrink: 0;
}

/* Link with description */
.tmm-item-link-desc {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.tmm-item-link-title {
  font-weight: 600;
  font-size: var(--tmm-fs);
}

.tmm-item-link-sub {
  font-size: calc(var(--tmm-fs) - 2px);
  color: #888;
  line-height: 1.3;
}

/* Full item card */
.tmm-item-full {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--tmm-text);
  transition: background 0.15s;
  margin-bottom: 6px;
}

.tmm-item-full:hover {
  background: rgba(91,79,207,0.07);
}

.tmm-full-img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.tmm-full-title {
  font-weight: 600;
  font-size: var(--tmm-fs);
  margin-bottom: 3px;
}

.tmm-full-desc {
  font-size: calc(var(--tmm-fs) - 2px);
  color: #888;
  line-height: 1.4;
}

/* Heading */
.tmm-item-heading {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tmm-heading);
  padding: 12px 10px 6px;
}

/* Divider */
.tmm-divider {
  border: none;
  border-top: 1px solid var(--tmm-border);
  margin: 8px 0;
}

/* Custom HTML */
.tmm-item-html { padding: 4px 8px; font-size: var(--tmm-fs); }

/* Badge */
.tmm-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

/* ── BANNER ── */
.tmm-banner {
  min-width: 220px;
  max-width: 270px;
  flex-shrink: 0;
  padding: 28px 24px;
  border-radius: 0 var(--tmm-radius) var(--tmm-radius) 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #fff;
}

.tmm-banner-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
}

.tmm-banner-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}

.tmm-banner-desc {
  font-size: 0.88rem;
  opacity: 0.85;
  line-height: 1.55;
}

.tmm-banner-btn {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 22px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.4);
  transition: background 0.2s;
  margin-top: auto;
  text-align: center;
}

.tmm-banner-btn:hover {
  background: rgba(255,255,255,0.35);
  color: #fff;
}

/* ════════════════════════════════════════════
   MOBILE ACCORDION
════════════════════════════════════════════ */
@media (max-width: 991px) {
  .tmm-parent { position: static; }

  .tmm-dropdown {
    position: static;
    display: none !important;
    width: 100% !important;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--tmm-border);
    opacity: 1;
    pointer-events: all;
  }

  .tmm-parent.tmm-open > .tmm-dropdown {
    display: block !important;
  }

  .tmm-dropdown-inner { flex-direction: column; }
  .tmm-cols-wrap { flex-direction: column; padding: 10px 16px; }
  .tmm-span-1, .tmm-span-2, .tmm-span-3, .tmm-span-4 { flex: 0 0 100%; }
  .tmm-col-unit { padding: 0; border-bottom: 1px solid var(--tmm-border); padding-bottom: 10px; margin-bottom: 10px; }
  .tmm-col-unit:last-child { border-bottom: none; }
  .tmm-banner { max-width: 100%; border-radius: 0; }

  .tmm-arrow { float: right; }
}
