/* --- Budget Button (inherits from .main-action-button) --- */

.budget-button .budget-button-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.budget-item-counter {
    font-size: clamp(0.5rem, 1.5vw, 0.5625rem);
    font-weight: 700;
    color: var(--text-inverse);
    background-color: var(--status-alert);
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    display: none;
}

.budget-item-counter.has-items {
    display: inline-block;
}

.budget-item-counter.no-items {
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--bg-hover);
    opacity: 0.8;
}

/* --- Main Action Button (Base Style) --- */

.main-action-button {
    font-weight: 700;
    font-size: clamp(0.6825rem, 2.5vw, 0.8125rem);
    background: transparent;
    text-transform: capitalize;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0;
    text-align: left;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: color 0.2s ease-in-out;
    vertical-align: middle;
    padding: 6px 8px;
    letter-spacing: var(--smart-spacing);
    white-space: nowrap;
    flex-shrink: 0;
}

.main-action-button:hover,
.main-action-button:focus {
    color: var(--main-purple);
    outline: none;
}

.main-action-button:active {
    opacity: 0.7;
}

.main-action-button svg {
    stroke: currentColor;
    flex-shrink: 0;
    line-height: 0;
    width: 1.15em;
    height: 1.15em;
}

/* --- Layout Toggle & Mobile Wrapper (Specifics) --- */

.mobile-action-buttons {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 6px 12px;
    background-color: transparent;
    border-bottom: none;
    max-height: 100px;
    opacity: 1;
    overflow: hidden;
}

.mobile-action-buttons.hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;
}

.search-background .mobile-action-buttons {
    background-color: transparent;
    border-bottom: none;
    padding: 2px 12px;
}

.layout-toggle-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.layout-toggle-button {
    padding: 6px 8px;
    line-height: 1.2;
    gap: 4px;
    vertical-align: middle;
}

#layout-toggle-label {
    display: none;
}

#layout-toggle-label .icon-wrapper {
    display: inline-block;
    line-height: 0;
}

#layout-toggle-label .icon-wrapper svg {
    width: 1.15em;
    height: 1.15em;
}


/* --- Dark Mode --- */

body.dark-mode .budget-item-counter {
    color: white !important;
}

/* --- Media Queries --- */

@media (max-width: 700px) {

    .mobile-action-buttons {
        -ms-overflow-style: none;
        scrollbar-width: none;
        margin: 0;
        justify-content: center;
        overflow-x: auto;
        padding: 6px 16px;
    }

    .mobile-action-buttons::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, var(--bg-secondary));
        pointer-events: none;
    }

    .mobile-action-buttons::-webkit-scrollbar {
        display: none;
    }

    body.results-active .mobile-action-buttons {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 16px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    body.search-mode-stores.results-active .mobile-action-buttons {
        justify-content: flex-start;
    }
}