
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(12, 10, 8, 0.92);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid rgba(201, 168, 76, 0.10);
    padding: 10px 0 12px;
    transition: padding 0.3s ease;
}

.header-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: gap 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.header-inner.search-open {
    gap: 6px;
}

/* Row 1: Logo, Nav, Actions */
.header-row-1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-icon-img {
    height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-light);
    line-height: 1.1;
}

.logo-text .brand span {
    color: var(--gold);
}

.logo-text .tagline {
    font-size: 0.5rem;
    letter-spacing: 2.5px;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
}

/* Navigation */
.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    flex-wrap: wrap;
}

.nav-links a {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-light);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.whatsapp-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1.5px solid var(--gold);
    padding: 8px 22px;
    border-radius: 6px;
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.4s ease;
    cursor: pointer;
    white-space: nowrap;
}

.whatsapp-cta i {
    font-size: 1rem;
}

.whatsapp-cta:hover {
    background: var(--gold);
    color: var(--dark);
    box-shadow: 0 0 40px rgba(201, 168, 76, 0.15);
    transform: translateY(-2px);
}

/* Auth Buttons */
.auth-btn {
    background: transparent;
    border: 1.5px solid var(--gold);
    color: var(--gold);
    padding: 8px 22px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    background: transparent;
}

.auth-btn:hover {
    background: var(--gold);
    color: var(--dark);
    box-shadow: 0 0 40px rgba(201, 168, 76, 0.15);
    transform: translateY(-2px);
}

.auth-btn .avatar-icon {
    font-size: 0.9rem;
}

/* Profile Button (logged in) */
.profile-btn {
    background: transparent !important;
    border: none !important;
    padding: 4px 6px !important;
    color: var(--text-light) !important;
    font-size: 1.6rem !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.3s ease;
    border-radius: 50%;
    line-height: 1;
    min-width: auto;
    gap: 0;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 400;
    box-shadow: none !important;
    transform: none !important;
}

.profile-btn:hover {
    color: var(--gold) !important;
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

.profile-btn .avatar-icon {
    font-size: 1.6rem;
}

.profile-btn .profile-text,
.profile-btn .profile-chevron {
    display: none !important;
}

/* Profile Dropdown Wrapper */
.profile-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: rgba(20, 17, 14, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(201, 168, 76, 0.10);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1050;
    pointer-events: none;
}

.profile-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.profile-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
}

.profile-dropdown .dropdown-item:hover {
    background: rgba(201, 168, 76, 0.06);
    color: var(--text-light);
}

.profile-dropdown .dropdown-item i {
    width: 18px;
    color: var(--gold);
    font-size: 0.85rem;
    opacity: 0.6;
}

.profile-dropdown .dropdown-divider {
    height: 1px;
    background: rgba(201, 168, 76, 0.06);
    margin: 4px 16px;
}

.profile-dropdown .dropdown-item.logout-item {
    color: #e74c3c;
}

.profile-dropdown .dropdown-item.logout-item i {
    color: #e74c3c;
    opacity: 0.7;
}

.profile-dropdown .dropdown-item.logout-item:hover {
    background: rgba(231, 76, 60, 0.08);
    color: #ff6b6b;
}

/* Search Toggle */
.search-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: color 0.3s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.search-toggle:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.04);
}

.search-toggle.active {
    color: var(--gold);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 26px;
    height: 2px;
    background: var(--text-light);
    border-radius: 2px;
    transition: 0.3s ease;
}

/* Row 2: Search Bar */
.header-row-2 {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 0.45s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        padding 0.3s ease;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: max-height, opacity, transform;
}

.header-row-2.open {
    max-height: 80px;
    opacity: 1;
    transform: translateY(0);
    overflow: visible;
    padding: 4px 0 0 0;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 620px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: 10px;
    padding: 0 18px;
    height: 38px;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.search-bar:focus-within {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.06);
}

.search-bar .search-icon {
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.4;
    margin-right: 12px;
    flex-shrink: 0;
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 300;
    font-family: 'Inter', sans-serif;
    width: 100%;
    letter-spacing: 0.3px;
}

.search-bar input::placeholder {
    color: var(--text-muted);
    opacity: 0.4;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
}

.search-bar .clear-search {
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
    padding: 4px 0 4px 8px;
}

.search-bar .clear-search.visible {
    opacity: 0.5;
}

.search-bar .clear-search:hover {
    opacity: 1;
    color: var(--text-light);
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: rgba(20, 17, 14, 0.97);
    border: 1px solid rgba(201, 168, 76, 0.08);
    border-radius: 14px;
    padding: 8px 0;
    max-height: 380px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    z-index: 1001;
    min-width: 280px;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;
}

.search-results.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-results::-webkit-scrollbar {
    width: 4px;
}
.search-results::-webkit-scrollbar-track {
    background: transparent;
}
.search-results::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(201, 168, 76, 0.05);
}

.search-result-item .result-image {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    flex-shrink: 0;
    overflow: hidden;
    background: rgba(201, 168, 76, 0.04);
    border: 1px solid rgba(201, 168, 76, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-result-item .result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-result-item .result-info {
    flex: 1;
    min-width: 0;
}

.search-result-item .result-info .r-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    letter-spacing: 0.2px;
}

.search-result-item .result-info .r-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 300;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 1px;
    flex-wrap: wrap;
}

