/* ============================================
   HEADER STYLES - VEGETABLE SHOP
   ============================================ */

* {
    font-size: 1rem;
}

/* Main Header Container */
.site-header-shell {
    position: static;
}

.site-header-shell.is-sticky-desktop {
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header-shell.is-static {
    position: static;
}

header {
    position: static;
    top: auto;
    z-index: auto;
    flex-wrap: wrap;
    padding-block: var(--spacing-lg);
    padding-inline: var(--spacing-lg);
    justify-content: space-between;
    row-gap: var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    transition: all var(--transition-normal);
}

header .container {
    width: 100%;
}

/* Menu Logo Section */
.menu-logo-section {
    flex: 0 0 auto;
    min-height: 25px;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
}

#logo {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-normal);
}

#logo a {
    text-decoration: none;
}

.brand-lockup {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    position: relative;
    padding: 0;
    transition: transform var(--transition-normal), filter var(--transition-normal);
}

.brand-lockup::before {
    content: "";
    position: absolute;
    left: -10px;
    top: -8px;
    width: 182px;
    height: 62px;
    pointer-events: none;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 40%, rgba(161, 255, 223, 0.42), rgba(161, 255, 223, 0));
    opacity: 0.72;
    animation: brandDrift 4.8s ease-in-out infinite alternate;
}

.brand-title {
    position: relative;
    display: inline-block;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: 1.6px;
    line-height: 1;
    color: #ffffff;
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.28),
        0 0 12px rgba(255, 255, 255, 0.24);
}

.brand-title::after {
    content: "";
    position: absolute;
    left: -18%;
    top: 50%;
    width: 46%;
    height: 2px;
    transform: translateY(-50%) rotate(-16deg);
    background: linear-gradient(90deg, rgba(160, 160, 160, 0), rgba(224, 224, 224, 0.95), rgba(120, 120, 120, 0));
    filter: drop-shadow(0 0 3px rgba(235, 235, 235, 0.45));
    animation: brandCrossSlide 3.1s linear infinite;
}

.brand-tagline {
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.35px;
    line-height: 1.25;
    text-transform: uppercase;
    opacity: 1;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.26);
}

#logo:hover .brand-lockup {
    transform: translateY(-1px);
    filter: drop-shadow(0 6px 16px rgba(255, 248, 158, 0.28));
}

/* Login & Cart Section */
.login-cart-section {
    gap: var(--spacing-lg);
    align-items: center;
}

#login {
    /* display: none; */
    padding: var(--spacing-sm) var(--spacing-xl);
    border-radius: var(--radius-full);
    border: none;
    background-color: white;
    color: var(--primary-green);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    font-size: var(--font-base);
}

#login:hover {
    background-color: var(--bg-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

#login:active {
    transform: translateY(0);
}

#account{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(145deg, #22c55e 0%, #14b8a6 55%, #0ea5e9 100%);
    border: 2px solid rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

#account::before {
    content: "\f007";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #ffffff;
    font-size: 16px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#account:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
}

.account-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.account-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 5px;
    background: transparent;
}

.account-dropdown:hover .account-menu,
.account-dropdown.open .account-menu {
    display: block;
}

.account-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: -60px;
    width: 176px;
    min-height: 220px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-sm);
    margin: 0;
    list-style: none;
    z-index: 1000;
    display: none;
}

.account-menu li a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-weight: var(--font-medium);
    transition: all var(--transition-normal);
}

.account-menu li a:hover {
    background-color: var(--primary-green-lighter);
    color: var(--primary-green-dark);
}

/* Cart Button */
#add-cart {
    height: var(--spacing-3xl);
    padding-left: var(--spacing-md);
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
}

#add-cart:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: scale(1.05);
}

#add-cart:active {
    transform: scale(0.95);
}

#add-cart.cart-guided-highlight {
    border-color: #fef08a;
    background-color: rgba(255, 255, 255, 0.16);
    box-shadow:
        0 0 0 6px rgba(254, 240, 138, 0.18),
        0 14px 28px rgba(15, 118, 110, 0.22);
    animation: cartGuideGlow 2.2s ease-in-out;
}

/* Cart Item Count Badge */
#num-item {
    position: relative;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--accent-red);
    color: white;
    border-radius: var(--radius-full);
    font-weight: var(--font-bold);
    font-size: var(--font-xs);
    min-width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

#num-item.cart-guided-badge {
    animation: cartGuideBadge 1.1s ease-in-out 2;
}

/* Search Bar */
.search-bar {
    border: 2px solid rgba(255, 255, 255, 0.4);
    width: 100%;
    min-height: 48px;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    gap: 0;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

.search-bar:focus-within {
    border-color: white;
    background-color: white;
    box-shadow: var(--shadow-lg);
}

.live-search {
    position: relative;
}

.logout-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    display: none;
    padding: 16px;
    background: rgba(15, 23, 42, 0.52);
    z-index: 12000;
    overflow: auto;
}

