/* ==========================================
   HEADER COMPONENT STYLES
   Extracted from includes/header.php (used to be an inline <style>
   block injected mid-<body>, since header.php loads after <body>
   opens — that delayed these rules and the Google Fonts link
   until the parser reached that point, a real FOUC risk). Now
   loaded from includes/head.php inside <head>, same as style.css.
   Shares :root tokens (--orange, --border, --radius, etc.) defined
   in style.css.
========================================== */

/* ── LOGO ── */
.navbar-brand { text-decoration: none; display: flex; align-items: center; gap: 10px; }
.navbar-brand .logo {
    width: 38px; height: 38px;
    border-radius: 10px;
    object-fit: cover;
    border: 1.5px solid var(--border);
}
.brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--orange);
    letter-spacing: -0.3px;
    line-height: 1.1;
}
.brand-sub {
    font-family: var(--font-body);
    font-size: 0.68rem;
    color: var(--muted);
    display: block;
    line-height: 1;
    margin-top: 1px;
}

/* ── SEARCH ──
   NOTE: this used to be two competing rule blocks — an original
   plus an "Update 1/2" patch appended later in header.php with an
   extra !important. Merged here into one rule each, keeping exactly
   what the cascade already resolved to (no visual change). */
.header-search {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #f8f8fb;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: visible !important; /* must be visible so the dropdown can escape the container */
}
.header-search:focus-within {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,106,0,0.1);
    background: #fff;
}
/* Inner wrapper clips the border-radius visually without hiding the dropdown */
.search-inner {
    display: flex;
    align-items: center;
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    min-width: 0;
}
.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.6rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text);
    outline: none;
    min-width: 0;
}
.header-search input::placeholder { color: #b0b0bf; }

/* ── SEARCH AUTOCOMPLETE ── */
.search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    z-index: 1050;
    max-height: 360px;
    overflow-y: auto;
    padding: 0.4rem;
}
.search-suggestions.show { display: block; }
.search-sugg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.14s;
}
.search-sugg-item:hover,
.search-sugg-item.active {
    background: var(--orange-light);
}
.search-sugg-img {
    width: 38px; height: 38px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9f9fc;
    padding: 2px;
    flex-shrink: 0;
}
.search-sugg-info { flex: 1; min-width: 0; }
.search-sugg-name {
    font-size: 0.86rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-sugg-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--orange);
}
.search-sugg-empty {
    text-align: center;
    padding: 0.9rem 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.search-cat-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    border-right: 1.5px solid var(--border);
    padding: 0.6rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.18s;
    border-radius: 10px 0 0 10px;
}
.search-cat-btn:hover { color: var(--orange); }
.search-cat-btn i { font-size: 0.75rem; }

.search-submit-btn {
    background: var(--orange);
    border: none;
    padding: 0.6rem 1rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.18s;
    white-space: nowrap;
    border-radius: 0 10px 10px 0;
    flex-shrink: 0;
}
.search-submit-btn:hover { background: var(--orange-dark); }

/* ── HEADER ACTIONS ── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ── USER DROPDOWN TRIGGER ── */
.user-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 0.38rem 0.8rem 0.38rem 0.45rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
}
.user-trigger:hover {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,106,0,0.08);
    color: var(--orange);
}
.user-avatar {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── LOGIN BUTTON ── */
.btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.87rem;
    font-weight: 500;
    padding: 0.42rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    transition: all 0.18s;
}
.btn-login:hover { border-color: var(--orange); color: var(--orange); }
.btn-login i { font-size: 1rem; }

.btn-signup {
    text-decoration: none;
    background: var(--orange);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    transition: background 0.18s, transform 0.15s;
    letter-spacing: 0.01em;
}
.btn-signup:hover {
    background: var(--orange-dark);
    color: #fff;
    transform: translateY(-1px);
}

/* ── DROPDOWN MENU ── */
.dropdown-menu {
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0.5rem !important;
    min-width: 180px;
    margin-top: 8px !important;
    font-family: var(--font-body);
}
.dropdown-item {
    border-radius: 8px;
    font-size: 0.88rem;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}
.dropdown-item:hover { background: var(--orange-light); color: var(--orange); }
.dropdown-item.text-danger:hover { background: #fff2f2; color: #e74c3c !important; }
.dropdown-divider { margin: 0.35rem 0.5rem !important; border-color: var(--border) !important; }

/* Category dropdown */
.category-dropdown .dropdown-menu {
    min-width: 200px;
}

/* ── CART BUTTON ── */
.cart-trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.42rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    background: #fff;
    transition: all 0.18s;
}
.cart-trigger:hover { border-color: var(--orange); color: var(--orange); }
.cart-trigger i { font-size: 1rem; }

.cart-badge {
    position: absolute;
    top: -5px; right: -5px;
    width: 18px; height: 18px;
    background: var(--orange);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}

/* ── CART DROPDOWN ── */
.cart-dropdown {
    width: 320px !important;
    padding: 1rem !important;
}
.cart-dropdown-header {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 0.75rem;
}
.cart-count-badge {
    background: var(--orange-light);
    color: var(--orange);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.cart-empty {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--muted);
    font-size: 0.88rem;
}
.cart-empty i { font-size: 2rem; display: block; margin-bottom: 0.5rem; color: var(--border); }

