/*
Item name: Menuzord - Responsive Megamenu
Author: marcoarib - marco.arib@gmail.com
License: http://codecanyon.net/licenses

Redesign: Stylepot Megamenu — Flex layout, dynamic image sizing
Prefix: sp-mega-*
*/

/* MENU CONTAINER
======================================*/
.no_scroll_menuzord { overflow: hidden; padding: 0; }
.menuzord { width: 100%; vertical-align: top; }
.menuzord a { transition: color .3s linear, background .3s linear; }
.menuzord-brand { display: none; float: left; cursor: pointer; }

/* MENU
======================================*/
.menuzord-menu { margin: 0; padding: 0; list-style: none; vertical-align: top; display: flex; }
.menuzord-menu > li { float: none; }
.menuzord-menu > li > a {
  padding: 25px 20px; text-align: center; display: block; text-decoration: none;
  font-size: 1.4rem; letter-spacing: 0; font-weight: 500; color: #000; outline: 0;
  line-height: 2.0rem; position: relative; z-index: 100;
  -webkit-tap-highlight-color: transparent;
}
.menuzord-menu > li > a > span.over { vertical-align: top; display: inline-block; position: relative; }
.menuzord-menu > li > a:hover > span.over:before {
  content: ''; display: block; position: absolute; top: 100%; width: 100%; left: 0; right: 0;
}
.menuzord-menu ul.menu_items li.overview { display: none !important; }
.menuzord-menu li .indicator { margin-left: 3px; display: none; }

/* MEGAMENU
======================================*/
.menuzord-menu > li > .megamenu {
  text-align: left; visibility: visible; width: 100%; padding: 0;
  position: absolute; top: 102%; left: 0; right: 0; display: none; z-index: 99;
  border-bottom: 1px solid #e5e5e5; background: transparent; margin: 0 auto;
  -webkit-transform: translateZ(0);
}
.menuzord-menu > li > .megamenu .megamenu-row {
  width: 100%; border-top: 1px solid #fff; padding: 0; background: #fff;
}
.menuzord-menu > li > .megamenu .megamenu-row:first-child { margin-top: 0; }
.menuzord-menu > li > .megamenu .megamenu-row:before,
.menuzord-menu > li > .megamenu .megamenu-row:after { display: table; content: ""; line-height: 0; }
.menuzord-menu > li > .megamenu .megamenu-row:after { clear: both; }


/* =============================================
   STYLEPOT MEGAMENU — FLEX LAYOUT
   [Leading Images] [Text Columns] [Trailing Images]
   Full-width, images edge-to-edge at viewport edges
   ============================================= */

.sp-mega-content {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
}


/* =============================================
   IMAGE AREAS — edge-to-edge, no padding
   ============================================= */

.sp-mega-images-left,
.sp-mega-images-right {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
}

/* Each image card — max-width controlled by sp-mega-size-* classes */
.sp-mega-image-card {
  display: block;
  position: relative;
  overflow: hidden;
  flex: 1 1 0;
  min-width: 0;
  text-decoration: none;
}

/* Container sizing via clamp — adapts to number of images */
.sp-mega-count-1 { flex-basis: clamp(200px, 28%, 320px); }
.sp-mega-count-2 { flex-basis: clamp(320px, 44%, 642px); }
.sp-mega-count-3 { flex-basis: clamp(400px, 56%, 964px); }
.sp-mega-count-4 { flex-basis: clamp(480px, 68%, 1284px); }
.sp-mega-count-5 { flex-basis: clamp(550px, 76%, 1604px); }
.sp-mega-count-6 { flex-basis: clamp(600px, 84%, 1924px); }

/* When ALL items are images (no text), fill 100% */
.sp-mega-content:not(:has(.sp-mega-text)) .sp-mega-images-left,
.sp-mega-content:not(:has(.sp-mega-text)) .sp-mega-images-right {
  flex-basis: 100%;
}


/* =============================================
   IMAGE CARD STYLING
   ============================================= */

