/**
 * Heritage Harvests - Mobile Bottom Navigation
 * Fixed bottom nav bar (mobile only ≤768px)
 */

/* ===== Override Hello Elementor reset.css pink (#c36) on buttons ===== */
.hh-bottom-nav button,
.hh-bottom-nav button:hover,
.hh-bottom-nav button:focus,
.hh-bottom-nav button:active,
.hh-bottom-nav [type=button],
.hh-bottom-nav [type=button]:hover,
.hh-bottom-nav [type=button]:focus,
.hh-bottom-nav [type=button]:active,
.hh-bottom-categories-panel button,
.hh-bottom-categories-panel button:hover,
.hh-bottom-categories-panel button:focus,
.hh-bottom-categories-panel button:active,
.hh-bottom-cart-panel button,
.hh-bottom-cart-panel button:hover,
.hh-bottom-cart-panel button:focus,
.hh-bottom-cart-panel button:active {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    box-shadow: none !important;
    outline: none !important;
}

/* ===== Bottom Nav Container ===== */
.hh-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    font-family: 'Outfit', sans-serif;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Only show on mobile */
@media (max-width: 768px) {
    .hh-bottom-nav {
        display: block;
    }

    body {
        padding-bottom: 72px !important;
    }

    .hh-back-to-top {
        bottom: 85px !important;
    }
}

/* Hide on scroll down */
.hh-bottom-nav.hh-nav-hidden {
    transform: translateY(100%);
}

/* Glass background */
.hh-bottom-nav-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(46, 125, 50, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    padding: 0;
    height: 68px;
}

/* ===== Nav Items ===== */
.hh-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none !important;
    color: var(--hh-text-light, #5D6B5E) !important;
    font-size: 11px;
    font-weight: 500;
    gap: 4px;
    padding: 8px 4px !important;
    position: relative;
    transition: color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.hh-bottom-nav-item:hover,
.hh-bottom-nav-item:focus,
.hh-bottom-nav-item:active {
    color: var(--hh-text-light, #5D6B5E) !important;
    text-decoration: none !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Active state */
.hh-bottom-nav-item.is-active,
.hh-bottom-nav-item.is-active:hover,
.hh-bottom-nav-item.is-active:focus,
.hh-bottom-nav-item.is-active:active {
    color: var(--hh-primary, #2E7D32) !important;
    background: transparent !important;
    background-color: transparent !important;
}

.hh-bottom-nav-item.is-active .hh-bottom-nav-icon {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.1), rgba(139, 195, 74, 0.1)) !important;
    transform: scale(1.05);
}

/* Active indicator dot */
.hh-bottom-nav-item.is-active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--hh-primary, #2E7D32);
    border-radius: 50%;
    animation: hh-dot-in 0.3s ease;
}

@keyframes hh-dot-in {
    from {
        transform: translateX(-50%) scale(0);
    }

    to {
        transform: translateX(-50%) scale(1);
    }
}

/* ===== Icon Container ===== */
.hh-bottom-nav-icon {
    width: 40px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.25s ease;
    position: relative;
}

.hh-bottom-nav-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
    transition: all 0.25s ease;
}

/* Press animation */
.hh-bottom-nav-item:active .hh-bottom-nav-icon {
    transform: scale(0.9);
}

/* ===== Label ===== */
.hh-bottom-nav-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* ===== Cart Badge ===== */
.hh-bottom-nav-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #FF6B35, #E53935) !important;
    color: #fff !important;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    border-radius: 50px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px !important;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(229, 57, 53, 0.3);
    animation: hh-badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
    border: none !important;
}

.hh-bottom-nav-badge:empty,
.hh-bottom-nav-badge[data-count="0"] {
    display: none;
}

@keyframes hh-badge-pop {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== Panel Shared (categories + cart) ===== */
.hh-bottom-categories-panel,
.hh-bottom-cart-panel {
    position: fixed;
    bottom: 68px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(46, 125, 50, 0.08);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
    border-radius: 20px 20px 0 0;
    padding: 20px 16px 16px;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    max-height: 50vh;
    overflow-y: auto;
    pointer-events: none;
}

.hh-bottom-categories-panel.is-open,
.hh-bottom-cart-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.hh-bottom-categories-panel-header,
.hh-bottom-cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(46, 125, 50, 0.08);
}

.hh-bottom-categories-panel-header h3,
.hh-bottom-cart-panel-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--hh-text, #2D3A2E);
    margin: 0;
}

.hh-bottom-categories-close,
.hh-bottom-cart-close {
    width: 32px;
    height: 32px;
    border: none !important;
    background: rgba(46, 125, 50, 0.06) !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--hh-text-light, #5D6B5E) !important;
    transition: all 0.2s;
    padding: 0 !important;
}

.hh-bottom-categories-close:hover,
.hh-bottom-cart-close:hover {
    background: rgba(46, 125, 50, 0.12) !important;
    color: var(--hh-text, #2D3A2E) !important;
}

/* ===== Categories Grid ===== */
.hh-bottom-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.hh-bottom-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    background: rgba(46, 125, 50, 0.03);
    border-radius: 14px;
    text-decoration: none;
    color: var(--hh-text, #2D3A2E);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.hh-bottom-cat-item:hover {
    background: rgba(46, 125, 50, 0.08);
    border-color: rgba(46, 125, 50, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--hh-text, #2D3A2E);
}

.hh-bottom-cat-icon {
    font-size: 26px;
    line-height: 1;
}

.hh-bottom-cat-name {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

/* ===== Cart Panel ===== */
.hh-bottom-cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hh-cart-mini-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(46, 125, 50, 0.03);
    border-radius: 14px;
    text-decoration: none;
    color: var(--hh-text, #2D3A2E);
    transition: all 0.2s;
}

.hh-cart-mini-item:hover {
    background: rgba(46, 125, 50, 0.06);
    text-decoration: none;
    color: var(--hh-text, #2D3A2E);
}

.hh-cart-mini-img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(46, 125, 50, 0.08);
}

.hh-cart-mini-info {
    flex: 1;
    min-width: 0;
}

.hh-cart-mini-name {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--hh-text, #2D3A2E);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 3px;
}

.hh-cart-mini-meta {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    color: var(--hh-text-light, #5D6B5E);
    margin: 0;
}

.hh-cart-mini-price {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--hh-primary, #2E7D32);
    white-space: nowrap;
}

.hh-cart-mini-empty {
    text-align: center;
    padding: 24px 16px;
    font-family: 'Outfit', sans-serif;
    color: var(--hh-text-light, #5D6B5E);
}

.hh-cart-mini-empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.hh-cart-mini-empty p {
    font-size: 14px;
    margin: 0;
}

.hh-cart-mini-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(46, 125, 50, 0.08);
}

.hh-cart-mini-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-family: 'Outfit', sans-serif;
}

.hh-cart-mini-total-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--hh-text, #2D3A2E);
}

.hh-cart-mini-total-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--hh-primary, #2E7D32);
}

.hh-cart-mini-btn {
    display: block;
    width: 100%;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    background: linear-gradient(135deg, var(--hh-primary, #2E7D32), var(--hh-primary-dark, #1B5E20)) !important;
    padding: 14px 20px !important;
    border-radius: 50px !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.hh-cart-mini-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
    color: #fff !important;
    text-decoration: none !important;
}

/* ===== Overlay ===== */
.hh-bottom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9997;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.hh-bottom-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

/* ===== Safe area for notch devices ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .hh-bottom-nav-inner {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(68px + env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        body {
            padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important;
        }
    }
}