/* Shared floating header styles */
:root {
    --header-max: 1440px;
}

.header-shell {
    position: sticky;
    top: 10px;
    z-index: 5000;
    display: flex;
    justify-content: center;
    padding: 0 clamp(0.5rem, 2vw, 1.25rem);
    overflow: visible;
}

.header-floating {
    position: relative;
    z-index: inherit;
    border-radius: 18px;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
    width: 100%;
    background: rgba(10, 15, 30, 0.65);
    box-shadow: 0 12px 35px rgba(2, 6, 23, 0.28), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
    backdrop-filter: blur(16px);
    overflow: visible;
}

body.theme-light .header-floating {
    background: rgba(241, 245, 249, 0.85);
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 12px 35px rgba(2, 6, 23, 0.14), 0 2px 0 rgba(0, 0, 0, 0.03) inset;
}

.main-navbar {
    border-bottom: 0;
    padding-block: 0.55rem;
    background: transparent;
    position: relative;
    z-index: inherit;
}

.header-floating>.container,
.header-floating>.container-fluid,
.header-floating>.container-xl {
    max-width: var(--header-max);
    margin-inline: auto;
    width: 100%;
    padding-inline: clamp(0.75rem, 2vw, 1rem);
    overflow: visible;
}

@media (min-width: 1400px) {

    .header-floating>.container,
    .header-floating>.container-fluid,
    .header-floating>.container-xl {
        max-width: 1680px;
    }
}

.header-container {
    max-width: var(--header-max);
    margin-inline: auto;
    width: 100%;
    padding-inline: clamp(0.75rem, 2vw, 1rem);
}

.navbar-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand {
    margin-inline-start: 0.25rem;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Navbar toggler color by theme */
.navbar-toggler {
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 0.35rem 0.5rem;
}

/* Dark mode: light icon */
body.theme-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%23f8fafc' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}
body.theme-dark .navbar-toggler {
    border-color: rgba(148, 163, 184, 0.45);
}

/* Light mode: dark icon */
body.theme-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%230f172a' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}
body.theme-light .navbar-toggler {
    border-color: rgba(100, 116, 139, 0.45);
}

@media (min-width: 992px) {
    .brand-col {
        order: 1;
    }

    .links-col {
        order: 2;
        flex: 1;
    }

    .actions-col {
        order: 3;
    }

    .navbar-nav {
        justify-content: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        padding-top: 0.5rem;
        margin-top: 0.25rem;
        border-top: 1px solid var(--border, rgba(148, 163, 184, 0.3));
    }

    .navbar-actions {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
        margin-top: 0.25rem;
        flex-wrap: wrap;
    }
}

.brand-logo__img {
    height: 120px;
    width: auto;
    display: none;
}

@media (max-width: 576px) {
    .brand-logo__img {
        height: 36px;
    }
}

.brand-logo__img--dark {
    display: block;
}

@media (prefers-color-scheme: dark) {
    body:not(.theme-light):not(.theme-dark) .brand-logo__img--light {
        display: block;
    }

    body:not(.theme-light):not(.theme-dark) .brand-logo__img--dark {
        display: none;
    }
}

body.theme-dark .brand-logo__img--light {
    display: block;
}

body.theme-dark .brand-logo__img--dark {
    display: none;
}

body.theme-light .brand-logo__img--light {
    display: none;
}

body.theme-light .brand-logo__img--dark {
    display: block;
}

.navbar .nav-link {
    font-weight: 600;
}

body.theme-dark .navbar .nav-link {
    color: #f8fafc;
    opacity: 0.95;
}

body.theme-dark .navbar .nav-link:hover {
    color: #ffffff;
}

body.theme-light .navbar .nav-link {
    color: #0f172a;
    opacity: 0.95;
}

body.theme-light .navbar .nav-link:hover {
    color: #111827;
}

.btn-cta {
    border-radius: 999px;
    padding: 0.45rem 1.25rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--primary, #6366f1), var(--primary-strong, #4f46e5));
    color: #fff;
    border: none;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-cta:hover,
.btn-cta:focus {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(79, 70, 229, 0.45);
}

.btn-ghost {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    padding: 0.45rem 1.2rem;
    font-weight: 600;
    color: var(--text-main, #e2e8f0);
    background: transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover,
.btn-ghost:focus {
    border-color: var(--primary, #6366f1);
    color: #fff;
}

body.theme-dark .btn-ghost {
    border-color: rgba(148, 163, 184, 0.35);
    color: #f8fafc;
}

body.theme-light .btn-ghost {
    border-color: #cbd5e1;
    color: #0f172a;
}

.profile-dropdown__toggle {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.profile-dropdown__toggle:hover,
.profile-dropdown__toggle:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.08);
}

.profile-dropdown {
    position: relative;
    z-index: 12000;
}

.profile-dropdown__menu {
    width: min(320px, 80vw);
    padding: 0.75rem;
    border-radius: 18px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    box-shadow: 0 25px 45px rgba(15, 23, 42, 0.25);
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    margin-top: 0.35rem;
    z-index: 2;
}

.profile-dropdown__menu p,
.profile-dropdown__menu small,
.profile-dropdown__menu strong,
.profile-dropdown__menu span {
    color: inherit;
}


@media (max-width: 576px) {
    .profile-dropdown__menu {
        width: min(92vw, 360px);
        left: 50% !important;
        right: auto !important;
        /* transform: translateX(-50%); */
    }
}

body.theme-light .profile-dropdown__menu {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

.profile-dropdown__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    margin-bottom: 0.75rem;
    text-align: center;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-dropdown__avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 4px;
    background: rgba(99, 102, 241, 0.08);
}

.profile-dropdown__name {
    margin: 0;
    color: #f8fafc;
    font-weight: 700;
}

.profile-dropdown__email {
    margin: 0;
    font-size: 0.85rem;
    color: #dfe7fb;
    opacity: 0.85;
}

.profile-dropdown__role {
    margin-inline-start: auto;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.profile-dropdown__role.is-admin {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
}

.profile-dropdown__role.is-customer {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

body.theme-light .profile-dropdown__role.is-admin {
    color: #4338ca;
}

body.theme-light .profile-dropdown__role.is-customer {
    color: #15803d;
}

.profile-dropdown__section {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.profile-dropdown__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, transform 0.2s ease;
    text-align: center;
}

.profile-dropdown__item:hover,
.profile-dropdown__item:focus {
    background: rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.profile-dropdown__item strong {
    display: block;
    color: #f8fafc;
    font-size: 0.95rem;
}

.profile-dropdown__item small {
    color: rgba(248, 250, 252, 0.85);
}

body.theme-light .profile-dropdown__item small {
    color: #475569;
}

.profile-dropdown__item .bx {
    font-size: 1.25rem;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.theme-light .profile-dropdown__item .bx {
    color: #4c1d95;
}

.profile-dropdown__footer {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 0.65rem;
    display: flex;
    justify-content: center;
}

.profile-dropdown__logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: #f87171;
    text-decoration: none;
    text-align: center;
}

.profile-dropdown__logout .bx {
    font-size: 1rem;
}

body.theme-light .profile-dropdown__logout {
    color: #b91c1c;
}

@media (max-width: 576px) {
    .navbar {
        padding: 0.6rem 0;
    }

    .navbar .btn,
    .navbar .nav-link {
        padding: 0.35rem 0.75rem;
    }
}


body.theme-light .profile-dropdown__name {
    color: #0f172a;
}

body.theme-light .profile-dropdown__email {
    color: #475569;
}

body.theme-light .profile-dropdown__item strong {
    color: #0f172a;
}