.logout-confirm-modal.show {
    display: block;
}

.logout-confirm-modal-card {
    width: min(420px, 100%);
    max-height: calc(100dvh - 32px);
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    box-shadow: 0 22px 42px rgba(2, 6, 23, 0.26);
    padding: 18px 16px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.logout-confirm-modal-card h3 {
    margin: 0 0 8px;
    color: var(--text-dark);
}

.logout-confirm-modal-card p {
    margin: 0;
    color: var(--text-medium);
}

.logout-confirm-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1001;
    padding: var(--spacing-sm);
}

.search-results.hidden {
    display: none;
}

.search-results .search-result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    text-decoration: none;
    transition: background-color var(--transition-normal);
}

.search-results .search-result-item:hover {
    background-color: var(--primary-green-lighter);
}

.search-results .search-result-item.selected {
    background-color: var(--primary-green-lighter);
    outline: 2px solid rgba(16, 185, 129, 0.25);
}

.search-results .search-result-img {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--border-light);
    background: var(--bg-light);
}

.search-results img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    flex: 0 0 42px;
}

.search-results .search-result-title {
    font-weight: var(--font-medium);
    font-size: var(--font-base);
}

.search-no-results {
    padding: var(--spacing-md);
    color: var(--text-medium);
    font-weight: var(--font-medium);
}

/* Menu Bar Button */
#menubar {
    border: none;
    background-color: transparent;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: auto;
    height: auto;
    padding: var(--spacing-sm);
}

#menubar:hover {
    transform: scale(1.2);
}

#menubar i {
    font-size: 1.5rem;
}

/* Search Logo Icon */
#search-logo {
    padding-inline: var(--spacing-lg);
    color: var(--text-medium);
    display: flex;
    align-items: center;
    font-size: var(--font-lg);
}

/* Search Input */
#searchbar {
    background-color: transparent;
    border: none;
    flex: 1;
    padding-block: var(--spacing-md);
    padding-right: var(--spacing-lg);
    color: var(--text-dark);
    font-weight: var(--font-medium);
    outline: none;
    font-size: var(--font-base);
}

#searchbar::placeholder {
    color: var(--text-light);
}

/* ============================================
   SIDEBAR NAVIGATION STYLES
   ============================================ */

#sidebar-section {
    background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-light) 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    transform: translateX(-250px);
    transition: transform var(--transition-normal) ease-in-out;
    z-index: 999;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    border-right: 1px solid var(--border-light);
}

#sidebar-section.open {
    transform: translateX(0);
}

/* Sidebar List */
#sidebar {
    gap: var(--spacing-lg);
    margin-top: var(--spacing-2xl);
    padding-inline: var(--spacing-lg);
    padding-top: var(--spacing-lg);
}

#sidebar li {
    width: 100%;
    list-style: none;
}

#sidebar li a {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-dark);
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    border-left: 3px solid transparent;
}

#sidebar li a:hover {
    background-color: var(--primary-green-lighter);
    color: var(--primary-green-dark);
    border-left-color: var(--primary-green);
    padding-left: var(--spacing-xl);
}

/* Sidebar Toggle Button */
#sidebar-toggle {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background-color: var(--primary-green);
    color: white;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-lg);
}

#sidebar-toggle:hover {
    background-color: var(--primary-green-dark);
    transform: scale(1.1);
}

#sidebar-toggle:active {
    transform: scale(0.95);
}

/* Close Sidebar Overlay */
.close-sidebar-div-click {
    position: fixed;
    left: 250px;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 99;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    transition: all var(--transition-normal);
}

.close-sidebar-div-click.hide {
    display: none;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes brandDrift {
    from {
        transform: translateX(0) translateY(0);
        opacity: 0.5;
    }
    to {
        transform: translateX(8px) translateY(-2px);
        opacity: 0.72;
    }
}

@keyframes brandCrossSlide {
    0% {
        left: -18%;
        opacity: 0.45;
    }
    55% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0.35;
    }
}

@keyframes cartGuideGlow {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(254, 240, 138, 0);
    }
    35% {
        transform: translateY(-2px) scale(1.06);
        box-shadow:
            0 0 0 10px rgba(254, 240, 138, 0.24),
            0 18px 34px rgba(15, 118, 110, 0.28);
    }
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(254, 240, 138, 0),
            0 14px 28px rgba(15, 118, 110, 0.08);
    }
}

