/* =====================================================================
   header.css
   ===================================================================== */

.main-header {
    background-color: var(--header-blue);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
    gap: 10px;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* header-left pegado al buscador, header-right al extremo derecho */
.header-left  { flex: 0 1 auto; min-width: 0; }
.header-right { flex: 0 0 auto; margin-left: auto; }

/* ---- Buscador ---- */
search-m-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin: 0 4px;
    background-image: url('/assets/img/m_icon_logo.png');
    background-size: 32px;
    background-repeat: no-repeat;
    cursor: pointer;
}

search-container {
    display: flex;
    align-items: center;
    background-color: var(--search-bg);
    border: 1px solid var(--login-input-border);
    border-radius: 20px;
    color: #fff;
    height: 30px;
    width: 300px;
    padding: 0 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

search-container .search-icon {
    width: 16px;
    height: 16px;
    margin: 0 10px 0 5px;
    background-image: url('/assets/img/search.png');
    background-size: 16px;
    background-repeat: no-repeat;
    flex: 0 0 16px;
}

search-container input {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 14px;
    height: 100%;
    padding: 0;
    margin: 0;
    text-align: left;
}

search-container input::placeholder { color: #a1a1a1; }

delete-icon, history-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    background-size: 16px;
    background-repeat: no-repeat;
    cursor: pointer;
}

delete-icon  { background-image: url('/assets/img/remove.png');  margin: 0 5px 0 8px; }
history-icon { background-image: url('/assets/img/history.png'); margin: 0 3px 0 8px; }

/* ---- Botones circulares ---- */
.circle-btn, .circle-btn-p {
    flex: 0 0 auto;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.2);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.1s ease;
    color: #fff;
}

.circle-btn .material-icons            { font-size: 20px; }
.circle-btn-p .material-icons          { font-size: 16px; }
.circle-btn .material-symbols-outlined { font-size: 18px; }
.btn-discontinued .material-icons,
.btn-margin .material-icons            { font-size: 18px; }

.circle-btn:active, .circle-btn-p:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-display-settings { background-color: #4a5281; border: 1px solid #5e6799; margin-left: 2px; }
.btn-display-settings:hover { background-color: #5a6499; }

.btn-manage-users { background-color: #4a5281; border: 1px solid #5e6799; margin-left: 2px; }
.btn-manage-users:hover { background-color: #5a6499; }

.btn-warehouse { background-color: #1E4E7C; border: 1px solid #1A446C; margin-left: 20px; }
.btn-warehouse:hover { background-color: #2B6CB0; }

.btn-distributor { background-color: #236E6B; border: 1px solid #236866; }
.btn-distributor:hover { background-color: #319795; }

.btn-new { background-color: #22543D; border: 1px solid #225E3E; margin-left: 20px; }
.btn-new:hover { background-color: #2F855A; }

.btn-discontinued { background-color: #2D3748; border: 1px solid #2D3748; }
.btn-discontinued:hover { background-color: #4A5568; }

.btn-margin { background-color: #5c169e; border: 1px solid #441D73; }
.btn-margin:hover { background-color: #711bc2; }

.btn-logout { background-color: #a33939; border: 1px solid #c55353; margin-left: 20px; }
.btn-logout:hover { background-color: #c74747; }

/* ---- Switcher de tema ---- */
.theme-card-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: #4A527D;
    border: 1px solid #5e6799;
    border-radius: 20px;
    padding: 3px 6px;
    margin-left: 2px;
    height: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.theme-btn {
    background: none;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #a5afd4;
    transition: all 0.2s ease;
    padding: 0;
}

.theme-btn .material-icons { font-size: 16px; }
.theme-btn.active { background-color: var(--accent); color: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.theme-btn:hover:not(.active) { color: #ffffff; }

@media (max-width: 900px) { search-container { width: 200px; } }
@media (max-width: 700px) {
    .main-header { flex-wrap: wrap; }
    search-container { width: 160px; }
}