/* 3D dock — labels never overwrite icons */

.ios-tabbar {
  display: none;
}

@media (max-width: 768px) {
  body.has-ios-tabbar {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.has-ios-tabbar .footer {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    margin-bottom: 0;
  }

  .ios-tabbar {
    display: flex;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 1200;
    align-items: flex-end;
    justify-content: space-around;
    gap: 0.2rem;
    padding: 0.4rem 0.35rem 0.35rem;
    min-height: 60px;
    border-radius: 22px;
    border: 1.5px solid rgba(253, 186, 116, 0.55);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 237, 0.94));
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    box-shadow:
      0 12px 28px rgba(234, 88, 12, 0.16),
      0 4px 0 rgba(251, 146, 60, 0.35),
      0 1px 0 #fff inset;
    overflow: visible;
  }

  .ios-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
    min-height: 52px;
    max-width: 33%;
    padding: 0.2rem 0.1rem 0.15rem;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: #78716c;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    overflow: visible;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    transform: none !important;
  }

  .ios-tab-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1rem;
    line-height: 1;
    border-radius: 11px;
    background: linear-gradient(160deg, #fff, #ffedd5);
    box-shadow: 0 3px 0 #fdba74, 0 1px 0 #fff inset;
    transition: transform 0.2s cubic-bezier(0.22, 0.9, 0.28, 1.15), box-shadow 0.2s ease, background 0.2s ease;
  }

  .ios-tab-label {
    display: block;
    width: 100%;
    max-width: 72px;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
  }

  .ios-tab:active .ios-tab-icon {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #fdba74;
  }

  .ios-tab.is-active {
    color: #c2410c;
    background: transparent;
    box-shadow: none;
  }

  .ios-tab.is-active .ios-tab-icon {
    background: linear-gradient(160deg, #fb923c, #ea580c);
    color: #fff;
    box-shadow: 0 4px 0 #c2410c, 0 8px 14px rgba(234, 88, 12, 0.3);
    transform: translateY(-2px) scale(1.06);
  }

  .ios-tab.is-active .ios-tab-label {
    color: #c2410c;
  }

  .ios-tab-profile.is-active {
    color: #0e7490;
  }

  .ios-tab-profile.is-active .ios-tab-icon {
    background: linear-gradient(160deg, #2dd4bf, #0d9488);
    box-shadow: 0 4px 0 #0f766e, 0 8px 14px rgba(13, 148, 136, 0.3);
  }

  .ios-tab-profile.is-active .ios-tab-label {
    color: #0f766e;
  }

  body.has-ios-tabbar .nav-login-btn,
  body.has-ios-tabbar .nav-login-mobile,
  body.has-ios-tabbar.book-page .nav-actions > a[href='/account.html'] {
    display: none !important;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .ios-tab-icon {
    transition: none;
  }
  .ios-tab.is-active .ios-tab-icon {
    transform: none;
  }
}