.sp-mega-card {
  display: block;
  position: relative;
  overflow: hidden;
}

.sp-mega-card-image {
  display: block;
  overflow: hidden;
}

.sp-mega-card-image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.sp-mega-card:hover .sp-mega-card-image img {
  transform: scale(1.03);
}

.sp-mega-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 16px 14px 16px;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);
}


/* =============================================
   TEXT AREA — sequential column fill
   Images stay edge-to-edge, text gets own spacing
   ============================================= */

.sp-mega-text {
  flex: 1;
  min-width: 300px;
  padding: 36px 0 24px 0;
}

.sp-mega-text > ul.menu_items {
  list-style-type: none;
  column-count: 5;
  column-gap: 0;
  column-rule: none;
  column-fill: auto;
  margin: 0;
  padding: 0;
}

/* Adjust columns when images take up space */
.sp-mega-lead-1 .sp-mega-text > ul.menu_items,
.sp-mega-trail-1 .sp-mega-text > ul.menu_items { column-count: 4; }

.sp-mega-lead-2 .sp-mega-text > ul.menu_items,
.sp-mega-trail-2 .sp-mega-text > ul.menu_items { column-count: 3; }

.sp-mega-lead-1.sp-mega-trail-1 .sp-mega-text > ul.menu_items { column-count: 3; }
.sp-mega-lead-2.sp-mega-trail-1 .sp-mega-text > ul.menu_items { column-count: 2; }
.sp-mega-lead-1.sp-mega-trail-2 .sp-mega-text > ul.menu_items { column-count: 2; }


/* =============================================
   DYNAMIC SIZING — based on text item count
   sm (<10 items), md (10-25), lg (>25)
   ============================================= */

/* Small: few text items — shorter menu, images get more space */
.sp-mega-size-sm .sp-mega-text > ul.menu_items {
  height: clamp(180px, 25vh, 300px);
  column-count: 2;
}
.sp-mega-size-sm .sp-mega-image-card { max-width: 440px; }
.sp-mega-size-sm .sp-mega-text { min-width: 200px; }

/* Medium: default */
.sp-mega-size-md .sp-mega-text > ul.menu_items {
  height: clamp(300px, 40vh, 450px);
}
.sp-mega-size-md .sp-mega-image-card { max-width: 360px; }

/* Large: many text items — taller menu, images stay contained */
.sp-mega-size-lg .sp-mega-text > ul.menu_items {
  height: clamp(380px, 50vh, 600px);
}
.sp-mega-size-lg .sp-mega-image-card { max-width: 320px; }

.sp-mega-text > ul.menu_items > li {
  width: 100%;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
  break-inside: avoid-column;
  list-style-type: none;
  display: block;
  margin-bottom: 0;
}


/* =============================================
   LEVEL 2: TEXT CATEGORIES
   ============================================= */

.sp-mega-text > ul.menu_items > li {
  padding: 8px 24px 0 24px;
}

.sp-mega-text > ul.menu_items > li > a {
  color: #000;
  display: block;
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0 0 6px 0;
  text-transform: uppercase;
  text-decoration: none;
}

.sp-mega-text > ul.menu_items > li > a:hover {
  color: #000;
  text-decoration: none;
}


/* =============================================
   TEXT-GROUP (standalone links rendered outside ul)
   ============================================= */

.sp-mega-text-link a {
  color: #000;
  display: block;
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 0;
  text-transform: uppercase;
  text-decoration: none;
}

.sp-mega-text-link a:hover {
  color: #000;
  text-decoration: none;
}


/* =============================================
   LEVEL 3: SUB-LINKS
   ============================================= */

.sp-mega-text > ul.menu_items > li ul {
  list-style-type: none;
  margin: 0 0 16px 0;
  padding: 0;
}

.sp-mega-text > ul.menu_items > li ul li { float: none; }

.sp-mega-text > ul.menu_items > li ul li a {
  text-transform: uppercase;
  display: block;
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: 3px 0;
  color: #222;
  text-decoration: none;
}

