/* ─────────────────────────────────────────────────────────────
   Apple Bottom Nav – Stylesheet v1.3
   ───────────────────────────────────────────────────────────── */

.apple-bottom-nav *,
.apple-bottom-nav *::before,
.apple-bottom-nav *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Bar ────────────────────────────────────────────────────── */
.apple-bottom-nav {
  width: 100%;
  background-color: rgba(28, 28, 30, 0.85);
  border-top: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px 20px 0 0;
  padding-top: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  padding-left: 4px;
  padding-right: 4px;
  z-index: 9999;
  overflow: visible; /* allow search overlay to extend above */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Position variants */
.apple-bottom-nav[data-position="fixed"] {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}
.apple-bottom-nav[data-position="sticky"] {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
}
.apple-bottom-nav[data-position="relative"] {
  position: relative;
}

/* Frosted glass */
.apple-bottom-nav.has-blur {
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}

/* ── Popup backdrop ─────────────────────────────────────────── */
.apple-nav-popup-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.apple-nav-popup-backdrop.is-visible {
  display: block;
  opacity: 1;
}

/* ── Popup target element default behaviour ─────────────────── */
/* Users style their own popup, but we provide a sensible default
   so .is-open is sufficient to make it appear */
[data-apple-nav-popup] {
  display: none;
}
[data-apple-nav-popup].is-open {
  display: block;
}

/* ── Search overlay ─────────────────────────────────────────── */
.apple-nav-search-overlay {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  padding: 10px 16px 12px;
  background: rgba(28, 28, 30, 0.95);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px 20px 0 0;
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.22s ease;
  z-index: 1;
}
.apple-nav-search-overlay.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.apple-nav-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(118, 118, 128, 0.2);
  border-radius: 12px;
  padding: 6px 12px;
}

.apple-nav-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  caret-color: #fc3c44;
  min-width: 0;
}
.apple-nav-search-input::placeholder { color: rgba(235, 235, 245, 0.45); }
.apple-nav-search-input::-webkit-search-cancel-button { display: none; }

.apple-nav-search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(235, 235, 245, 0.5);
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.15s ease;
}
.apple-nav-search-close:hover { color: #fff; }

/* ── List ───────────────────────────────────────────────────── */
.apple-nav-list {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  list-style: none;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0;
  gap: 0;
}

/* ── Item ───────────────────────────────────────────────────── */
.apple-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.apple-nav-item .nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 6px 2px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  width: 100%;
  border-radius: 12px;
  background-color: transparent;
  transition: background-color 0.22s ease;
  position: relative;
  overflow: hidden;
}

/* ── Active background ──────────────────────────────────────── */
.apple-nav-item.is-active .nav-link {
  background-color: rgba(252, 60, 68, 0.12);
}

/* ── Icon ───────────────────────────────────────────────────── */
.apple-nav-item .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(235, 235, 245, 0.4);
  transition: color 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 1;
  will-change: transform;
}
.apple-nav-item .nav-icon i   { font-size: 24px; display: block; line-height: 1; }
.apple-nav-item .nav-icon svg { width: 24px; height: 24px; fill: currentColor; }

/* ── Label ──────────────────────────────────────────────────── */
.apple-nav-item .nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(235, 235, 245, 0.4);
  transition: color 0.22s ease;
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
  text-align: center;
  line-height: 1.2;
}

/* ── Active state ───────────────────────────────────────────── */
.apple-nav-item.is-active .nav-icon     { color: #fc3c44; transform: scale(1.08); }
.apple-nav-item.is-active .nav-icon svg { fill:  #fc3c44; }
.apple-nav-item.is-active .nav-label    { color: #fc3c44; }

/* ── Tap animation ──────────────────────────────────────────── */
.apple-bottom-nav.has-animation .apple-nav-item .nav-icon {
  transition: color 0.22s ease,
              transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.15s ease;
}
.apple-bottom-nav.has-animation .apple-nav-item.is-tapped .nav-icon {
  transform: scale(0.78); opacity: 0.6;
}
.apple-bottom-nav.has-animation .apple-nav-item.is-active.is-tapped .nav-icon {
  transform: scale(0.82);
}

@keyframes iconBounceIn {
  0%   { transform: scale(0.72); }
  55%  { transform: scale(1.18); }
  80%  { transform: scale(0.95); }
  100% { transform: scale(1.08); }
}
.apple-bottom-nav.has-animation .apple-nav-item.just-activated .nav-icon {
  animation: iconBounceIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── Ripple ─────────────────────────────────────────────────── */
@keyframes navRipple {
  to { transform: scale(3.5); opacity: 0; }
}
.nav-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  pointer-events: none;
  transform: scale(0);
  animation: navRipple 0.45s ease-out forwards;
}

/* ── Fit-content mode ───────────────────────────────────────── */
.apple-bottom-nav.is-fit-content {
  width: fit-content;
  width: -moz-fit-content;
  min-width: unset;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 20px;
}
.apple-bottom-nav.is-fit-content[data-position="fixed"] {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
}
.apple-bottom-nav.is-fit-content[data-position="sticky"] {
  left: 50%;
  transform: translateX(-50%);
}
.apple-bottom-nav.is-fit-content .apple-nav-list {
  width: auto;
  max-width: none;
  justify-content: flex-start;
}
.apple-bottom-nav.is-fit-content .apple-nav-item {
  flex: 0 0 auto;
}

/* ── Elementor editor: override fixed/sticky ────────────────── */
.elementor-editor-active .apple-bottom-nav[data-position="fixed"],
.elementor-editor-active .apple-bottom-nav[data-position="sticky"] {
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 360px) {
  .apple-nav-item .nav-label    { font-size: 9px; max-width: 56px; }
  .apple-nav-item .nav-icon i   { font-size: 21px; }
}
