/* XUTE-Link brand logo */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 0;
    text-decoration: none;
    max-width: 100%;
}

a.brand-logo:hover {
    text-decoration: none;
    opacity: 1;
}

/* Child images — do not use variant classes on img elements */
.brand-logo .brand-logo-icon {
    display: block;
    flex: 0 0 auto;
    width: auto;
    height: inherit;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.brand-logo .brand-logo-wordmark {
    display: block;
    flex: 1 1 auto;
    width: auto;
    height: inherit;
    max-width: 100%;
    object-fit: contain;
}

/* Size modifiers on root */
.brand-logo-sm {
    height: 1.75rem;
}

.brand-logo-md {
    height: 2.25rem;
}

.brand-logo-lg {
    height: 3rem;
}

/* Variant: icon only */
.brand-logo-variant-icon.brand-logo-sm {
    height: 1.75rem;
}

.brand-logo-variant-icon.brand-logo-md {
    height: 2.25rem;
}

.brand-logo-variant-icon.brand-logo-lg {
    height: 3rem;
}

/* Variant: wordmark only */
.brand-logo-variant-wordmark.brand-logo-sm {
    height: 1.25rem;
}

.brand-logo-variant-wordmark.brand-logo-md {
    height: 1.5rem;
}

.brand-logo-variant-wordmark.brand-logo-lg {
    height: 2rem;
}

/* Variant: full (icon + wordmark) */
.brand-logo-variant-full.brand-logo-sm {
    height: 2rem;
}

.brand-logo-variant-full.brand-logo-md {
    height: 2.5rem;
}

.brand-logo-variant-full.brand-logo-lg {
    height: 3.25rem;
}

.brand-logo-variant-full .brand-logo-icon {
    height: 100%;
}

.brand-logo-variant-full .brand-logo-wordmark {
    height: 72%;
    align-self: center;
}

@media (max-width: 575.98px) {
    .brand-logo-variant-full.brand-logo-md,
    .brand-logo-variant-full.brand-logo-lg {
        height: 2.25rem;
        gap: 0.35rem;
    }
}

/* Powered-by footer */
.platform-powered-by {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.2;
}

.platform-powered-by-text {
    white-space: nowrap;
}

.platform-powered-by .brand-logo {
    height: 1.125rem;
}

.platform-powered-by .brand-logo .brand-logo-wordmark {
    height: 1rem;
}

/* Restaurant sidebar brand row */
.restaurant-sidebar-brand {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    min-height: 2.75rem;
}

.restaurant-sidebar-brand-logo {
    flex: 1 1 auto;
    min-width: 0;
    container-type: inline-size;
    container-name: restaurant-sidebar-brand;
}

.restaurant-sidebar-brand-logo-expanded,
.restaurant-sidebar-brand-logo-collapsed {
    display: none;
    align-items: center;
    max-width: 100%;
}

.restaurant-sidebar-brand-logo-expanded .brand-logo,
.restaurant-sidebar-brand-logo-collapsed .brand-logo {
    max-width: 100%;
}

body:not(.restaurant-sidebar-collapsed) .restaurant-sidebar-brand-logo-expanded {
    display: inline-flex;
}

body.restaurant-sidebar-collapsed .restaurant-sidebar-brand-logo-collapsed {
    display: inline-flex;
}

/* Hide wordmark cleanly when logo slot is too narrow (no clipping) */
@container restaurant-sidebar-brand (max-width: 11.5rem) {
    .restaurant-sidebar-brand-logo-expanded .brand-logo-variant-full .brand-logo-wordmark {
        display: none;
    }
}

.restaurant-sidebar-brand-toggle {
    flex: 0 0 auto;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    margin-left: 0;
    padding: 0;
    border: 1px solid var(--restaurant-border, #e2e8f0);
    border-radius: 0.5rem;
    background: #fff;
    color: #64748b;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: static;
}

.restaurant-sidebar-brand-toggle:hover {
    background: #f8fafc;
    color: #334155;
}

.restaurant-sidebar-brand-toggle svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

body.restaurant-sidebar-collapsed .restaurant-sidebar-brand-toggle svg {
    transform: rotate(180deg);
}

@media (min-width: 992px) {
    .restaurant-sidebar-brand-toggle {
        display: inline-flex;
    }

    body.restaurant-sidebar-collapsed .restaurant-sidebar {
        width: 5.25rem;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    body.restaurant-sidebar-collapsed .restaurant-sidebar .sidebar-heading,
    body.restaurant-sidebar-collapsed .restaurant-sidebar .nav-link {
        opacity: 0;
        visibility: hidden;
        height: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        pointer-events: none;
    }

    body.restaurant-sidebar-collapsed .restaurant-sidebar-brand {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    body.restaurant-sidebar-collapsed .restaurant-sidebar-brand-logo {
        flex: 0 0 auto;
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

/* SuperAdmin sidebar brand row */
.sa-sidebar-brand {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    min-height: 2.75rem;
}

.sa-sidebar-brand-logo {
    flex: 1 1 auto;
    min-width: 0;
    container-type: inline-size;
    container-name: sa-sidebar-brand;
}

.sa-brand-header {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 0.75rem;
    padding: 0.5rem 0.625rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.sa-sidebar-brand-logo-expanded,
.sa-sidebar-brand-logo-collapsed {
    display: none;
    align-items: center;
    max-width: 100%;
}

.sa-sidebar-brand-logo-expanded .brand-logo,
.sa-sidebar-brand-logo-collapsed .brand-logo {
    max-width: 100%;
}

body:not(.sa-sidebar-collapsed) .sa-sidebar-brand-logo-expanded {
    display: inline-flex;
}

body.sa-sidebar-collapsed .sa-sidebar-brand-logo-collapsed {
    display: inline-flex;
}

@container sa-sidebar-brand (max-width: 11.5rem) {
    .sa-sidebar-brand-logo-expanded .brand-logo-variant-full .brand-logo-wordmark {
        display: none;
    }
}

.sa-sidebar-brand-toggle {
    flex: 0 0 auto;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    margin-left: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.35);
    color: var(--sa-muted, #94a3b8);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: static;
}

.sa-sidebar-brand-toggle:hover {
    background: rgba(15, 23, 42, 0.55);
    color: #e2e8f0;
}

.sa-sidebar-brand-toggle svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

body.sa-sidebar-collapsed .sa-sidebar-brand-toggle svg {
    transform: rotate(180deg);
}

@media (min-width: 992px) {
    .sa-sidebar-brand-toggle {
        display: inline-flex;
    }

    body.sa-sidebar-collapsed .sa-sidebar {
        width: 5.25rem;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    body.sa-sidebar-collapsed .sa-sidebar .text-uppercase,
    body.sa-sidebar-collapsed .sa-sidebar .nav-link {
        opacity: 0;
        visibility: hidden;
        height: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        pointer-events: none;
    }

    body.sa-sidebar-collapsed .sa-sidebar-brand {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    body.sa-sidebar-collapsed .sa-sidebar-brand-logo {
        flex: 0 0 auto;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    body.sa-sidebar-collapsed .sa-brand-header {
        padding: 0.5rem;
    }
}

/* Auth / system pages centered logo */
.auth-brand-wrap {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-brand-wrap .brand-logo-lg {
    height: 3.5rem;
    justify-content: center;
}

@media (min-width: 768px) {
    .auth-brand-wrap .brand-logo-lg {
        height: 4rem;
    }
}