.search-result-item .result-info .r-desc .r-grade {
    color: var(--gold);
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    background: rgba(201, 168, 76, 0.06);
    padding: 0 8px;
    border-radius: 10px;
    border: 1px solid rgba(201, 168, 76, 0.04);
}

.search-result-item .result-link {
    color: var(--gold);
    font-size: 0.7rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.search-result-item:hover .result-link {
    opacity: 1;
}

.search-no-results {
    padding: 28px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 300;
}

.search-no-results i {
    color: var(--gold);
    opacity: 0.3;
    font-size: 1.4rem;
    display: block;
    margin-bottom: 10px;
}

.search-result-item.highlighted {
    background: rgba(201, 168, 76, 0.08);
}
.search-result-item.highlighted .result-link {
    opacity: 1;
}

/* ── Responsive Header ── */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background: var(--dark-card);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 24px 20px 30px;
        gap: 16px;
        border-bottom: 1px solid rgba(201, 168, 76, 0.06);
        backdrop-filter: blur(20px);
        z-index: 999;
    }
    .nav-links.open {
        display: flex;
    }
    .hamburger {
        display: flex;
    }
    .whatsapp-cta span {
        display: none;
    }
    .whatsapp-cta {
        padding: 8px 14px;
    }
    .search-wrapper {
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 10px 0 12px;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        background: var(--dark-card);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 24px 20px 30px;
        gap: 16px;
        border-bottom: 1px solid rgba(201, 168, 76, 0.06);
        backdrop-filter: blur(20px);
        z-index: 999;
    }
    .nav-links.open {
        display: flex;
    }
    .hamburger {
        display: flex;
    }
    .whatsapp-cta span {
        display: none;
    }
    .whatsapp-cta {
        padding: 8px 14px;
    }

    .search-wrapper {
        max-width: 100%;
    }
    .search-bar {
        height: 36px;
        padding: 0 14px;
        border-radius: 8px;
    }
    .search-bar input {
        font-size: 0.8rem;
    }
    .search-bar input::placeholder {
        font-size: 0.75rem;
    }
    .search-bar .search-icon {
        font-size: 0.75rem;
        margin-right: 10px;
    }
    .search-results {
        min-width: 0;
        left: 0;
        right: 0;
        max-height: 300px;
    }
    .search-result-item {
        padding: 8px 14px;
        gap: 10px;
    }
    .search-result-item .result-image {
        width: 36px;
        height: 36px;
    }
    .search-result-item .result-info .r-name {
        font-size: 0.75rem;
    }
    .search-result-item .result-info .r-desc {
        font-size: 0.65rem;
    }

    .header-row-1 {
        gap: 8px 14px;
    }
    .logo-text .brand {
        font-size: 1.1rem;
    }
    .logo-icon-img {
        height: 30px;
    }
    .header-row-2.open {
        max-height: 70px;
        padding: 2px 0 0 0;
    }
    .auth-btn {
        padding: 6px 14px;
        font-size: 0.6rem;
    }
    .auth-btn .avatar-icon {
        font-size: 0.75rem;
    }
    .profile-dropdown {
        min-width: 160px;
        right: -8px;
    }
    .profile-btn {
        font-size: 1.4rem !important;
    }
    .profile-btn .avatar-icon {
        font-size: 1.4rem !important;
    }
}

@media (max-width: 480px) {
    .search-bar {
        height: 32px;
        padding: 0 10px;
        border-radius: 6px;
    }
    .search-bar input {
        font-size: 0.75rem;
    }
    .search-bar input::placeholder {
        font-size: 0.7rem;
    }
    .search-bar .search-icon {
        font-size: 0.7rem;
        margin-right: 8px;
    }
    .search-results {
        max-height: 260px;
    }
    .search-result-item .result-info .r-name {
        font-size: 0.7rem;
    }
    .search-result-item .result-info .r-desc {
        font-size: 0.6rem;
    }
    .search-result-item .result-image {
        width: 30px;
        height: 30px;
    }

    .header-row-1 {
        gap: 6px 10px;
    }
    .logo-text .brand {
        font-size: 1rem;
    }
    .logo-text .tagline {
        font-size: 0.45rem;
        letter-spacing: 1.5px;
    }
    .logo-icon-img {
        height: 26px;
    }
    .whatsapp-cta {
        padding: 6px 12px;
        font-size: 0.6rem;
    }
    .whatsapp-cta i {
        font-size: 0.85rem;
    }
    .search-toggle {
        font-size: 0.95rem;
        padding: 4px 6px;
    }
    .auth-btn {
        padding: 5px 12px;
        font-size: 0.55rem;
    }
    .auth-btn .avatar-icon {
        font-size: 0.7rem;
    }
    .profile-dropdown {
        min-width: 150px;
        right: -4px;
    }
    .profile-dropdown .dropdown-item {
        padding: 8px 16px;
        font-size: 0.75rem;
    }
    .profile-btn {
        font-size: 1.2rem !important;
    }
    .profile-btn .avatar-icon {
        font-size: 1.2rem !important;
    }
    .header-row-2.open {
        max-height: 64px;
        padding: 2px 0 0 0;
    }
}