/* ============================================================
   Diilzo Storefront — Modern Header (3-row: topbar + main + catbar)
   Pixel-based, mobile-first responsive
   ============================================================ */

/* ── Container ─────────────────────────────────────────────────── */
.dz-hdr-header {
    background: #fff;
    border-bottom: 1px solid var(--diilzo-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

/* ── Top utility strip ─────────────────────────────────────────── */
.dz-hdr-topbar {
    background: var(--diilzo-dark);
    color: #ccc;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dz-hdr-topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 32px;
}

.dz-hdr-topbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #aaa;
}

.dz-hdr-topbar-left i {
    color: var(--diilzo-primary);
    font-size: 12px;
}

.dz-hdr-topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.dz-hdr-topbar-right a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dz-hdr-topbar-right a:hover {
    color: #fff;
}

.dz-hdr-topbar-right a i {
    font-size: 11px;
}

/* ── Main header row ───────────────────────────────────────────── */
.dz-hdr-main {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
    height: 64px;
}

/* Hamburger — hidden on desktop */
.dz-hdr-hamburger {
    display: none;
    background: #f5f5f5;
    border: 1px solid var(--diilzo-border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    font-size: 18px;
    flex-shrink: 0;
    transition: background 0.15s;
}

.dz-hdr-hamburger:hover {
    background: #eee;
}

/* Logo — image-based */
.dz-hdr-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.dz-hdr-logo-img {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.dz-hdr-logo-subtitle {
    font-size: 9px;
    font-weight: 700;
    color: #666;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 1px;
}

/* Search — centered, flexible */
.dz-hdr-search {
    flex: 1;
    max-width: 640px;
    display: flex;
    height: 42px;
    border-radius: 22px;
    overflow: visible;
    background: #f5f5f5;
    border: 2px solid var(--diilzo-border);
    margin: 0 auto;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.dz-hdr-search:focus-within {
    background: #fff;
    border-color: var(--diilzo-primary);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}

.dz-hdr-search input {
    flex: 1;
    border: none;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
    background: transparent;
    color: #333;
}

.dz-hdr-search button {
    background: var(--diilzo-primary);
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 16px;
    color: #fff;
    transition: opacity 0.2s;
    border-radius: 0 22px 22px 0;
}

.dz-hdr-search button:hover {
    opacity: 0.9;
}

/* Right side actions */
.dz-hdr-right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Auth buttons (guest) */
.dz-hdr-auth-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--diilzo-border);
    transition: background 0.15s, border-color 0.15s;
}

.dz-hdr-auth-btn:hover {
    background: #f5f5f5;
    border-color: #ddd;
}

.dz-hdr-auth-primary {
    background: var(--diilzo-primary);
    color: #fff;
    border-color: var(--diilzo-primary);
}

.dz-hdr-auth-primary:hover {
    background: #e55f00;
    border-color: #e55f00;
}

/* Cart */
.dz-hdr-cart {
    position: relative;
    font-size: 22px;
    color: #333;
    text-decoration: none;
    transition: color 0.15s;
    display: flex;
    align-items: center;
}

.dz-hdr-cart:hover {
    color: var(--diilzo-primary);
}

.dz-hdr-cart .dz-hdr-cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--diilzo-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
}

/* Avatar */
.dz-hdr-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--diilzo-border);
    flex-shrink: 0;
}

.dz-hdr-avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--diilzo-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* User trigger button */
.dz-hdr-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.dz-hdr-user-trigger:hover {
    background: #f5f5f5;
}

.dz-hdr-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.dz-hdr-user-text small {
    font-size: 10px;
    color: #999;
    font-weight: 700;
}

.dz-hdr-user-text strong {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.dz-hdr-caret {
    font-size: 10px;
    opacity: 0.5;
}

/* ── Category nav bar ──────────────────────────────────────────── */
.dz-hdr-catbar {
    background: linear-gradient(to right, var(--diilzo-primary), var(--diilzo-accent));
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.18);
    position: relative;
}

.dz-hdr-catbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 60%);
    pointer-events: none;
}

.dz-hdr-catbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.dz-hdr-nav {
    display: flex;
    gap: 2px;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.dz-hdr-nav::-webkit-scrollbar {
    display: none;
}

.dz-hdr-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 16px;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    opacity: 0.92;
    transition: opacity 0.15s, border-color 0.15s, background 0.15s;
}

