/* ─────────────────────────────────────────────────────────────
   TND Mobile Bottom Nav – Stylesheet
   ───────────────────────────────────────────────────────────── */

:root {
    --tnd-nav-bg:        #ffffff;
    --tnd-nav-active:    #000000;
    --tnd-nav-text:      #888888;
    --tnd-nav-icon:      #888888;
    --tnd-nav-border:    #e5e5e5;
    --tnd-nav-hide-desk: flex;
    --tnd-nav-height:    64px;
    --tnd-safe-area:     env(safe-area-inset-bottom, 0px);
}

/* ── Spacer so page content isn't hidden behind the bar ── */
body {
    padding-bottom: calc(var(--tnd-nav-height) + var(--tnd-safe-area)) !important;
}

/* ── Nav Wrapper ── */
#tnd-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--tnd-nav-bg);
    border-top: 1px solid var(--tnd-nav-border);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, .06);
    height: calc(var(--tnd-nav-height) + var(--tnd-safe-area));
    padding-bottom: var(--tnd-safe-area);
    display: flex;
    align-items: stretch;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Desktop hide */
@media (min-width: 769px) {
    #tnd-mobile-nav {
        display: var(--tnd-nav-hide-desk) !important;
    }
    body {
        padding-bottom: 0 !important;
    }
}

/* ── List ── */
#tnd-mobile-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    align-items: stretch;
}

#tnd-mobile-nav ul li {
    flex: 1;
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
}

/* ── Nav Item (anchor + button) ── */
.tnd-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 4px;
    color: var(--tnd-nav-icon);
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .3px;
    line-height: 1;
    transition: color .18s ease, transform .15s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    width: 100%;
}

.tnd-nav-item svg {
    width: 22px;
    height: 22px;
    display: block;
    transition: transform .18s ease;
    stroke: currentColor;
}

.tnd-nav-label {
    color: var(--tnd-nav-text);
    font-size: 10px;
    transition: color .18s ease;
}

/* ── Active State ── */
.tnd-nav-item.active,
.tnd-nav-item.active .tnd-nav-label {
    color: var(--tnd-nav-active);
}

.tnd-nav-item.active svg {
    stroke: var(--tnd-nav-active);
}

/* Active indicator dot */
.tnd-nav-item.active::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--tnd-nav-active);
    opacity: 0;
    animation: tndDotIn .25s ease forwards;
}

@keyframes tndDotIn {
    from { opacity: 0; transform: translateX(-50%) scale(0); }
    to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ── Tap Feedback ── */
.tnd-nav-item:active {
    transform: scale(.88);
}

.tnd-nav-item:active svg {
    transform: scale(.9);
}

/* ── Cart Badge ── */
.tnd-cart-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: var(--tnd-nav-active);
    color: var(--tnd-nav-bg);
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
    transition: transform .2s cubic-bezier(.175, .885, .32, 1.275);
}

.tnd-cart-badge[data-count="0"],
.tnd-cart-badge:empty {
    display: none;
}

.tnd-cart-badge.bump {
    animation: tndBump .3s cubic-bezier(.175, .885, .32, 1.275);
}

@keyframes tndBump {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.45); }
    100% { transform: scale(1); }
}


