/* ===== TOP NAV ===== */
:root {
    --brand-pink: #FF4D8F;
    --brand-pink-hover: #e11d6a;
    --brand-pink-light: #FFE0EE;
    --brand-pink-soft: #FFF0F6;
    --brand-blue: #2563EB;
    --black: #0F0F0F;
    --gray-800: #27272A;
    --gray-600: #52525B;
    --gray-400: #A1A1AA;
    --gray-100: #F4F4F5;
    --gray-200: #E4E4E7;
    --white: #FFFFFF;
}

.app-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(228, 228, 231, 0.7);
    padding: 12px 24px; padding-top: calc(12px + env(safe-area-inset-top));
    display: flex; justify-content: space-between; align-items: center;
    transition: all 0.3s ease;
}
.brand-name { display: flex; align-items: center; cursor: pointer; font-weight: 800; font-size: 20px; letter-spacing: -0.5px; color: var(--black); transition: transform 0.2s ease; }
.brand-name:hover { transform: scale(1.02); }

.search-container { flex: 1; margin: 0 20px; position: relative; cursor: pointer; max-width: 460px; }
.search-container #globalSearch {
    width: 100%; padding: 10px 16px 10px 42px; border-radius: 12px;
    border: 1px solid var(--gray-200); background: var(--gray-100);
    font-size: 14px; font-weight: 500; outline: none; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer; color: var(--gray-800);
}
.search-container:hover #globalSearch { background: var(--white); border-color: var(--brand-pink); box-shadow: 0 4px 12px rgba(255, 77, 143, 0.08); }

.search-icon-svg {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--gray-600); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none; display: flex; align-items: center; justify-content: center;
}
.search-container:hover .search-icon-svg { color: var(--brand-pink); transform: translateY(-50%) scale(1.1); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.cart-icon-btn {
    position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--gray-800); width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid var(--gray-200); background: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-icon-btn:hover {
    color: var(--brand-pink); border-color: var(--brand-pink);
    box-shadow: 0 4px 12px rgba(255, 77, 143, 0.08);
    transform: translateY(-1px);
}
.cart-icon-btn:active {
    transform: translateY(0);
}

.cart-badge {
    position: absolute; top: -3px; right: -3px; background: var(--brand-pink); color: var(--white);
    font-size: 10px; font-weight: 800; min-width: 18px; height: 18px; display: flex;
    align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--white);
    box-shadow: 0 2px 6px rgba(255, 77, 143, 0.3);
}