.dz-hdr-nav a:hover {
    opacity: 1;
    border-bottom-color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.dz-hdr-nav a i {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.dz-hdr-nav a:hover i {
    color: #fff;
}

.dz-hdr-nav-cat-icon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Nav close button (mobile only) */
.dz-hdr-nav-close {
    display: none;
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: #333;
    font-size: 22px;
    cursor: pointer;
}

/* Nav overlay (mobile) */
.dz-hdr-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 98;
}

.dz-hdr-nav-overlay.dz-hdr-open {
    display: block;
}

/* ── Notification bell ─────────────────────────────────────────── */
.dz-hdr-notif {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.15s;
    color: #333;
    font-size: 18px;
}

.dz-hdr-notif:hover {
    background: #f5f5f5;
}

.dz-hdr-notif-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #e5483e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.dz-hdr-notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    z-index: 10000;
    display: none;
    color: var(--diilzo-text);
    border: 1px solid var(--diilzo-border);
}

.dz-hdr-notif-dropdown.dz-show {
    display: block;
}

.dz-hdr-notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--diilzo-border);
    font-size: 14px;
}

.dz-hdr-notif-header a {
    color: var(--diilzo-primary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.dz-hdr-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.1s;
}

.dz-hdr-notif-item:hover {
    background: #f9f9f9;
}

.dz-hdr-notif-item.unread {
    background: #DCF5EC;
}

.dz-hdr-notif-item i {
    color: var(--diilzo-primary);
    font-size: 16px;
    margin-top: 2px;
}

.dz-hdr-notif-item div {
    flex: 1;
}

.dz-hdr-notif-item strong {
    font-size: 13px;
    display: block;
}

.dz-hdr-notif-item span {
    font-size: 12px;
    color: var(--diilzo-muted);
}

.dz-hdr-notif-item small {
    font-size: 11px;
    color: #999;
}

/* ── User menu dropdown ────────────────────────────────────────── */
.dz-hdr-user-menu {
    position: relative;
}

.dz-hdr-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 240px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    z-index: 10000;
    display: none;
    color: var(--diilzo-text);
    overflow: hidden;
    border: 1px solid var(--diilzo-border);
}

.dz-hdr-user-dropdown.dz-show {
    display: block;
}

.dz-hdr-user-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--diilzo-border);
    background: #fafafa;
}

.dz-hdr-user-name {
    font-size: 14px;
    font-weight: 700;
}

.dz-hdr-user-email {
    font-size: 12px;
    color: var(--diilzo-muted);
    margin-top: 2px;
}

.dz-hdr-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--diilzo-text);
    text-decoration: none;
    transition: background 0.15s;
    width: 100%;
}

.dz-hdr-user-link:hover {
    background: #f5f7fa;
    color: var(--diilzo-primary);
}

.dz-hdr-user-link i {
    width: 18px;
    text-align: center;
    color: var(--diilzo-muted);
}

.dz-hdr-user-link:hover i {
    color: var(--diilzo-primary);
}

.dz-hdr-user-divider {
    height: 1px;
    background: var(--diilzo-border);
    margin: 4px 0;
}

.dz-hdr-user-logout {
    color: #e74c3c !important;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.dz-hdr-user-logout i {
    color: #e74c3c !important;
}

.dz-hdr-user-logout:hover {
    background: #fdf0ee !important;
}

/* ── Search results dropdown ───────────────────────────────────── */
.dz-hdr-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 32px rgba(10, 46, 26, 0.18);
    z-index: 1000;
    display: none;
    max-height: 480px;
    overflow-y: auto;
    border: 1px solid var(--diilzo-border);
    border-top: 3px solid var(--diilzo-primary);
    animation: dz-search-drop 0.18s ease-out;
}

@keyframes dz-search-drop {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section header inside dropdown */
.dz-sr-section {
    padding: 10px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--diilzo-muted);
    background: linear-gradient(to bottom, #f8fdf9, #fff);
    border-bottom: 1px solid var(--diilzo-border);
}

/* Product result row */
.dz-sr-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--diilzo-text);
    border-bottom: 1px solid #f0f7f3;
    transition: background 0.15s, padding-left 0.15s;
}

.dz-sr-product:hover {
    background: #f5fbf7;
    padding-left: 18px;
}

/* Product image thumbnail */
.dz-sr-product-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f5;
    border: 1px solid var(--diilzo-border);
    flex-shrink: 0;
}

