:root {
      --bg: #f4f6fa;
      --panel: #fff;
      --primary: #1e40af;
      --accent: #7c3aed;
      --muted: #6b7280;
      --radius: 14px;
      --card-border: rgba(15, 23, 42, 0.04);
      --card-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
      --text: #0f172a;
      --page-padding: 0px;
      /* large-screen side padding */
      --chip-small-font: 0.72rem;
      --chip-gap: 6px;
    }

    /* base */
    * {
      box-sizing: border-box
    }

    html,
    body {
      height: 100%
    }

    body {
      margin: 0;
      background: var(--bg);
      color: var(--text);
      font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      font-size: 15px;
      padding-left: var(--page-padding);
      padding-right: var(--page-padding);
    }

    /* limit content width and center */
    .main-shell {
      max-width: 1250px;
      padding: 0px 20px;
      margin: 18px auto;
    }

    /* NAV */
    .navbar-premium {
      display: flex;
      background: var(--panel);
      padding: 18px 20px;
      border-bottom: 1px solid var(--card-border);
      box-shadow: 0 6px 22px rgba(16, 24, 40, 0.03);
      position: sticky;
      top: 0;
      z-index: 1200;
    }

    .brand-title {
      font-weight: 800;
      color: var(--primary);
      font-size: 1.45rem;
      letter-spacing: -0.4px
    }

    .nav-link {
      color: rgba(15, 23, 42, 0.7);
      font-weight: 600
    }

    .nav-link:hover {
      color: var(--primary)
    }

    .navbar .btn {
      font-weight: 700
    }

    /* hero / search */
    .hero {
      padding: 28px 0px;
      text-align: center
    }

    .hero h1 {
      font-size: 2rem;
      margin: 0 0 6px;
      font-weight: 800
    }

    .hero p {
      color: var(--muted);
      margin: 0 0 12px
    }

    .search-wrap {}

    .search-box {
      background: var(--panel);
      border-radius: 12px;
      padding: 10px;
      border: 1px solid rgba(15, 23, 42, 0.06);
      box-shadow: 0 10px 30px rgba(16, 24, 40, 0.03);
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .search-box .form-control {
      border: 0;
      box-shadow: none;
      height: 54px;
      font-size: 15px
    }

    .search-box .btn {
      height: 44px;
      padding: 10px 14px;
      border-radius: 10px
    }

    .search-wrap .form-select {
      height: 44px
    }

    /* layout */
    .left-col {
      width: 320px
    }

    .sidebar {
      background: var(--panel);
      padding: 18px;
      border-radius: 12px;
      border: 1px solid var(--card-border);
      box-shadow: var(--card-shadow)
    }

    .main-wrapper {
      display: flex;
      gap: 20px
    }

    /* list & cards */
    .list-area {
      flex: 1
    }

    .result-header {
      display: flex;
      align-items: center;
      gap: 12px;
      justify-content: space-between;
      flex-wrap: wrap
    }

    .list-tabs {
      display: flex;
      gap: 10px;
      align-items: center
    }

    .tab-btn {
      padding: 8px 14px;
      border-radius: 999px;
      background: transparent;
      border: 1px solid transparent;
      font-weight: 700;
      color: var(--muted)
    }

    .tab-btn.active {
      background: var(--primary);
      color: #fff;
      box-shadow: 0 12px 30px rgba(30, 64, 175, 0.12)
    }

    /* ========== FRANCHISE CARD UI UPGRADE ========== */
    .franchise-card {
      display: flex;
      gap: 22px;
      align-items: flex-start;
      background: var(--panel);
      border-radius: 16px;
      padding: 20px;
      border: 1px solid rgba(15, 23, 42, 0.05);
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03);
      transition: transform .18s ease, box-shadow .18s ease;
      overflow: hidden;
    }

    .franchise-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 14px 32px rgba(0, 0, 0, 0.07);
    }

    /* Logo: force 1:1 square with center & consistent size */
    .brand-figure {
      width: 110px;
      height: 110px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #fafafa;
      border: 1px solid rgba(15, 23, 42, 0.05);
      padding: 8px;
      flex-shrink: 0;
      overflow: hidden;
    }

    .brand-figure img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 8px;
      display: block
    }

    /* Title + tags area */
    .card-body {
      flex: 1;
      min-width: 0
    }

    .card-header-top {
      display: flex;
      align-items: center;
      gap: 12px;
      justify-content: space-between;
      flex-wrap: wrap
    }

    .card-left {
      min-width: 0;
      flex: 1
    }

    .card-title {
      font-size: 1.22rem;
      font-weight: 800;
      margin: 0 0 6px;
      letter-spacing: -0.3px;
      display: inline-block
    }

    .card-meta {
      display: flex;
      gap: var(--chip-gap);
      align-items: center;
      margin: 0px;
      flex-wrap: wrap
    }

    /* smaller chips next to title (kept for other contexts but removed from inline list) */
    .chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 9px;
      border-radius: 999px;
      font-weight: 700;
      font-size: var(--chip-small-font);
      background: #eef2ff;
      color: var(--primary);
      border: 1px solid rgba(30, 64, 175, 0.12)
    }

    /* industry & sub-industry styled and placed on separate row under name */
    .chip.industry {
      background: #e6f9ee;
      color: #0b5b3a;
      border: 1px solid rgba(11, 91, 58, 0.08);
      font-weight: 700
    }

    .chip.subindustry {
      background: #fff3e0;
      color: #7a4a00;
      border: 1px solid rgba(122, 74, 0, 0.08);
      font-weight: 700
    }

    /* secondary chip style (used for neutral tags if needed) */
    .chip.secondary {
      background: #f9fafb;
      color: var(--muted);
      border: 1px solid rgba(15, 23, 42, 0.08);
      font-weight: 700
    }

    /* investment line */
    .invest {
      font-weight: 800;
      margin: 10px 0 6px;
      color: var(--text);
      font-size: 1rem
    }

    .fees-box {
      background: #fff;
      padding: 14px;
      border-radius: 12px;
      border: 1px solid rgba(15, 23, 42, 0.05);
      margin: 8px 0;
      color: var(--muted);
      display: flex;
      gap: 12px;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
    }

    .fees-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      /* reduced gap for tighter look */
      min-width: 240px;
      align-items: center;
    }

    .fee-item {
      font-weight: 700;
      font-size: .95rem
    }

    .fee-item strong {
      white-space: nowrap;
    }

    .fee-note {
      font-size: .88rem;
      color: var(--muted);
      display: flex;
      flex-direction: column;
    }

    /* make training-cost area align neatly at right on wide screens */
    .fees-box .right-note {
      flex-grow: 1;
      text-align: right;
      font-size: .92rem
    }

    /* offers */
    .offers {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 8px
    }

    .offer-item {
      padding: 5px 10px;
      border-radius: 50px;
      background: #f5f5f5;
      border: 1px solid rgba(15, 23, 42, 0.1);
      font-weight: 600;
      color: #4b5563;
      font-size: .85rem
    }

    /* quick column (Since / Tag summary / HQ) */
    .card-quick {
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: 150px;
      text-align: right;
      color: var(--muted);
      font-weight: 700;
      flex-shrink: 0
    }

    .small-logo {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      object-fit: cover;
      border: 1px solid rgba(15, 23, 42, 0.04);
      padding: 4px;
      background: #fff
    }

    /* pagination */
    #pagination {
      display: flex;
      gap: 8px;
      justify-content: flex-end;
      margin-top: 16px;
      flex-wrap: wrap
    }

    /* footer */
    .footer {
      padding: 28px 0;
      color: var(--muted);
      text-align: center;
      margin-top: 28px
    }

    /* responsive adjustments */
    @media (max-width:1150px) {
      body {
        padding-left: var(--page-padding);
        padding-right: var(--page-padding)
      }

      .left-col {
        width: 300px
      }

      .brand-figure {
        width: 100px;
        height: 100px
      }

      /* show quick column on medium view but reduce width */
      .card-quick {
        width: 140px
      }
    }

    @media (max-width:900px) {
      .main-wrapper {
        flex-direction: column
      }

      .left-col {
        width: 100%
      }

      body {
        padding-left: var(--page-padding);
        padding-right: var(--page-padding)
      }

      /* On smaller screens show card-quick as a full-width row below the title section */
      .card-header-top {
        align-items: flex-start
      }

      .card-quick {
        flex-direction: row;
        width: 100%;
        text-align: left;
        font-size: 0.95rem;
        color: var(--muted);
      }
    }

    @media (max-width:520px) {
      .brand-figure {
        width: 100%;
        height: 140px
      }

      .franchise-card {
        flex-direction: column;
        align-items: stretch
      }

      .fees-grid {
        grid-template-columns: 1fr
      }

      .fees-box .right-note {
        width: 100%;
        text-align: left
      }
    }
  
/* megamenu hover */
@media (min-width: 992px) {
  .nav-item.dropdown:hover .dropdown-menu { display: block; }
}

/* --- FIX MEGAMENU WIDTH ALIGNMENT --- */
.megamenu-container {
  width: 100%;
  max-width: 1250px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 20px;
  padding-right: 20px;
}

.nav-item.dropdown .dropdown-menu {
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  border-radius: 16px;
}

@media (min-width: 992px) {
  .nav-item.dropdown:hover .dropdown-menu {
    display: block !important;
  }
}