/* HEADER CUSTOMER GREETING */
.header-customer-greeting {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    cursor: pointer;
    margin-left: 8px;
    line-height: 1.2;
    min-width: 0;
}
.greeting-prefix-text {
    font-size: 13px;
    font-weight: 800;
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.greeting-name-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* COMPACT LOCATION CARD */
.header-location {
    margin: 12px 24px; background: var(--white); border-radius: 12px;
    padding: 10px 16px; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; cursor: pointer; border: 1px solid var(--gray-200); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); transition: all 0.2s ease;
}
.header-location:hover { border-color: var(--brand-pink); background: var(--brand-pink-soft); box-shadow: 0 4px 12px rgba(255, 77, 143, 0.08); }
.header-location .loc-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.header-location .loc-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.3; }
.header-location .loc-text > div:first-child { font-size: 13px; font-weight: 800; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.eta-line { font-size: 11px; font-weight: 700; color: var(--brand-blue); margin-top: 1px; display: block; text-transform: uppercase; }
.loc-edit { font-size: 11px; font-weight: 800; color: var(--brand-pink); text-transform: uppercase; letter-spacing: 0.5px; padding: 4px 10px; background: var(--white); border-radius: 8px; border: 1px solid var(--brand-pink-light); flex-shrink: 0; }
@media (max-width: 480px) { .header-location .loc-text > div:first-child { max-width: 160px; } }

/* SIDEBAR MENU */
#dashboardMenu {
    display: flex !important;
    justify-content: flex-end;
    align-items: stretch;
    padding: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease, backdrop-filter 0.3s ease;
}
#dashboardMenu.active {
    opacity: 1;
    visibility: visible;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: auto;
}
.menu-sheet {
    width: 320px;
    height: 100%;
    background: #FFFFFF;
    border-radius: 25px 0 0 25px;
    padding: 0;
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#dashboardMenu.active .menu-sheet {
    transform: translateX(0);
}
.menu-header { background: #F8FAFC; padding: 60px 25px 30px; border-bottom: 1px solid #F1F5F9; display: flex; align-items: center; gap: 15px; color: #1A1C1E; }
.user-avatar { width: 60px; height: 60px; background: #E2E8F0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; border: 2px solid #FFFFFF; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.user-info h4 { margin: 0; font-size: 18px; font-weight: 800; color: #0F172A; }
.user-info span { font-size: 13px; color: #64748B; font-weight: 500; }
.menu-body { padding: 20px 0; }
.menu-item { padding: 16px 30px; font-size: 15px; font-weight: 600; color: #334155; display: flex; align-items: center; gap: 12px; transition: all 0.2s ease; cursor: pointer; border-right: 4px solid transparent; }
.menu-item:hover, .menu-item:active { background: #F1F5F9; color: #057A78; border-right-color: #057A78; }
.logout-btn { margin-top: auto; color: #EF4444 !important; }
.close-menu { position: absolute; top: 25px; left: 20px; font-size: 22px; color: #94A3B8; cursor: pointer; }

/* Scoped Page Header for subpages */
.page-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(228, 228, 231, 0.7);
    padding: 12px 24px; display: flex; justify-content: space-between; align-items: center;
    transition: all 0.3s ease;
}

/* Responsive layout for premium mobile experience */
@media (max-width: 768px) {
    .app-header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .header-actions {
        gap: 12px;
    }

    .search-container #globalSearch {
        font-size: 13px;
        padding: 8px 12px 8px 36px;
        border-radius: 10px;
    }

    .search-icon-svg {
        left: 12px;
    }

    /* Make Store Status super compact on mobile */
    .store-status-indicator {
        padding: 6px;
        border-radius: 50%;
        border: 1px solid rgba(0, 0, 0, 0.05);
        background: transparent !important;
    }
    .store-status-indicator .status-text {
        display: none;
    }

    /* Simplify User Profile to just avatar circle on mobile */
    .user-profile-chip {
        padding: 6px;
        border-radius: 50%;
        border: 1px solid rgba(0, 0, 0, 0.05);
        background: transparent !important;
    }
    .user-profile-chip .user-greeting-text {
        display: none;
    }
}

/* PREMIUM STORE STATUS INDICATOR */
.store-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.1px;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.store-status-indicator.open {
    background: rgba(34, 197, 94, 0.08);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.15);
}
.store-status-indicator.closed {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.store-status-indicator .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}
.store-status-indicator.open .status-dot {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
    animation: statusPulseGreen 2s infinite ease-in-out;
}
.store-status-indicator.closed .status-dot {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
    animation: statusPulseRed 2s infinite ease-in-out;
}
@keyframes statusPulseGreen {
    0% { transform: scale(1); box-shadow: 0 0 0 0px rgba(34, 197, 94, 0.5); }
    70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0px rgba(34, 197, 94, 0); }
}
@keyframes statusPulseRed {
    0% { transform: scale(1); box-shadow: 0 0 0 0px rgba(239, 68, 68, 0.5); }
    70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0px rgba(239, 68, 68, 0); }
}

/* USER PROFILE GREETING CHIP */
.user-profile-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}
.user-profile-chip::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(90deg, #FF4D8F, #2563EB, #FF4D8F);
    background-size: 200% 200%;
    z-index: -2;
    animation: rotateBorder 3s linear infinite;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}
.user-profile-chip:hover::before {
    opacity: 1;
}
.user-profile-chip:hover {
    border-color: transparent;
    background: var(--white);
    box-shadow: 0 4px 12px rgba(255, 77, 143, 0.08);
}
@keyframes rotateBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.avatar-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-pink-light);
    color: var(--brand-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}
.user-greeting-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}
.greeting-prefix {
    font-size: 9px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    margin-bottom: 1px;
}
.greeting-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--black);
}