.dz-sr-product-img-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--diilzo-primary), var(--diilzo-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Product text block */
.dz-sr-product-info {
    flex: 1;
    min-width: 0;
}

.dz-sr-product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--diilzo-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.dz-sr-product-meta {
    font-size: 12px;
    color: var(--diilzo-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dz-sr-product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--diilzo-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Store result row */
.dz-sr-store {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--diilzo-text);
    border-bottom: 1px solid #f0f7f3;
    transition: background 0.15s, padding-left 0.15s;
}

.dz-sr-store:hover {
    background: #f5fbf7;
    padding-left: 18px;
}

.dz-sr-store-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--diilzo-primary), var(--diilzo-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.dz-sr-store-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--diilzo-text);
}

/* Empty / loading / error states */
.dz-sr-empty,
.dz-sr-loading,
.dz-sr-error {
    padding: 28px 20px;
    text-align: center;
    color: var(--diilzo-muted);
    font-size: 14px;
}

.dz-sr-loading i,
.dz-sr-error i {
    display: block;
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--diilzo-primary);
}

.dz-sr-error {
    color: #c00;
}

.dz-sr-error i {
    color: #c00;
}

/* Suggestion row (autocomplete names) */
.dz-sr-suggestion {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    text-decoration: none;
    color: var(--diilzo-text);
    font-size: 13px;
    border-bottom: 1px solid #f0f7f3;
    transition: background 0.15s, padding-left 0.15s;
}

.dz-sr-suggestion:hover {
    background: #f5fbf7;
    padding-left: 18px;
}

.dz-sr-suggestion span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* "View all results" footer link */
.dz-sr-view-all {
    display: block;
    padding: 12px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--diilzo-primary);
    background: linear-gradient(to bottom, #f8fdf9, #f1faf4);
    text-decoration: none;
    border-top: 1px solid var(--diilzo-border);
    transition: background 0.15s;
}

.dz-sr-view-all:hover {
    background: linear-gradient(to bottom, #f1faf4, #e8f7ee);
}

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet — hide topbar, compact layout */
@media (max-width: 900px) {
    .dz-hdr-topbar {
        display: none;
    }

    .dz-hdr-main {
        gap: 12px;
        padding: 0 16px;
        height: 56px;
    }

    .dz-hdr-logo-img {
        height: 26px;
    }

    .dz-hdr-search {
        max-width: 100%;
    }

    .dz-hdr-right {
        gap: 10px;
    }

    .dz-hdr-user-text {
        display: none;
    }

    .dz-hdr-caret {
        display: none;
    }

    .dz-hdr-auth-btn span {
        display: none;
    }

    .dz-hdr-auth-btn {
        padding: 8px 10px;
    }
}

/* Mobile — hamburger nav, search wraps to second row */
@media (max-width: 768px) {
    .dz-hdr-hamburger {
        display: flex;
    }

    .dz-hdr-main {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 10px;
    }

    .dz-hdr-search {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
    }

    .dz-hdr-catbar-inner {
        padding: 0;
    }

    /* Nav becomes slide-in drawer */
    .dz-hdr-nav {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        gap: 0;
        padding: 60px 0 20px;
        z-index: 99;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        align-items: stretch;
    }

    .dz-hdr-nav.dz-hdr-open {
        left: 0;
    }

    .dz-hdr-nav a {
        color: #333;
        opacity: 1;
        padding: 14px 24px;
        font-size: 15px;
        border-bottom: 1px solid #f5f5f5;
        border-bottom-width: 1px;
        border-bottom-style: solid;
        border-bottom-color: #f5f5f5;
    }

    .dz-hdr-nav a:hover {
        color: var(--diilzo-primary);
        background: #DCF5EC;
        border-bottom-color: transparent;
    }

    .dz-hdr-nav a i {
        font-size: 15px;
        color: var(--diilzo-muted);
    }

    .dz-hdr-nav a:hover i {
        color: var(--diilzo-primary);
    }

    .dz-hdr-nav-cat-icon {
        border: 1px solid var(--diilzo-border);
    }

    .dz-hdr-nav-close {
        display: block;
        color: #333;
    }

    .dz-hdr-notif-dropdown {
        width: 300px;
        right: -50px;
    }
}

/* Small phone — minimal */
@media (max-width: 480px) {
    .dz-hdr-logo-img {
        height: 22px;
    }

    .dz-hdr-auth-btn {
        display: none;
    }

    .dz-hdr-right {
        gap: 8px;
    }

    .dz-hdr-notif-dropdown {
        width: 280px;
        right: -80px;
    }

    .dz-hdr-user-dropdown {
        width: 220px;
    }
}