@keyframes cartGuideBadge {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

header {
    animation: slideInDown 0.3s ease-out;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .site-header-shell {
        margin-inline: -10px;
    }

    header {
        padding-block: var(--spacing-md);
        padding-inline: var(--spacing-md);
    }

    .search-bar {
        min-height: 44px;
    }

    #searchbar {
        font-size: var(--font-sm);
        padding-right: var(--spacing-md);
    }

    #search-logo {
        padding-inline: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    #login {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 14px;
        min-height: 36px;
        font-size: 14px;
        white-space: nowrap;
    }

    .menu-logo-section {
        flex: 0 0 auto;
        gap: var(--spacing-sm);
    }

    .brand-lockup {
        gap: 2px;
    }

    .brand-lockup::before {
        width: 132px;
        height: 44px;
        left: -8px;
        top: -6px;
    }

    .brand-title {
        font-size: 18px;
        letter-spacing: 1.1px;
    }

    .brand-tagline {
        font-size: 7px;
        letter-spacing: 0.9px;
    }

    .login-cart-section {
        gap: var(--spacing-sm);
    }

    #add-cart {
        height: var(--spacing-2xl);
        padding-left: var(--spacing-sm);
    }

    .search-bar {
        width: 100%;
        min-height: 42px;
        order: 3;
    }

    #search-logo {
        padding-inline: var(--spacing-md);
    }

    #searchbar {
        width: 100%;
        padding-right: var(--spacing-md);
        font-size: var(--font-sm);
    }

    header {
        padding-block: var(--spacing-md);
    }
}

@media (min-width: 481px) {
    #sidebar-login {
        display: none;
    }
}

@media (max-width: 480px) {
    #account {
        display: inline-flex;
        width: 36px;
        height: 36px;
    }

    .account-menu {
        right: 0;
        width: min(180px, calc(100vw - 24px));
    }
}

@media (max-width: 1025px) {
    .site-header-shell.is-sticky-desktop {
        position: static !important;
    }

    .search-bar {
        width: 100%;
        order: 3;
    }
}

@media (min-width: 1025px) {
    /* Large desktop */
    .search-bar {
        width: 40%;
        flex: 1;
        margin-left: var(--spacing-lg);
        margin-right: 20px;
    }

    .login-cart-section {
        order: 1;
        gap: var(--spacing-xl);
    }

    #menubar {
        display: none;
    }

    header {
        align-items: center;
    }

    header {
        flex-wrap: nowrap;
    }
}

@media (min-width: 1366px) {
    /* Ultra Large */
    .search-bar {
        width: 50%;
    }
}

/* ============================================
   HOME CATEGORY STRIP
   ============================================ */
.home-category-strip {
    background: linear-gradient(180deg, #f5faf7 0%, #f9fafb 100%);
    border-bottom: 1px solid var(--border-light);
    border-top: 1px solid rgba(16, 185, 129, 0.15);
    box-shadow: inset 0 -1px 0 rgba(16, 185, 129, 0.05);
}

.home-category-strip-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.home-category-strip-row::-webkit-scrollbar {
    height: 6px;
}

.home-category-strip-row::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-full);
}

.home-category-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    white-space: nowrap;
    font-weight: var(--font-semibold);
    transition: all var(--transition-normal);
    border: 1px solid transparent;
    min-height: 38px;
}

.home-category-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
}

.home-category-chip-live {
    color: #0f5132;
    background: #dcfce7;
    border-color: #b7eecb;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.home-category-chip-live .home-category-chip-icon {
    background: #b7eecb;
}

.home-category-chip-live:hover {
    transform: translateY(-2px);
    background: #c9f8d9;
    border-color: #8ad9a9;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.22);
}

.home-category-chip-soon,
.home-category-chip-tease {
    color: #6b7280;
    background: repeating-linear-gradient(
        -45deg,
        #f3f4f6,
        #f3f4f6 8px,
        #eef2f7 8px,
        #eef2f7 16px
    );
    border-color: #d5dbe4;
}

.home-category-chip-soon .home-category-chip-icon,
.home-category-chip-tease .home-category-chip-icon {
    background: #e4e8ef;
}

.home-category-chip-badge {
    background: #111827;
    color: #fff;
    border-radius: var(--radius-full);
    padding: 2px 8px;
    font-size: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.home-category-chip-soon .home-category-chip-text,
.home-category-chip-tease .home-category-chip-text {
    filter: blur(0.2px);
}

.home-category-chip-soon:hover,
.home-category-chip-tease:hover {
    transform: translateY(-2px);
    border-color: #aab5c3;
    color: #4b5563;
}

@media (max-width: 640px) {
    .home-category-strip-row {
        padding: 8px 0;
    }

    .home-category-chip {
        min-height: 34px;
        padding: 6px 12px;
    }
}
