/* Pulsante navbar — Strumenti smart (dropdown) */

.smart-tools-nav-anchor {
  position: relative;
  display: none;
}

.smart-tools-nav-anchor[hidden] {
  display: none !important;
}

html.spisa-profile-ready .smart-tools-nav-anchor {
  display: inline-flex;
}

.smart-tools-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.smart-tools-nav-btn i {
  font-size: 1.05rem;
  color: #00d2ff;
  transition: transform 0.2s ease, color 0.2s ease;
}

html.light .smart-tools-nav-btn i,
[data-theme='light'] .smart-tools-nav-btn i {
  color: #0369a1;
}

.smart-tools-nav-btn.active {
  background: rgba(0, 210, 255, 0.14);
  border-radius: 9999px;
}

html.light .smart-tools-nav-btn.active,
[data-theme='light'] .smart-tools-nav-btn.active {
  background: rgba(0, 210, 255, 0.18);
}

.smart-tools-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.smart-tools-nav-btn:hover i {
  transform: scale(1.06);
}

html.light .smart-tools-nav-btn:hover,
[data-theme='light'] .smart-tools-nav-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

/* ── Popover ─────────────────────────────────────────────────────────── */

.smart-tools-nav__popover.profile-menu__popover--portal {
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: min(18.5rem, calc(100vw - 1.5rem));
}

.smart-tools-nav__popover {
  transform-origin: top right;
  transition: opacity 0.18s cubic-bezier(0.22, 1, 0.36, 1), transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

.smart-tools-nav__popover:not(.profile-menu__popover--open) {
  opacity: 0;
  transform: translate3d(0, -6px, 0) scale3d(0.97, 0.97, 1);
  pointer-events: none;
  visibility: hidden;
}

.smart-tools-nav__popover.profile-menu__popover--open {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  pointer-events: auto;
  visibility: visible;
}

.smart-tools-nav__caret.profile-menu__caret {
  right: 0.95rem;
}

/* ── Pannello ────────────────────────────────────────────────────────── */

.smart-tools-nav__panel {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 1.1rem;
  border: 1px solid rgba(0, 210, 255, 0.18);
  background: linear-gradient(165deg, #0f172a 0%, #111827 55%, #0b1120 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 18px 42px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(0, 210, 255, 0.1);
}

html.light .smart-tools-nav__panel,
[data-theme='light'] .smart-tools-nav__panel {
  border-color: rgba(0, 210, 255, 0.22);
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 52%, #f1f5f9 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9) inset,
    0 18px 40px rgba(15, 23, 42, 0.12),
    0 0 24px rgba(0, 210, 255, 0.08);
}

.smart-tools-nav__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.12), rgba(249, 115, 22, 0.08));
}

html.light .smart-tools-nav__head,
[data-theme='light'] .smart-tools-nav__head {
  border-bottom-color: rgba(15, 23, 42, 0.06);
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.1), rgba(249, 115, 22, 0.06));
}

.smart-tools-nav__head-badge {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  flex-shrink: 0;
  border-radius: 0.7rem;
  color: #00d2ff;
  background: rgba(0, 210, 255, 0.14);
  border: 1px solid rgba(0, 210, 255, 0.28);
  font-size: 0.95rem;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.2);
}

.smart-tools-nav__head-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

html.light .smart-tools-nav__head-title,
[data-theme='light'] .smart-tools-nav__head-title {
  color: #0f172a;
}

.smart-tools-nav__head-sub {
  margin: 0.12rem 0 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
}

html.light .smart-tools-nav__head-sub,
[data-theme='light'] .smart-tools-nav__head-sub {
  color: #64748b;
}

/* ── Lista card ──────────────────────────────────────────────────────── */

.smart-tools-nav__list {
  list-style: none;
  margin: 0;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.smart-tools-nav__item {
  margin: 0;
}

.smart-tools-nav__card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.62rem 0.65rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.smart-tools-nav__card:hover {
  background: rgba(0, 210, 255, 0.08);
  border-color: rgba(0, 210, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 210, 255, 0.1);
}

html.light .smart-tools-nav__card,
[data-theme='light'] .smart-tools-nav__card {
  background: rgba(255, 255, 255, 0.72);
}

html.light .smart-tools-nav__card:hover,
[data-theme='light'] .smart-tools-nav__card:hover {
  background: #fff;
  border-color: rgba(0, 210, 255, 0.28);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.smart-tools-nav__card.is-active {
  background: rgba(0, 210, 255, 0.12);
  border-color: rgba(0, 210, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 210, 255, 0.15) inset;
}

.smart-tools-nav__card-icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  border-radius: 0.72rem;
  font-size: 0.95rem;
}

.smart-tools-nav__card-icon--list {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.28);
}

.smart-tools-nav__card-icon--planner {
  color: #fb923c;
  background: rgba(249, 115, 22, 0.14);
  border: 1px solid rgba(249, 115, 22, 0.28);
}

.smart-tools-nav__card-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 auto;
}

.smart-tools-nav__card-title {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #f1f5f9;
}

html.light .smart-tools-nav__card-title,
[data-theme='light'] .smart-tools-nav__card-title {
  color: #0f172a;
}

.smart-tools-nav__card-desc {
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  color: #94a3b8;
}

html.light .smart-tools-nav__card-desc,
[data-theme='light'] .smart-tools-nav__card-desc {
  color: #64748b;
}

.smart-tools-nav__card-arrow {
  flex-shrink: 0;
  font-size: 0.62rem;
  color: #64748b;
  opacity: 0.55;
  transition: transform 0.16s ease, opacity 0.16s ease, color 0.16s ease;
}

.smart-tools-nav__card:hover .smart-tools-nav__card-arrow {
  opacity: 1;
  color: #00d2ff;
  transform: translateX(2px);
}

/* ── Navbar sticky / native ──────────────────────────────────────────── */

nav.sticky .smart-tools-nav-btn {
  padding: 0.625rem;
  border-radius: 9999px;
  color: #00d2ff;
}

html.spisa-profile-ready nav.sticky .smart-tools-nav-btn {
  display: inline-flex;
}

#smart-cart-nav-btn,
#meal-planner-nav-btn {
  display: none !important;
}

html.spisa-native-app.spisa-profile-ready body.page-app .smart-tools-nav-anchor,
html.spisa-native-app.spisa-profile-ready body.page-home-index .smart-tools-nav-anchor,
html.spisa-native-app.spisa-profile-ready body.page-city-home .smart-tools-nav-anchor,
html.spisa-native-app.spisa-profile-ready body.page-search .smart-tools-nav-anchor {
  display: inline-flex !important;
}

html.spisa-native-app .smart-tools-nav__panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
