grocery-app/frontend/src/styles/components/HouseholdSwitcher.css

140 lines
2.5 KiB
CSS

.household-switcher {
position: relative;
display: inline-block;
min-width: 220px;
}
.household-switcher-toggle {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
width: 100%;
padding: 0.5rem 1rem;
background: var(--button-ghost-bg);
border: 1px solid var(--border);
border-radius: 6px;
color: var(--text-primary);
font-size: 1rem;
cursor: pointer;
transition: all 0.2s ease;
}
.household-switcher-toggle:hover {
background: var(--button-ghost-hover-bg);
border-color: var(--button-ghost-border-hover);
}
.household-switcher-toggle:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.household-switcher-cta {
justify-content: center;
font-weight: 600;
color: var(--primary);
}
.household-switcher-empty .household-switcher-toggle {
width: 100%;
}
.household-name {
flex: 1;
overflow: hidden;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 500;
}
.dropdown-icon {
margin-left: auto;
flex-shrink: 0;
font-size: 0.75rem;
transition: transform 0.2s ease;
}
.dropdown-icon.open {
transform: rotate(180deg);
}
.household-switcher-overlay {
position: fixed;
inset: 0;
z-index: 999;
}
.household-switcher-dropdown {
position: absolute;
top: calc(100% + 0.5rem);
left: 0;
right: 0;
width: 100%;
overflow: hidden;
background: var(--card-bg);
border: 2px solid var(--border);
border-radius: 8px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
z-index: 1000;
}
.household-option {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding: 0.875rem 1rem;
background: var(--card-bg);
border: none;
border-bottom: 1px solid var(--border);
color: var(--text-primary);
font-size: 1rem;
text-align: left;
cursor: pointer;
transition: all 0.2s ease;
}
.household-option:last-child {
border-bottom: none;
}
.household-option:hover {
background: var(--button-secondary-bg);
border-color: var(--primary);
}
.household-option.active {
background: color-mix(in srgb, var(--primary) 15%, transparent);
color: var(--primary);
font-weight: 600;
}
.check-mark {
color: var(--primary);
font-size: 1.1rem;
font-weight: bold;
}
.household-divider {
height: 1px;
margin: 0.25rem 0;
background: var(--border);
}
.create-household-btn {
color: var(--primary);
font-weight: 600;
}
.create-household-btn:hover {
background: color-mix(in srgb, var(--primary) 15%, transparent);
}
@media (max-width: 640px) {
.household-switcher {
min-width: 180px;
}
}