/* =========================================
   CandyCloud — Mobile Footer Navigation
   Modern Bottom Navigation Bar
   
   NOTE: This CSS uses !important flags to ensure
   it overrides all other theme/plugin styles.
   ========================================= */

/* Hide on desktop */
.cc-mnav {
  display: none;
}

@media (max-width: 768px) {
  
  /* =========================================
     Navigation Container
     ========================================= */
  .cc-mnav {
    display: block !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 99999 !important;
    width: 100% !important;
    pointer-events: none !important;
  }

  /* =========================================
     Navigation List
     ========================================= */
  .cc-mnav__list {
    margin: 0 !important;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    list-style: none !important;
    
    display: flex !important;
    align-items: stretch !important;
    justify-content: space-around !important;
    
    background: rgba(11, 11, 16, 0.98) !important;
    border-top: 1px solid rgba(242, 244, 255, 0.1) !important;
    
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4) !important;
    
    pointer-events: auto !important;
  }

  /* =========================================
     List Items
     ========================================= */
  .cc-mnav__list > li {
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
  }

  /* =========================================
     Navigation Links
     ========================================= */
  .cc-mnav__list > li > a {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    
    width: 100% !important;
    min-height: 60px !important;
    padding: 6px 8px !important;
    
    text-decoration: none !important;
    color: rgba(198, 201, 227, 0.7) !important;
    
    font-size: 10px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.3px !important;
    text-transform: uppercase !important;
    text-align: center !important;
    
    border-radius: 12px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
    user-select: none !important;
    
    position: relative !important;
  }


  /* =========================================
     Icons (::before pseudo-element)
     ========================================= */
  .cc-mnav__list > li > a::before {
    content: "" !important;
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: 24px 24px !important;
    opacity: 0.7 !important;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    order: -1 !important;
    margin: 0 auto 4px auto !important;
    visibility: visible !important;
    position: static !important;
    z-index: 1 !important;
    transform: none !important;
    align-self: center !important;
  }

  /* Text wrapper for proper separation */
  .cc-mnav__list > li > a > .cc-mnav__text,
  .cc-mnav__list > li > a > span {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    line-height: 1.2 !important;
    order: 1 !important;
    position: relative !important;
    z-index: 0 !important;
  }


  /* Support for actual SVG/icon elements */
  .cc-mnav__list > li > a svg,
  .cc-mnav__list > li > a img,
  .cc-mnav__list > li > a .icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    flex-shrink: 0;
    display: block;
    fill: currentColor;
    stroke: currentColor;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
    order: -1;
    margin-bottom: 2px;
  }

  /* =========================================
     Hover State
     ========================================= */
  .cc-mnav__list > li > a:hover {
    color: #F2F4FF !important;
    background: rgba(255, 255, 255, 0.05) !important;
  }

  .cc-mnav__list > li > a:hover::before,
  .cc-mnav__list > li > a:hover svg {
    opacity: 1 !important;
    transform: scale(1.05) !important;
    visibility: visible !important;
    display: block !important;
  }

  /* =========================================
     Active / Current Page State
     ========================================= */
  .cc-mnav__list > li.current-menu-item > a,
  .cc-mnav__list > li.current_page_item > a,
  .cc-mnav__list > li > a[aria-current="page"],
  .cc-mnav__list > li.current > a {
    color: #FF2F92 !important;
    font-weight: 600 !important;
    background: rgba(255, 47, 146, 0.12) !important;
  }

  .cc-mnav__list > li.current-menu-item > a::before,
  .cc-mnav__list > li.current_page_item > a::before,
  .cc-mnav__list > li > a[aria-current="page"]::before,
  .cc-mnav__list > li.current > a::before,
  .cc-mnav__list > li.current-menu-item > a svg,
  .cc-mnav__list > li.current_page_item > a svg {
    opacity: 1 !important;
    transform: scale(1.1) !important;
    visibility: visible !important;
    display: block !important;
  }

  /* =========================================
     Focus State
     ========================================= */
  .cc-mnav__list > li > a:focus-visible {
    outline: none;
    color: #F2F4FF;
    background: rgba(255, 47, 146, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 47, 146, 0.4) inset;
  }

  /* =========================================
     Active/Tap State
     ========================================= */
  .cc-mnav__list > li > a:active {
    opacity: 0.8;
    transform: scale(0.95);
    transition-duration: 0.1s;
  }

  /* =========================================
     Body Padding (prevent content from hiding)
     ========================================= */
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  /* =========================================
     Icon Definitions (SVG via CSS)
     ========================================= */

  /* HOME Icon - Default for first item if no class */
  .cc-mnav__list > li:first-child > a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23C6C9E3' d='M12 3L2 12h3v9h6v-6h2v6h6v-9h3L12 3z'/%3E%3C/svg%3E") !important;
    opacity: 0.7 !important;
    visibility: visible !important;
    display: block !important;
  }

  /* HOME Icon - With class */
  .cc-nav-home > a::before,
  .cc-mnav__list > li.cc-nav-home > a::before,
  .cc-mnav__list > li.menu-item.cc-nav-home > a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23C6C9E3' d='M12 3L2 12h3v9h6v-6h2v6h6v-9h3L12 3z'/%3E%3C/svg%3E") !important;
    opacity: 0.7 !important;
    visibility: visible !important;
    display: block !important;
  }

  .cc-nav-home.current-menu-item > a::before,
  .cc-nav-home.current_page_item > a::before,
  .cc-mnav__list > li:first-child.current-menu-item > a::before,
  .cc-mnav__list > li:first-child.current_page_item > a::before,
  .cc-mnav__list > li.cc-nav-home.current-menu-item > a::before,
  .cc-mnav__list > li.cc-nav-home.current_page_item > a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FF2F92' d='M12 3L2 12h3v9h6v-6h2v6h6v-9h3L12 3z'/%3E%3C/svg%3E") !important;
    opacity: 1 !important;
  }

  /* SHOP Icon */
  .cc-nav-shop > a::before,
  .cc-mnav__list > li.cc-nav-shop > a::before,
  .cc-mnav__list > li.menu-item.cc-nav-shop > a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23C6C9E3' d='M4 7l2-3h12l2 3v2H4V7zm1 4h14v10H5V11zm4 2v6h2v-6H9zm4 0v6h2v-6h-2z'/%3E%3C/svg%3E") !important;
    opacity: 0.7 !important;
    visibility: visible !important;
    display: block !important;
  }

  .cc-nav-shop.current-menu-item > a::before,
  .cc-nav-shop.current_page_item > a::before,
  .cc-mnav__list > li.cc-nav-shop.current-menu-item > a::before,
  .cc-mnav__list > li.cc-nav-shop.current_page_item > a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FF2F92' d='M4 7l2-3h12l2 3v2H4V7zm1 4h14v10H5V11zm4 2v6h2v-6H9zm4 0v6h2v-6h-2z'/%3E%3C/svg%3E") !important;
    opacity: 1 !important;
  }

  /* CART Icon */
  .cc-nav-cart > a::before,
  .cc-mnav__list > li.cc-nav-cart > a::before,
  .cc-mnav__list > li.menu-item.cc-nav-cart > a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23C6C9E3' d='M7 18a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm10 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM6.2 6l.4 2h12.9l-1.2 6.2a2 2 0 0 1-2 1.6H9a2 2 0 0 1-2-1.6L5 2H2V0h4l.6 3H22v2H6.2z'/%3E%3C/svg%3E") !important;
    opacity: 0.7 !important;
    visibility: visible !important;
    display: block !important;
  }

  .cc-nav-cart.current-menu-item > a::before,
  .cc-nav-cart.current_page_item > a::before,
  .cc-mnav__list > li.cc-nav-cart.current-menu-item > a::before,
  .cc-mnav__list > li.cc-nav-cart.current_page_item > a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FF2F92' d='M7 18a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm10 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM6.2 6l.4 2h12.9l-1.2 6.2a2 2 0 0 1-2 1.6H9a2 2 0 0 1-2-1.6L5 2H2V0h4l.6 3H22v2H6.2z'/%3E%3C/svg%3E") !important;
    opacity: 1 !important;
  }

  /* ACCOUNT Icon */
  .cc-nav-account > a::before,
  .cc-mnav__list > li.cc-nav-account > a::before,
  .cc-mnav__list > li.menu-item.cc-nav-account > a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23C6C9E3' d='M12 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0 2c5 0 9 2.2 9 5v3H3v-3c0-2.8 4-5 9-5z'/%3E%3C/svg%3E") !important;
    opacity: 0.7 !important;
    visibility: visible !important;
    display: block !important;
  }

  .cc-nav-account.current-menu-item > a::before,
  .cc-nav-account.current_page_item > a::before,
  .cc-mnav__list > li.cc-nav-account.current-menu-item > a::before,
  .cc-mnav__list > li.cc-nav-account.current_page_item > a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FF2F92' d='M12 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0 2c5 0 9 2.2 9 5v3H3v-3c0-2.8 4-5 9-5z'/%3E%3C/svg%3E") !important;
    opacity: 1 !important;
  }

  /* =========================================
     Badge/Notification Support
     ========================================= */
  .cc-mnav__list > li > a .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #FF2F92;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  /* Cart Text Update Animation */
  .cc-mnav-cart-text.cc-cart-updated {
    animation: cartTextUpdate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
  }

  @keyframes cartTextUpdate {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.1);
      color: var(--accent-primary, #FF2F92);
    }
    100% {
      transform: scale(1);
    }
  }

  /* =========================================
     Landscape Orientation Adjustments
     ========================================= */
  @media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
    .cc-mnav__list {
      padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
    }

    .cc-mnav__list > li > a {
      min-height: 50px;
      padding: 4px 6px;
      font-size: 9px;
      gap: 2px;
    }

    .cc-mnav__list > li > a::before {
      width: 20px;
      height: 20px;
      background-size: 20px 20px;
    }

    body {
      padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    }
  }

  /* =========================================
     Reduced Motion Support
     ========================================= */
  @media (prefers-reduced-motion: reduce) {
    .cc-mnav__list > li > a,
    .cc-mnav__list > li > a::before,
    .cc-mnav__list > li > a svg {
      transition: none;
    }

    .cc-mnav__list > li > a:active {
      transform: none;
    }
  }

  /* =========================================
     High Contrast Mode
     ========================================= */
  @media (prefers-contrast: high) {
    .cc-mnav__list {
      border-top-width: 2px;
      background: rgba(11, 11, 16, 1);
    }

    .cc-mnav__list > li.current-menu-item > a,
    .cc-mnav__list > li.current_page_item > a {
      background: rgba(255, 47, 146, 0.2);
      border: 1px solid #FF2F92;
    }
  }
}
