/* ==========================================================================
   Marketplace shell styles — shared between Razor Pages (_Layout.cshtml)
   and Razor Components (PublicLayout.razor). Every public storefront
   surface, every Razor component page (cart, workspace creation,
   dashboard) renders inside this same shell.

   Eventual home is the DesignSystem (IdentityWidget + CartWidget become
   reusable components). For now duplication is avoided by sharing the
   classnames + this stylesheet between both layout paradigms.
   ========================================================================== */

.public-nav { display: flex; align-items: center; gap: 1rem; }

.cart-widget {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    color: var(--color-text, #1a1a1a);
    text-decoration: none;
    transition: background 120ms ease;
}
.cart-widget:hover { background: var(--color-surface-hover, #ececec); }
.cart-widget-icon { width: 1.25rem; height: 1.25rem; display: block; }
.cart-widget-badge {
    position: absolute;
    top: -0.125rem;
    right: -0.125rem;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.3125rem;
    border-radius: 999px;
    background: var(--color-primary, #5b3eea);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.125rem;
    text-align: center;
    box-shadow: 0 0 0 2px var(--color-bg, #0c0c14);
}

.identity-widget { position: relative; }
.identity-widget summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 999px;
    background: var(--color-surface, #f4f4f4);
    border: 1px solid var(--color-border, #e0e0e0);
    font-size: 0.875rem;
    color: var(--color-text, #1a1a1a);
    user-select: none;
}
.identity-widget summary::-webkit-details-marker { display: none; }
.identity-widget summary:hover { background: var(--color-surface-hover, #ececec); }

.identity-widget-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary, #5b3eea);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    object-fit: cover;
}
.identity-widget-name { font-weight: 500; }
.identity-widget-chevron { font-size: 0.6875rem; opacity: 0.7; }

.identity-widget-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 16rem;
    max-width: 22rem;
    background: var(--color-surface, white);
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0;
    z-index: 100;
    color: var(--color-text, #1a1a1a);
}

.identity-widget-header {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.identity-widget-header strong { font-size: 0.9375rem; }
.identity-widget-email {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #666);
}

.identity-widget-section {
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
}
.identity-widget-section:last-child { border-bottom: none; }

.identity-widget-section-label {
    padding: 0.25rem 0.875rem 0.125rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted, #666);
}

.identity-widget-workspace-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 14rem;
    overflow-y: auto;
}
.identity-widget-workspace-list a {
    display: flex;
    flex-direction: column;
    padding: 0.375rem 0.875rem;
    color: var(--color-text, #1a1a1a);
    text-decoration: none;
}
.identity-widget-workspace-list a:hover {
    background: var(--color-surface-hover, #f4f4f4);
}
.identity-widget-workspace-name { font-size: 0.875rem; }
.identity-widget-workspace-slug {
    font-size: 0.75rem;
    color: var(--color-text-muted, #666);
    font-family: var(--font-mono, ui-monospace, monospace);
}

.identity-widget-section a,
.identity-widget-logout-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding: 0.5rem 0.875rem;
    color: var(--color-text, #1a1a1a);
    text-decoration: none;
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.identity-widget-section a:hover,
.identity-widget-logout-button:hover {
    background: var(--color-surface-hover, #f4f4f4);
}
.identity-widget-create-workspace {
    color: var(--color-primary, #5b3eea) !important;
    font-weight: 500;
}
.identity-widget-logout-form { margin: 0; }

/* ---------- Skip link (a11y — WCAG 2.4.1) ---------------------------- */
.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -3rem;
    z-index: 1000;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius);
    text-decoration: none;
    transition: top 0.15s;
}

.skip-link:focus {
    top: 0.5rem;
}