.sp-mega-text > ul.menu_items > li ul li a:hover {
  color: #000;
  text-decoration: underline;
}

.sp-mega-text > ul.menu_items > li ul ul { display: none !important; }


/* =============================================
   LEGACY CLASSES
   ============================================= */

.menuzord_list_image, .menuzord_list_image_container, .menuzord_list_image_name,
.menuzord_list_icon, .menuzord_list_icon_container, .menuzord_list_icon_name {
  display: none;
}


/* SHOW/HIDE BUTTON
======================================*/
.menuzord .showhide {
  position: absolute; z-index: 1; top: 0; right: -100%; width: 50px; padding: 0;
  display: none; float: right; text-decoration: none; outline: none; text-align: right;
  -webkit-tap-highlight-color: transparent;
}
.menuzord .showhide .fas { line-height: 5.8rem; font-size: 2.0rem; color: red; margin: 0 10px; }

/* ICONS
======================================*/
.menuzord-menu > li > a > i {
  margin: 0 5px 0 0; font-size: 1.8rem; float: left; line-height: 2.0rem;
  font-family: 'Line Awesome Free'; font-weight: 900;
}

/* Active states */
.active1 > a, .activeparent1 > a { color: #000 !important; }
.active1 > a > span.over:before, .activeparent1 > a > span.over:before {
  content: ''; display: block; position: absolute; top: 100%; width: 100%;
  border-bottom: 1px solid #555; left: 0; right: 0;
}
.active2 > a, .activeparent2 > a { color: #000 !important; }
.active3 > a, .activeparent3 > a { color: #000 !important; }
.active4 > a, .activeparent4 > a { color: #000 !important; }
.active5 > a, .activeparent5 > a { color: #000 !important; }


/* =============================================
   MOBILE SIDEBAR
   ============================================= */

.col_categories_menu ul { list-style-type: none; }
.col_categories_menu {
  display: block; position: fixed; padding: 60px 10px 50px 10px; top: 0;
  left: calc(-100% + 20px); width: calc(100% - 20px); height: 100%;
  overflow: auto; -webkit-overflow-scrolling: touch; opacity: 0;
  transition: all 0.3s ease-in-out; z-index: 1301; background: #fff; margin: 0;
}
@media (min-width: 440px) {
  .col_categories_menu { width: 420px; padding: 60px 20px 50px 20px; left: -420px; }
}
.admin_mode .col_categories_menu { padding-top: 96px; }
.col_categories_menu.active { opacity: 1; left: 0; }
.toggle_overlay_menu {
  display: none; position: fixed; top: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.2); width: 100%; height: 100%; z-index: 1300;
}
.toggle_closer_menu {
  cursor: pointer; width: 32px; height: 32px; background: none;
  position: absolute; top: 14px; right: 20px;
  font-size: 0; line-height: 0; overflow: hidden;
}
.toggle_closer_menu * { display: none !important; }
.toggle_closer_menu::before,
.toggle_closer_menu::after {
  content: '';
  display: block;
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 1px;
  background: #000;
}
.toggle_closer_menu::before { transform: translate(-50%, -50%) rotate(45deg); }
.toggle_closer_menu::after { transform: translate(-50%, -50%) rotate(-45deg); }
.admin_mode .toggle_closer_menu { top: 46px; }


/* DESKTOP
======================================*/
@media (min-width: 1161px) {
  .col_categories_menu {
    vertical-align: top; background: transparent; display: inline-block; position: static;
    padding: 0; width: auto; height: auto; opacity: 1; transition: none;
    box-shadow: none; margin-top: -10px; margin-bottom: -10px;
  }
  .admin_mode .col_categories_menu { padding: 0; }
  .toggle_closer_menu { display: none; }
  .toggle_overlay_menu { display: none !important; }
  .sp-mega-mob-menu { display: none; }
}


/* =============================================
   RESPONSIVE (<= 1160px)
   ============================================= */

@media (max-width: 1160px) {
  .menuzord-menu { display: block !important; }
  .menuzord-responsive .showhide { display: none !important; }
  .menuzord-responsive .menuzord-menu { width: 100%; float: left !important; }
  .menuzord-responsive .menuzord-menu.scrollable { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .menuzord-responsive .menuzord-menu.scrollable > .scrollable-fix { display: block; }

  /* Level-1 items — clean, no borders */
  .menuzord-responsive .menuzord-menu > li { width: 100%; display: block; position: relative; }
  .menuzord-responsive .menuzord-menu > li > a {
    text-align: left; width: 100%; padding: 13px 10px; display: block;
    font-size: 1.3rem; font-weight: 500; letter-spacing: 0.02em;
    border-bottom: none; color: #000; text-decoration: none;
  }
  .menuzord-responsive .menuzord-menu > li:first-child > a { border-top: none; }

  /* Chevron indicators — thin CSS arrows */
  .menuzord-menu li .indicator {
    margin-left: 0; display: inline-flex;
    align-items: center; justify-content: center;
    width: 44px; height: 44px; position: absolute; right: 0; top: 0;
    border-left: none;
  }
  .menuzord-menu li .indicator::after {
    content: '';
    display: block;
    width: 6px; height: 6px;
    border-right: 1.5px solid #000;
    border-bottom: 1.5px solid #000;
    transform: rotate(45deg);
    margin-top: -2px;
  }

  /* Megamenu container on mobile */
  .menuzord-responsive .menuzord-menu > li > .megamenu {
    width: 100% !important; padding: 0; left: 0 !important; position: static; border-top: none;
  }
  .menuzord-responsive .menuzord-menu > li > .megamenu .megamenu-row {
    float: none; display: block; width: 100% !important; margin: 0; border: none; padding: 0;
  }

  /* Hide desktop megamenu structure on mobile */
  .sp-mega-content { display: none; }

  /* Show mobile tab menu */
  .sp-mega-mob-menu { display: block; }


  /* =============================================
     MOBILE: TAB-BASED NAVIGATION
     ============================================= */

  .sp-mega-mob-tabs {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    padding: 0 20px 0 10px;
    margin: 0;
    border-bottom: 1px solid #eee;
    scrollbar-width: none;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
    mask-image: linear-gradient(to right, #000 85%, transparent 100%);
  }
  .sp-mega-mob-tabs::-webkit-scrollbar { display: none; }

  .sp-mega-mob-tabs a {
    flex-shrink: 0;
    display: block;
    padding: 8px 14px 9px 0;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    color: #bbb;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
  }
  .sp-mega-mob-tabs a.active {
    color: #000;
    font-weight: 500;
    border-bottom-color: #000;
  }

  .sp-mega-mob-panel {
    display: none;
    padding: 6px 12px 4px 12px;
  }
  .sp-mega-mob-panel.active { display: block; }

  .sp-mega-mob-panel a.sp-mega-mob-all {
    display: block;
    padding: 8px 0 8px 0;
    margin-bottom: 2px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    border-bottom: 1px solid #f0f0f0;
  }

  .sp-mega-mob-panel a {
    display: block;
    padding: 1px 0;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-transform: none;
    text-decoration: none;
    color: #333;
  }
  .sp-mega-mob-panel a:hover,
  .sp-mega-mob-panel a:active { color: #000; }


  /* =============================================
     MOBILE: IMAGE CARDS AT BOTTOM
     ============================================= */

  .sp-mega-mob-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    padding: 12px 0 0 0;
  }

  .sp-mega-mob-images.sp-mega-mob-img-count-1 {
    grid-template-columns: 1fr;
  }

  .sp-mega-mob-images.sp-mega-mob-img-count-3 .sp-mega-mob-img-card:first-child {
    grid-column: 1 / -1;
  }

  .sp-mega-mob-img-card {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
  }

  .sp-mega-mob-img-card img {
    display: block;
    width: 100%;
    height: auto;
  }

  .sp-mega-mob-img-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px 10px 8px 10px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(0deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 100%);
  }
}