.cart-items { max-height: 220px; overflow-y: auto; }
.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f2f2f7;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
    width: 44px; height: 44px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9f9fc;
    padding: 3px;
    flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.cart-item-meta { font-size: 0.76rem; color: var(--muted); }
.cart-item-price { font-weight: 700; font-size: 0.85rem; color: var(--dark); flex-shrink: 0; }

/* ── STALE PRICE / STOCK FLAGS ── */
.cart-item-oos .cart-item-img { opacity: 0.45; }
.cart-item-oos .cart-item-name { color: var(--muted); }
.cart-item-stock-warn {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cart-item-stock-warn.oos { color: #e74c3c; }
.cart-item-stock-warn.low { color: #b8860b; }
.cart-stock-alert {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff3f3;
    border: 1px solid #ffd4d4;
    color: #c0392b;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
    margin-bottom: 0.6rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0 0.6rem;
    border-top: 1.5px solid var(--border);
    margin-top: 0.5rem;
}
.cart-total-label { font-family: var(--font-heading); font-weight: 600; font-size: 0.88rem; }
.cart-total-amount { font-family: var(--font-heading); font-weight: 700; color: var(--orange); font-size: 1rem; }

.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-cart-view {
    display: flex; align-items: center; justify-content: center;
    padding: 0.55rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    font-family: var(--font-body);
    transition: all 0.18s;
}
.btn-cart-view:hover { border-color: var(--orange); color: var(--orange); }
.btn-cart-checkout {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 0.55rem;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: background 0.18s;
}
.btn-cart-checkout:hover { background: var(--orange-dark); color: #fff; }

/* ── MOBILE TOGGLER ── */
.mobile-toggler {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s;
}
.mobile-toggler:hover { border-color: var(--orange); color: var(--orange); }

/* ── MOBILE SEARCH ── */
.mobile-search {
    margin-top: 0.75rem;
}
.mobile-search .header-search {
    border-radius: 10px;
}

/* ── Admin Notification Bell ─────────────────────────── */
.notif-trigger {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: border-color .18s, color .18s, box-shadow .18s;
    font-size: 1rem;
    flex-shrink: 0;
}
.notif-trigger:hover,
.notif-trigger.has-new {
    border-color: var(--orange);
    color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,106,0,.08);
}
.notif-badge {
    position: absolute;
    top: -5px; right: -5px;
    min-width: 18px; height: 18px;
    padding: 0 3px;
    background: #e74c3c;
    color: #fff;
    font-size: .6rem; font-weight: 700;
    border-radius: 999px;
    display: none;
    align-items: center; justify-content: center;
    border: 2px solid #fff;
    font-family: var(--font-heading);
    line-height: 1;
}
/* Notification dropdown panel */
.notif-dropdown {
    width: 320px !important;
    padding: 0 !important;
    overflow: hidden;
    margin-top: 8px !important;
}
.notif-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1rem .65rem;
    border-bottom: 1.5px solid var(--border);
    font-family: var(--font-heading); font-weight: 600; font-size: .88rem;
    color: var(--dark);
}
.notif-view-all {
    font-size: .75rem; font-family: var(--font-body); font-weight: 500;
    color: var(--orange); text-decoration: none;
}
.notif-view-all:hover { text-decoration: underline; }
.notif-scroll { max-height: 260px; overflow-y: auto; }
.notif-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: .6rem 1rem;
    border-bottom: 1px solid #f2f2f7;
    text-decoration: none; color: var(--text);
    transition: background .14s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #fff8f5; }
.notif-item-ic {
    width: 32px; height: 32px;
    background: rgba(255,106,0,.1); color: var(--orange);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .88rem; flex-shrink: 0;
}
.notif-item-name { font-family: var(--font-heading); font-size: .8rem; font-weight: 600; color: var(--dark); }
.notif-item-sub  { font-size: .73rem; color: var(--muted); font-family: var(--font-body); }
.notif-item-time { font-size: .69rem; color: #b8b8cc; margin-top: 2px; }
.notif-empty {
    text-align: center; padding: 1.4rem 1rem;
    color: var(--muted); font-size: .84rem; font-family: var(--font-body);
}
.notif-empty i { display: block; font-size: 1.4rem; color: #d5d5e0; margin-bottom: .35rem; }
.notif-ftr { padding: .55rem .8rem; border-top: 1.5px solid var(--border); }
@keyframes notif-ring {
    0%   { transform: rotate(0)     scale(1); }
    15%  { transform: rotate(-20deg) scale(1.05); }
    30%  { transform: rotate(20deg); }
    45%  { transform: rotate(-14deg); }
    60%  { transform: rotate(10deg); }
    75%  { transform: rotate(-5deg); }
    100% { transform: rotate(0)     scale(1); }
}
.notif-ringing {
    display: inline-block;
    transform-origin: 50% 0%;
    animation: notif-ring .55s ease;
}
